Adding positions in child template

Everything to do with Joomla! 4.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
kkurtz
Joomla! Intern
Joomla! Intern
Posts: 56
Joined: Thu Jul 12, 2012 1:38 pm

Adding positions in child template

Post by kkurtz » Tue Dec 19, 2023 2:06 pm

This is a general question, not related to a specific site. I want to add a position to a child template in Joomla 4, say in the footer. I know I have to add the position name in templatedetails. In J3 there would have been a jdoc include in the index.php file. So do I need a jdoc include in the index.php for Cassiopeia? And if, so won't it be wiped out when Cassiopeia is updated? Is there another way?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30988
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Adding positions in child template

Post by Per Yngve Berg » Tue Dec 19, 2023 2:55 pm

Copy the index.php file to the child template and modify it there.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44121
Joined: Sat Apr 05, 2008 9:58 pm

Re: Adding positions in child template

Post by Webdongle » Tue Dec 19, 2023 5:48 pm

Does it need to be defined in the xml file as well?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12787
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: Adding positions in child template

Post by brian » Tue Dec 19, 2023 6:20 pm

Webdongle wrote:
Tue Dec 19, 2023 5:48 pm
Does it need to be defined in the xml file as well?
No - only if you want it to be listed in the module position select. If you can remember the name of the position then the index.php is all you have to edit
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44121
Joined: Sat Apr 05, 2008 9:58 pm

Re: Adding positions in child template

Post by Webdongle » Tue Dec 19, 2023 6:59 pm

And if they forgot then they would just need to view the Template positions from the Template manager ... yes?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12787
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: Adding positions in child template

Post by brian » Tue Dec 19, 2023 7:13 pm

obviously
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44121
Joined: Sat Apr 05, 2008 9:58 pm

Re: Adding positions in child template

Post by Webdongle » Tue Dec 19, 2023 8:30 pm

To some yes but not to a few (or many) newbies who might read this thread. Over 100 views in the 6+ hours since the op.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2712
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Adding positions in child template

Post by ceford » Wed Dec 20, 2023 8:21 am

Why a new position in the footer position? Just arrange your modules in the existing footer position in your desired order and style them as you see fit.

kkurtz
Joomla! Intern
Joomla! Intern
Posts: 56
Joined: Thu Jul 12, 2012 1:38 pm

Re: Adding positions in child template

Post by kkurtz » Wed Dec 20, 2023 6:30 pm

Thank you all. I will give this a try.

kkurtz
Joomla! Intern
Joomla! Intern
Posts: 56
Joined: Thu Jul 12, 2012 1:38 pm

Re: Adding positions in child template

Post by kkurtz » Sun Apr 14, 2024 5:47 pm

I am placing two modules in the below-top position. One module contains an image and the other some text. I want the image to be on the left and the text on the right. Ceford (above) said to arrange the modules in the desired order. But I am not sure how to specify the order. So far the image is on the right and the text on the left.


Post Reply

Return to “Templates for Joomla! 4.x”