TinyPortal

Development => Support => Topic started by: steveeyes on February 05, 2007, 07:39:08 PM

Title: Omit a bloc from search template.
Post by: steveeyes on February 05, 2007, 07:39:08 PM
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.
Title: Re: Omit a bloc from search template.
Post by: IchBin on February 05, 2007, 10:58:30 PM
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.
Title: Re: Omit a bloc from search template.
Post by: steveeyes on February 06, 2007, 12:19:36 AM
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.

Title: Re: Omit a bloc from search template.
Post by: IchBin on February 06, 2007, 12:53:56 AM
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>';
        }
Title: Re: Omit a bloc from search template.
Post by: IchBin on February 06, 2007, 12:54:31 AM
Probably a big hack, but I declare that I am by no means a php guru. YET! :D
Title: Re: Omit a bloc from search template.
Post by: steveeyes on February 06, 2007, 01:05:49 AM
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
Title: Re: Omit a bloc from search template.
Post by: IchBin on February 06, 2007, 01:15:10 AM
Well I hope it works for you. Good luck, and have fun! :)
Title: Re: Omit a bloc from search template.
Post by: IchBin on February 06, 2007, 09:38:02 PM
--wrong topic---