Display the 2nd-level page Name

Permalink
As one of the titles on the site, I'd like to display the 2nd-level title.

This means anything in the level underneath the root-level (home).

Say this is the current site map:

Home
- About
-- Company Profile
- Products
- Contact

E.G I want to be able to display the 2nd level title within company profile ("About"). I could get the parent, however there will often be more than just the 3 levels.

Thanks

form
 
PhilipWitte replied on at Permalink Reply
PhilipWitte
I do this on the project I'm working on now. Not sure if I've found the most correct or fail safe system, but here's my approach:

$f = preg_split('/\//', $c->getCollectionPath());
echo $f[1]
form replied on at Permalink Reply
form
Works pretty well, except it outputs the page handle which includes the "-" hyphens where the spaces usually are.

Is there any way of filtering the hyphens out?

Thanks.