1

Have inherited an EE build that uses Structure and has a handful of channels.

There is 1 'page' type and 4 'listings'. Unfortunately, the dev has decided to use 1 template for the single entry views of each.

Does anyone know how I can modify the template being used for each of the entries (1000s) in a given channel?

I know there's this script but that changes the template for everything http://buildwithstructure.com/documentation/how_can_i_batch_update_templates_for_existing_entries/

It seems that Structure stores the template against the entry in a base64 encoded field (site_pages) inside exp_sites but can't see any way to change.

1

Give this script a try to edit the templates: http://buildwithstructure.com/documentation/how_can_i_batch_update_templates_for_existing_entries/

| improve this answer | |
  • yeah but won't that change the template for all listing entries? I have 4 listing channels, I need the existing entries for those channels to use 4 different templates. – Steven Grant Aug 5 '13 at 16:35
0

Couldn't you modify the provided script to make it do what you want?

The script already takes the serialized data and changes template X to Y. What you want is X changed to something else depending on the listing channel. After looking at the script there's few ways to go about it.

1) Get all entry IDs for a specific listing channel and use that to determine which templates get switched.

2) If listing channels have a base URL segment (such as news, products, staff) you could use that to determine which templates get switched.

Structure maps entry ids to template ids. All it should take is few IF conditions to accomplish what you want.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.