Keyword

Add "<header>" section for a k2 template

  • Benoit de Mulder
  • Benoit de Mulder's Avatar Topic Author
  • Offline
  • New Member
More
4 years 3 months ago #174202 by Benoit de Mulder
Add "<header>" section for a k2 template was created by Benoit de Mulder
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.

More
4 years 3 months ago #174204 by JoomlaWorks
Replied by JoomlaWorks on 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.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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
4 years 3 months ago #174206 by Benoit de Mulder
Replied by Benoit de Mulder on 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.

More
4 years 3 months ago #174207 by JoomlaWorks
Replied by JoomlaWorks on topic Add "<header>" section for a k2 template
So you want to trigger some JS code from within item.php? Is that your question?

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum