0

I have two includes - one which essentially displays a tab with a date, and another which has two tabs with two dates. Basically: Includes/include_one & Includes/include_two.

All working fine but these are needed to be dynamic and choosable from the CP by the user who is not able to edit the templates to change this.

How would you go about this?

1 Answer 1

2

The most direct route for a user that is restricted from editing templates would be a flag somewhere they can access.

You'll need to add more details to your question, but one thought that works is to add a field to a channel that they can turn on or off. For example, if this is related to one single page that has one entry driving it, you could add the field to that channel and just switch on that field like so:

{exp:channel:entries
    channel="my_channel"
    entry_id="123"
    limit="1"}

    {if my_switch_field}
        {embed="includes/include_one"}
    {if:else}
        {embed="includes/include_two"}
    {/if}

    {!-- rest of the template here --}

{/exp:channel:entries}

If this isn't one entry but more of a global setting, you can also create a Settings channel, create a single entry in it, and add fields to that channel that function like site-wide settings. Then you can add the flag field to that channel give the user access to that channel.

If this doesn't help, please add some more details to your question that give us more insight on your problem.

1
  • 1
    Thanks, this is what I was thinking of too. Will go with this, cheers!
    – segovius
    Jun 9, 2019 at 10:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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