sNews 1.7 (current stable version) > General questions

How can we change title() for special page

(1/1)

blankspace:
Maybe cryptic topic subject. In my theme I want to put search results on special page ("search"), so in $cat_listSEF I add "search" and in searchform() form action, after _SITE I put ".'search/';". Now I search for keyword and results come on special page "Search". Bravo! :-) But not so good: in title tag (<title>...</title>) not say "Search - Blankspace", only say " - Blankspace". :-(
aha- I see now also in breadcrumbs() same thing. "Search" not exist in breadcrumb line.
I understand must change function title() for this to make "search" go in title tag, and also change breadcrumbs() for same thing but I do not know how we do this. title() very difficult to understand where put change like this. Maybe I can fix breadcrumb myself, I will try.
Someone can help, please? Thank you.

Ciao,
/Pax (blankspace)

mosh:
Hello,
You can try this

In function title:
Add to global $categorySEF

After this line
$title = $arttitle.$name.$xname.$site_title;
Add new line
$title = $categorySEF=='search'?$categorySEF.' results':$title;

In function breadcrumbs:
Add this as the last line
echo( $categorySEF == 'search' ? $categorySEF.' results' : '' );

Hope this help

nukpana:
@blankspace - Please don't do what @mosh said.

If you added to the catList_SEF, then make a new language key in the language file EN.php like so:


--- Code: ---$l['search'] = 'Search';
--- End code ---

On line 242 on a fresh download, it looks like this:

--- Code: ---$title .= l($categorySEF).' - ';
--- End code ---

That means the title function is calling the language function with a parameter of the designated categorySEF.

mosh:

--- Quote from: nukpana on June 21, 2012, 01:11:51 PM ---@blankspace - Please don't do what @mosh said.

--- End quote ---

Yes please dont do what i said,
your server will explode if you do.

blankspace:
Thank you both for helping me. I try mr nukpana's advice, I no want to blow up my server, ha-ha!

Navigation

[0] Message Index

Go to full version