Keyword

Add "<header>" section for a k2 template

  • Benoit de Mulder
  • Benoit de Mulder's Avatar Topic Author
  • Offline
  • New Member
More
5 months 1 week ago #174202 by Benoit de Mulder
Benoit de Mulder created the topic: Add "<header>" section for a k2 template
Is there a way to add a custom <header> section for a given template? I would like to have the item.php for one template I developed using a particular js include.

Any idea where I can add conditional code checking for the template in use and insert the required include?

Thank you

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
5 months 1 week ago #174204 by Fotis
Fotis replied the topic: Add "<header>" section for a k2 template
K2 templating is very flexible. You can either use a different item.php per set of categories (which will make separation easier) or you can use a single item.php file with some if/else statements inside to reflect different content per occasion.

See also getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates for K2 templating.

If you can describe in more detail what you wish to do, I'll be able to propose the best solution.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • Benoit de Mulder
  • Benoit de Mulder's Avatar Topic Author
  • Offline
  • New Member
More
5 months 1 week ago #174206 by Benoit de Mulder
Benoit de Mulder replied the topic: Add "<header>" section for a k2 template
Sorry if I was not clear. I have already several templates depending on the content (book, large photo, movie). I use now an iframe from the item.php to call the content but I would like to call it directly from the content. I use several js scripts to render the viewer, one for the book viewer, one for the large image display. Some part of the javascript application requires to be called from the <head> section of the page,

So my question is with a K2 Template, what will be the best method to add this code? Is this section of the page (head) out of the scope of the K2 templating system? Should I write a K2 plugin?

Thank you for your support.

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
5 months 1 week ago #174207 by Fotis
Fotis replied the topic: Add "<header>" section for a k2 template
So you want to trigger some JS code from within item.php? Is that your question?

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum