Forum Moderators: coopster
Here is the problem I've ran into...
On every page we added bread crumb ex:
Home > Section > Topic Name
Each section has like 600 pages in it... while we can do a template per section we still have to change the Topic Name on all the pages bread crumbs... The actual topic name is in the page title though ex:
Topic Name - Domainname.com
Is the page title for everypage...
So my question is... is there a way in php or a workaround where I can somehow take the topic name in the title and call/paste in the appropriate place in the bread crumb?
Any ideas would be great. thx.
Sauce
You can use a Regular Expression (Reg Exp) the match a pattern in the title.
<?
$data = file_get_contents($_SERVER['SCRIPT_FILENAME']);
if (ereg ("<title>[A-Za-z0-9[:space:]]*", $data, $regs)) {
$topic = str_replace("<title>","",$regs[0]);
} else {
$topic = "Name if script fails";
}
?>
Just a suggestion though.
Chris
$title="Your Title - domain.com";
echo $title;
$crumb=explode("-",$title); // this will break the title up at the - use " " if you want individual words.
echo $crumb[0];
Should give you an idea.
Justin