FNZAS Invision Posted July 27, 2015 Share Posted July 27, 2015 Hi there,I've been scouting through the documentation trying to find variables a template has access too - haven't been able to find anything too helpful.Basically in my template i'm wanting to change the layout slightly if their on the home page. Link to comment Share on other sites More sharing options...
Carlos S. Posted July 27, 2015 Share Posted July 27, 2015 Hello, Could you explain more better please so I can try to help. Kind Regards, Carlos S. Link to comment Share on other sites More sharing options...
FNZAS Invision Posted July 27, 2015 Author Share Posted July 27, 2015 For example like in Wordpress there is is_front_page() (https://codex.wordpress.org/Function_Reference/is_front_page) So in my global template i'd want to have something like {{ if is_front_page }} <h1>Something that only shows up on the home page</h1>{{ endif }} I'm also using the Pages application Link to comment Share on other sites More sharing options...
Meddysong Posted July 28, 2015 Share Posted July 28, 2015 I can't offer any concrete advice on how to go about pulling this off, but each Pages article has its own id number (page_id in table cms_pages). I would think there's some way of targeting along the lines of an if-clause looking for data-pageapp=cms, data-pagelocation=front, data-pagemodule=pages and data-pageid=xx. I'm way outside my comfort zone with this sort of advice but it might help spur someone more knowledgeable than me to complete the answer, so I thought I'd post it anyway Link to comment Share on other sites More sharing options...
FNZAS Invision Posted July 28, 2015 Author Share Posted July 28, 2015 I can't offer any concrete advice on how to go about pulling this off, but each Pages article has its own id number (page_id in table cms_pages). I would think there's some way of targeting along the lines of an if-clause looking for data-pageapp=cms, data-pagelocation=front, data-pagemodule=pages and data-pageid=xx. I'm way outside my comfort zone with this sort of advice but it might help spur someone more knowledgeable than me to complete the answer, so I thought I'd post it anyway Thank you very much, there doesn't seem to much documentation around this which is a bit of a shame. Once I work it out i'll reply back here Link to comment Share on other sites More sharing options...
FNZAS Invision Posted July 30, 2015 Author Share Posted July 30, 2015 Still no joy no documentation on targeting @Meddysong Link to comment Share on other sites More sharing options...
FNZAS Invision Posted July 30, 2015 Author Share Posted July 30, 2015 Using a hack.. Found a temporary solution using {{if \IPS\Request::i()->url() == "xxx"}} do something {{endif}} but is not ideal for other pages Link to comment Share on other sites More sharing options...
Meddysong Posted August 2, 2015 Share Posted August 2, 2015 @Adrienne Dodge: Is this any use to you? Link to comment Share on other sites More sharing options...
Chris Bell Posted August 2, 2015 Share Posted August 2, 2015 i believe you can do this by activating developer mode and adding (print) trigger to the pagescroll down to - Display template contents to read instructions Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.