PDA

View Full Version : Printing page name and directory automatically



ketanco
20 Jul 2008, 10:58 PM
Hi,
I am trying to automatically show the name of the page and its directory. For example,

If there is a home page it would show

Home

For a page directly linked from the home page it would show:

Home>Subpage1

For a page linked from Subpage 1,

Home>Subpage1>Subpage1-1

I would like this to print automatically depending on the name of the page. Is there a way to automatically do this? Does it matter if the subpages are in separate folders-if so how does it change (Lets say subpage 1 and all pages under it are in a folder called subpage1)? And is the file name or page title used in the code?

mick.dodd
24 Jul 2008, 03:23 AM
there are php commands to get the directory you are curently in and to get the file name (it might be the same command i cant remember) but it will give you

http://www.mysite.com/index.html

so you will need to do some string minipulation to split it by / symbol then for each folder say its called gallery you could tkae the 3rd element in the array and get gallery then add the > symbol then the page name. Its a lot of work and would be eaiser to hard code it but i supose it depends how many pages it has