Jump to content


Photo
- - - - -

Template in base not overriding corresponding template in Pro


  • Please log in to reply
1 reply to this topic

#1 justinroffmarsh

justinroffmarsh

    Advanced Member

  • Members
  • 30 posts
  • Country: Country Flag

Posted 30 November 2011 - 07:42 PM

I'm using the Sliding Panel plugin, which requires that a line of code is added after the opening body tag in header.php. When I add this code to header.php in Pro it works fine. I have created a duplicate of header.php called template.header.php and placed it in the platformbase folder. When I add this line of code to that file it doesn't work. Accordingly, it appears that the latter file is not overriding the former. Love to know what I've done wrong.

#2 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 30 November 2011 - 11:10 PM

That method of child templating is not intended to work with header.php. The correct way to do this is to use a hook:

Please Login or Register to see this Hidden Content



Here's an example of how to do it: (this goes in platformbase/functions.php)

Please Login or Register to see this Hidden Content



Use one of these hooks, I can't remember which:
pagelines_before_html
pagelines_head
pagelines_before_site
pagelines_before_page
before_header
pagelines_before_main