Forum Moderators: coopster

Message Too Old, No Replies

cms page title problem

echoing variable in page title after using strip_tags

         

stevenjm

10:59 am on May 20, 2005 (gmt 0)

10+ Year Member



hey,
fairly new to php and learning as I go. Am working with an open source cms and doing mods to make it more se friendly. (titles and url's)
having trouble with page titles - have dug around code looking for correct variable with no luck (has heaps of includes).
for the time being until I have more time to dig around I found a function that when placed in the title tag gives the text I am after but its wrapped in html tags.(the function is for a breadcrumb trail)

function I found with correct text for title is named:
pathos_theme_showModule("navigationmodule","Breadcrumb")

I thought if I assigned it to a variable and then did strip_tags of variable string and echoed the results I would get the desired results but no such luck.
placing the function title() within the <title> tags still gives me the text wrapped in html tags for some reason
ie. - the title is shown in the browser as <a>accommodation</a > - <b>suburb</b> or something similar just the same as before I did the strip_tags.

function, obviously incorrect, is as follows:
function title()
{
$test = pathos_theme_showModule("navigationmodule","Breadcrumb");
echo strip_tags($test);

}

any help much appreciated. I seem to be doing something wrong in assigning the functions resulting string to a variable.

ergophobe

8:19 pm on May 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Usually your best bet is to go to the forum for the CMS in question. That stuff's just too specific.

As for your last question

function addBlahBlah($val)
{
return "Blah Blah " . val;
}

$string = "something";
$blahblah_string = addBlahBlah($string);

stevenjm

7:44 am on May 22, 2005 (gmt 0)

10+ Year Member



thanks. the cms in question is exponent and I cannot find relevant support to the title problem anywhere.
btw - its a great little cms!

If I have a function that outputs a breadcrum trail including its html tags should I not be able to just assign that functions string output to a variable
ie

$var = breadcrumb_function();

//and then use

$title = strip_tags($var);

//to strip the html tags from the string

echo $title;

?

ergophobe

3:50 pm on May 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yeah, that should strip the tags. I have no idea why it's not working for you, but I suspect that the CMS is inserting tags later in the process.