TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,991
  • Total Topics: 21,323
  • Online today: 545
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 277
  • Total: 278
  • @rjen

Omit a bloc from search template.

Started by steveeyes, February 05, 2007, 07:39:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

steveeyes

Hopefully I'm posting at the right place.

I'm using tp9.7 with smf 1.1.1. I have everything setup the way I want except for one layout problem.

The center block I created for adsense causes a problem with the search page layout. All other pages are fine.

I keep reading on the forum about how to have blocks display on certain pages, but the more I read and play with this feature the more I don't understand.

Basically, I want to omit the center block from the search page template. That's it, no other pages, just that page.

Is there a way of doing this? I thought maybe I could find the code in the search template that calls the center bloc and delete the code, but no luck finding it.

Any help would be appreciated.

IchBin

You can't limit it with the tinyportal settings as it is now. You can only tell it "where" to display. You can't tell it "where not" to display. I personally just turn off all sidebars when in the search template.

steveeyes

Thanks for the reply. I do the same, turn them off, but my customers have to be hand held. This is the only page layout that gets messed up when I use a center block for my adsense code.

I kinda figured there was no admin setting after much study but thought I would give it a shot by asking. There is no way I can go into the code and stop  the search template from using the center block?

Thanks again.


IchBin

Well, I'm not sure that you can tell the Search.template to disable the center bar because the index.template is already loading the centerbar before it loads the search template in the main_template_below function. So I just tried this and it worked in the index.template.

In the index.template.php file find the center bar declaration. Its looks like this.

        if($context['TPortal']['centerbar'])
                     echo '<div>' , TPortal_sidebar('center') , '</div>';


Change it to this:
        if($context['current_action'] == 'search')
        {
                $context['TPortal']['centerbar'] == 0;
        }
        else
        {
                if($context['TPortal']['centerbar'])
                      echo '<div>' , TPortal_sidebar('center') , '</div>';
        }

IchBin

Probably a big hack, but I declare that I am by no means a php guru. YET! :D

steveeyes

I appreciate your effort........I know it is small thing with the layout messing up for the search page, but it just bugs me. Again, thanks. With your help I have something to play around with.

steve

IchBin

Well I hope it works for you. Good luck, and have fun! :)

IchBin


This website is proudly hosted on Crocweb Cloud Website Hosting.