Jump to content

How can I have two logos?


Recommended Posts

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
Link to comment
Share on other sites

  • 2 weeks later...
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

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Recently Browsing   0 members

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