Advertisement:

Author Topic: Just about appearing in header and homepage  (Read 838 times)

Offline tarantula901

  • Jr. Member
  • **
  • Posts: 370
Just about appearing in header and homepage
« 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?


Offline tarantula901

  • Jr. Member
  • **
  • Posts: 370
Re: Just about appearing in header and homepage
« Reply #1 on: December 19, 2020, 11:42:26 AM »
Can't understand my question?

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,519
  • Master of BBC Abuse
Re: Just about appearing in header and homepage
« Reply #2 on: December 19, 2020, 01:55:24 PM »
Where on the page do you want it?

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 10,700
  • We were all equal in the end.
Re: Just about appearing in header and homepage
« Reply #3 on: December 19, 2020, 10:55:47 PM »
Try this -

Code: [Select]

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

“The best laid schemes o' mice an' men / Gang aft a-gley.” - Robert Burns

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,313
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: Just about appearing in header and homepage
« Reply #4 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.

My SMF Mods & Plug-Ins

WebDev

Request politely & demand nothing.

Offline tarantula901

  • Jr. Member
  • **
  • Posts: 370
Re: Just about appearing in header and homepage
« Reply #5 on: December 22, 2020, 08:01:07 PM »
Try this -

Code: [Select]

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


I think this will do, thank you.


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.

Offline shadav

  • Support Team Apprentice
  • Sr. Member
  • ****
  • Posts: 868
  • Gender: Female
    • shadav on Facebook
    • leashadav on GitHub
    • Ask The Muslims: A Place To Ask Honest Questions and Receive Respectful Answers
Re: Just about appearing in header and homepage
« Reply #6 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?

Offline tarantula901

  • Jr. Member
  • **
  • Posts: 370
Re: Just about appearing in header and homepage
« Reply #7 on: January 15, 2021, 07:01:36 PM »
unfortunately not working

Offline Mick.

  • Customizer
  • SMF Hero
  • *
  • Posts: 5,382
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: Just about appearing in header and homepage
« Reply #8 on: January 15, 2021, 08:39:45 PM »
Maybe

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

The code Liver posted had 3 parenthesis

Offline tarantula901

  • Jr. Member
  • **
  • Posts: 370
Re: Just about appearing in header and homepage
« Reply #9 on: January 16, 2021, 04:44:06 AM »
Maybe

Code: [Select]
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.

Offline Mick.

  • Customizer
  • SMF Hero
  • *
  • Posts: 5,382
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: Just about appearing in header and homepage
« Reply #10 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.

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 10,700
  • We were all equal in the end.
Re: Just about appearing in header and homepage
« Reply #11 on: January 16, 2021, 10:50:06 PM »
(You can never have ((too many)) parentheses.) :P
“The best laid schemes o' mice an' men / Gang aft a-gley.” - Robert Burns