Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: tarantula901 on December 17, 2020, 02:24:17 PM

Title: Just about appearing in header and homepage
Post by: tarantula901 on December 17, 2020, 02:24:17 PM
I want an image or other code to appear only on the main page and title, what code can we use for this?

Title: Re: Just about appearing in header and homepage
Post by: tarantula901 on December 19, 2020, 11:42:26 AM
Can't understand my question?
Title: Re: Just about appearing in header and homepage
Post by: Antechinus on December 19, 2020, 01:55:24 PM
Where on the page do you want it?
Title: Re: Just about appearing in header and homepage
Post by: Sir Osis of Liver on December 19, 2020, 10:55:47 PM
Try this -



     if (($context['current_action'] == '')


Title: Re: Just about appearing in header and homepage
Post by: Chen Zhen on December 19, 2020, 11:29:59 PM

You can use a portal modification to create a block containing whatever you're trying to display and have it set to appear on the desired pages/sections.
Title: Re: Just about appearing in header and homepage
Post by: tarantula901 on December 22, 2020, 08:01:07 PM
Quote from: Sir Osis of Liver on December 19, 2020, 10:55:47 PM
Try this -



     if (($context['current_action'] == '')



I think this will do, thank you.

Quote from: Chen Zhen on December 19, 2020, 11:29:59 PM

You can use a portal modification to create a block containing whatever you're trying to display and have it set to appear on the desired pages/sections.

I don't use a portal anyway, thanks.
Title: Re: Just about appearing in header and homepage
Post by: shadav on December 29, 2020, 01:15:12 PM
just checking in to make sure that that worked for you....
can we mark this topic as solved or do you still need help?
Title: Re: Just about appearing in header and homepage
Post by: tarantula901 on January 15, 2021, 07:01:36 PM
unfortunately not working
Title: Re: Just about appearing in header and homepage
Post by: Mick. on January 15, 2021, 08:39:45 PM
Maybe

if ($context['current_action'] == 'whatever the action may be')
  {
  echo '
    <div>your code</div>';
  }


The code Liver posted had 3 parenthesis
Title: Re: Just about appearing in header and homepage
Post by: tarantula901 on January 16, 2021, 04:44:06 AM
Quote from: Mick. on January 15, 2021, 08:39:45 PM
Maybe

if ($context['current_action'] == 'whatever the action may be')
  {
  echo '
    <div>your code</div>';
  }


The code Liver posted had 3 parenthesis

I saw the parenthesis error and solved that problem.

What value should be for the homepage. Home?

Fields like other search help memberlist are okay, but home page doesn't appear.

Required for me homepage.
Title: Re: Just about appearing in header and homepage
Post by: Mick. on January 16, 2021, 05:13:56 AM
Im not sure since a portal is not an action.. Leave it empty. It will show in non action pages like the portal, message index and topic view.
Title: Re: Just about appearing in header and homepage
Post by: Sir Osis of Liver on January 16, 2021, 10:50:06 PM
(You can never have ((too many)) parentheses.) :P