Jump to content

Recommended Posts

Posted

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!

Posted (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 by drawncodes
Posted (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 by drawncodes
  • 2 weeks later...
Posted
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?

Posted
{{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

Posted
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!  🙂

Posted (edited)

Could contain: Plot, Chart, Text

 

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 by drawncodes
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...