Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
FNZAS Invision Posted July 27, 2015 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.
Carlos S. Posted July 27, 2015 Posted July 27, 2015 Hello, Could you explain more better please so I can try to help. Kind Regards, Carlos S.
FNZAS Invision Posted July 27, 2015 Author 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
Meddysong Posted July 28, 2015 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
FNZAS Invision Posted July 28, 2015 Author 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
FNZAS Invision Posted July 30, 2015 Author Posted July 30, 2015 Still no joy no documentation on targeting @Meddysong
FNZAS Invision Posted July 30, 2015 Author 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
Chris Bell Posted August 2, 2015 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.