Craft CMS Asked by evvvvritt on October 29, 2020
Is it possible to migrate content like categories from an entry to an asset easily?
Each entry has an image asset and I’d like to move all the categories on the entry to the asset.
Would this require a SQL operation or is there any easier way?
I would probably do this in two steps:
AssetId, Category<br>
{% for entry in entries %}
{{ entry.asset.one().id }}, {% for category in categories %}{{ category.id }}{% if not loop.last %}-|-{% endif %}{% endfor %}<br>
{% endfor %}
Correct answer by dmatthams on October 29, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP