Hi all,
After updating to 1.1.0.6. I started to explore more of the templating possibilities. Easily switching between templates brought me to a question.
Is it possible to have a Content Module (eg carrousel) only assigned to a particular template? So duplicate and rename the carrousel stuff and assign to template.
Tnx! Arjan
Set Content Module per Template
- burt
- Core Team
- Posts: 4551
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 412 times
Re: Set Content Module per Template
Upload the TPL file of the Module to the templates.
EG:
/includes/modules/content/index/templates/tpl_carousel.php
TO `first_template`:
/templates/first_template/includes/modules/content/index/tpl_carousel.php
AND TO `another_template`:
/templates/another_template/includes/modules/content/index/tpl_carousel.php
Now you have the Carousel being displayed by two separate templates.
If you do not want that Carousel in `first_template`, just change the `first_template` file to "blank" (ie the file IS there [thus overriding the Core or Addon File], but has NO content. If it has NO content...it won't show.
That's a way, it might not be the perfect way or the only way.
I don't know if there might be an addon that makes this process easier?
EG:
/includes/modules/content/index/templates/tpl_carousel.php
TO `first_template`:
/templates/first_template/includes/modules/content/index/tpl_carousel.php
AND TO `another_template`:
/templates/another_template/includes/modules/content/index/tpl_carousel.php
Now you have the Carousel being displayed by two separate templates.
If you do not want that Carousel in `first_template`, just change the `first_template` file to "blank" (ie the file IS there [thus overriding the Core or Addon File], but has NO content. If it has NO content...it won't show.
That's a way, it might not be the perfect way or the only way.
I don't know if there might be an addon that makes this process easier?
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.
- burt
- Core Team
- Posts: 4551
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 412 times
Re: Set Content Module per Template
Importantly, notice that when you upload a TPL file to a Template it does not need the /templates directory;
EG:
/includes/modules/content/index/templates/tpl_carousel.php
TO `first_template`:
/templates/first_template/includes/modules/content/index/tpl_carousel.php <-- /templates not needed here
EG:
/includes/modules/content/index/templates/tpl_carousel.php
TO `first_template`:
/templates/first_template/includes/modules/content/index/tpl_carousel.php <-- /templates not needed here
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.