MartinLawrence Posted January 14 Share Posted January 14 I would like logo1 to draw attention to itself, but only on the front page. On additional pages, it should show logo2, which is not animated. Can anyone help point me in the direction of where I need to modify the code? Thanks! Link to comment Share on other sites More sharing options...
Randy Calvert Posted January 14 Share Posted January 14 It sounds like you would need to edit your theme. Find the part of the template generating the logo and modify it to have an if/else logic statement based on your requirements. Link to comment Share on other sites More sharing options...
drawncodes Posted January 14 Share Posted January 14 (edited) Easy. Follow this steps. Go to your template, search in templates for "logo" than replace that code with this one: {{if isset( \IPS\Theme::i()->logo['front']['url'] ) AND \IPS\Theme::i()->logo['front']['url'] !== null }} {{$logo = \IPS\File::get( 'core_Theme', \IPS\Theme::i()->logo['front']['url'] )->url;}} <a href='{setting="base_url"}' id='elLogo' accesskey='1'> {{if request.module == 'forums' && request.controller == 'index'}} <img src="{$logo}" alt='{setting="board_name" escape="true"}'> {{else}} <img src="your logo link that is not animated" alt='{setting="board_name" escape="true"}'> {{endif}} </a> {{else}} <a href='{setting="base_url"}' id='elSiteTitle' accesskey='1'>{setting="board_name"}</a> {{endif}} This means, that IF the request.module == 'forums' && request.controller == 'index' will show the first logo on the index page (where the forums are) ELSE show the second logo. Where you see {$logo} that is the one uploaded directly to the template. after ELSE, where <img> to src="" add the link of your second logo ! Enjoy! Edited January 14 by drawncodes Link to comment Share on other sites More sharing options...
drawncodes Posted January 14 Share Posted January 14 (edited) This should work 100% ! Sorry for x2 reply, I wanted to edit the one above but it seems like I'm sleeping today 😄 😛 Edited January 14 by drawncodes Link to comment Share on other sites More sharing options...
MartinLawrence Posted January 25 Author Share Posted January 25 On 1/14/2023 at 3:51 AM, drawncodes said: that IF the request.module == 'forums' && request.controller == 'index' will show the first logo on the index page (where the forums are) ELSE show the second logo. Where you see {$logo} that is the one uploaded directly to the template. after ELSE, where <img> to src="" add the link of your second logo ! Great thx, I understand the logic! What I want is for the animated logo to show only on a specific page - not the forum. So I would use {{if request.module == 'pages'}} && request.controller == 'index' ?? How do I get and reference the page name? Link to comment Share on other sites More sharing options...
drawncodes Posted January 25 Share Posted January 25 Give me the link to the page you wanted it to show, and I make the if statement for ya. Link to comment Share on other sites More sharing options...
drawncodes Posted January 26 Share Posted January 26 {{if isset( \IPS\Theme::i()->logo['front']['url'] ) AND \IPS\Theme::i()->logo['front']['url'] !== null }} {{$logo = \IPS\File::get( 'core_Theme', \IPS\Theme::i()->logo['front']['url'] )->url;}} <a href='{setting="base_url"}' id='elLogo' accesskey='1'> {{if request.module == 'pages' && request.controller == 'page'}} <img src="{$logo}" alt='{setting="board_name" escape="true"}'> {{else}} <img src="your logo link that is not animated" alt='{setting="board_name" escape="true"}'> {{endif}} </a> {{else}} <a href='{setting="base_url"}' id='elSiteTitle' accesskey='1'>{setting="board_name"}</a> {{endif}} Here, enjoy! @MartinLawrence MartinLawrence 1 Link to comment Share on other sites More sharing options...
MartinLawrence Posted January 26 Author Share Posted January 26 54 minutes ago, drawncodes said: {{if request.module == 'pages' && request.controller == 'page'}} That worked, although it's not very intuitive. Is there a page which lists all the properties I can use? Thank you again, budding developer! 🙂 Link to comment Share on other sites More sharing options...
drawncodes Posted January 26 Share Posted January 26 (edited) When you are on a page, you need to look for this 2 (data-pagemodule and data-pagecontroller) data-pagemodule = request.module data-pagecontroller = request.controller Now you can just do it with one, for example {{if request.module == "pages"}} But I like to do it with 2 to be sure, cuz sometimes the same module can be on different pages and the controller changes or even reverse! Enjoy. Edited January 26 by drawncodes Link to comment Share on other sites More sharing options...
Recommended Posts