Hi there,
I want to be able to show the name of the current page in a separate div from the menu (like a header), and not above the article. How can I display this name in a seperate div from within the template?
I hope it's clear what I mean... You can also take a look at http://www.pjdenhaan.com to see what I mean.
Show the name of the current page
-
- Posts: 29
- Joined: Fri 10. Dec 2004, 13:08
- Location: Rotterdam, The Netherlands
- Contact:
-
- Posts: 29
- Joined: Fri 10. Dec 2004, 13:08
- Location: Rotterdam, The Netherlands
- Contact:
I'm afraid I don't really understand what you're suggesting. How can this provide me with an automaticly generated title?
Isn't there a piece of PHP code which I could put in the template that checks on which page the user is and gets the name of that page from the database? I'm really bad at PHP, so that's why I was hoping that someone here could help me out.
Isn't there a piece of PHP code which I could put in the template that checks on which page the user is and gets the name of that page from the database? I'm really bad at PHP, so that's why I was hoping that someone here could help me out.
Ok - maybe I hit now what you want
think you need a little Code like a 'small Breadcrumb'
this is the Code for the original Breadcrumb-Function - so you can reduce it for your need.
think you need a little Code like a 'small Breadcrumb'
this is the Code for the original Breadcrumb-Function - so you can reduce it for your need.
Code: Select all
function breadcrumb ($start_id, $struct_array, $end_id, $link_to="index.php", $spacer=" > ") {
//builds the breadcrumb menu based on given values
//$link_to = the page on which the breadcrum part links
//$root_name = name of the breadcrumb part if empty/false/0 $start_id
//$spacer = how should breadcrumb parts be divided
$start_id = intval($start_id);
$end_id = intval($end_id);
$act_id = $start_id; //store actual ID for later comparing
while ($start_id) { //get the breadcrumb path starting with given start_id
$data[$start_id] = $struct_array[$start_id]["acat_name"];
$start_id = $struct_array[$start_id]["acat_struct"];
if($end_id && $start_id == $end_id) break;
}
$data[$start_id] = $struct_array[$start_id]["acat_name"];
$crumbs_part = array_reverse($data, 1);
if(sizeof($crumbs_part)) {
$breadcrumb = "";
foreach($crumbs_part as $key => $value) {
$alias = '';
if ($act_id != $key) {
if($breadcrumb) $breadcrumb .= $spacer;
if(!$struct_array[$key]["acat_redirect"]) {
$breadcrumb .= '<a href="index.php?';
$alias = $struct_array[$key]["acat_alias"];
$breadcrumb .= ($alias) ? html_specialchars($alias) : 'id='.$key.',0,0,1,0,0';
$breadcrumb .= '">';
} else {
$redirect = get_redirect_link($struct_array[$key]["acat_redirect"], ' ', '');
$breadcrumb .= '<a href="'.$redirect['link'].'"'.$redirect['target'].'>';
}
$breadcrumb .= html_specialchars($crumbs_part[$key]).'</a>';
} else {
if($breadcrumb) $breadcrumb .= $spacer;
$breadcrumb .= html_specialchars($crumbs_part[$key]);
}
}
} else {
$breadcrumb = "";
}
return $breadcrumb;
}
ouhm I guess that you'd just have to layout your css right.. take the latest phpwcms release DEV 1.2.3 and position your content title where you have it atm. I guess this is what you need. Apart from that the
{PAGETITLE} RepTag at --...-- could help you out?
{PAGETITLE} RepTag at --...-- could help you out?