Topic: Is it Possible to use a seperate main.tpl template for search.php?

Is it Possible to use a seperate main.tpl template for search.php?

2 (edited by kierownik 2009-02-08 08:55)

Re: Is it Possible to use a seperate main.tpl template for search.php?

You can make your own extension if you want.
Just make one with the next thing in it

<hook id="hd_pre_template_loaded">
    <![CDATA[
        if (FORUM_PAGE == 'search')
        {
            if (file_exists($ext_info['path'].'/search.tpl'))
                $tpl_path = $ext_info['path'].'/search.tpl';
            else
                $tpl_path = FORUM_ROOT.'include/template/main.tpl';
        }
    ]]>
</hook>

And then put your own search.tpl in that same directory

Download here.

3 (edited by omikron 2009-02-09 03:46)

Re: Is it Possible to use a seperate main.tpl template for search.php?

Thanks for your help!

Any idea why when I submit a search it is still pulling includes that the main.tpl uses?

edit;

The "search.php?action=" pages seem to still be using main.tpl - any idea why?

Re: Is it Possible to use a seperate main.tpl template for search.php?

Replace

if (FORUM_PAGE == 'search')

with this code

if (FORUM_PAGE == 'search' || FORUM_PAGE == 'searchposts' || FORUM_PAGE == 'searchtopics')

Re: Is it Possible to use a seperate main.tpl template for search.php?

I will change it in my extension, thanks Slavok, did not think about the rest of the FORUM_PAGE's

Re: Is it Possible to use a seperate main.tpl template for search.php?

This didn't seem to change anything as the search results page as well as the "Active topics" and "Unanswered topics" are still using main.tpl. Only the initial state of the search page seems to use search.tpl...

Is there something I am missing?

Re: Is it Possible to use a seperate main.tpl template for search.php?

Did you download the new version and updated the extension after that?

It seems to work here.