Gossamer Forum
Home : Products : Gossamer Links : PHP Front End :

Getting current page name like <?echo $title>

Quote Reply
Getting current page name like <?echo $title>
Afternoon,

Is there a way of getting just the current page title instead of the whole route, like instead of:
Home : Something : Something Else

Instead just the 3rd level, 'Something Else' ?

Had a look around forum, couldnt find anything.

Cheers.
Quote Reply
Re: [ryanvtwod] Getting current page name like <?echo $title> In reply to
You tried checking which variables are available?

Code:
foreach ($GLOBALS as $var => $val) {
echo "$var => $val <BR>";
}

That should show you all the varaibles available in the $GLOBALS's array. You should be able to reference something like;

$GLOBALS['title']

...with...

$title

Hope that helps Smile

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Getting current page name like <?echo $title> In reply to
<?echo $title?>
gives the full title of the page, need just the name/title of the current page without the trailing pages.

Because $title gives the full : Home : Some Catagory : some other catagory : the detailed catagory

just need the last, the name of the catagory that it currently in and not the other bits

If that makes any sense.

Cheers
Quote Reply
Re: [ryanvtwod] Getting current page name like <?echo $title> In reply to
Yeah, I'm saying to use the code I povided to see which template provides the value you need. There should be something in there that holds the category name...

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Getting current page name like <?echo $title> In reply to
been trying this, but perhaps i'm doing it wrong, i put the code in (on one of the template files), and had a look on the front end to see whats available, it echo'd server info stuff mostly, and setup info stuff. Didnt echo any available values through. Any ideas?

Also got another question heh.

I need to be able to list catagorys by level as a whole (as well as the normal way), at the moment i have it setup as:

Level 1 - Region no1>
Level 2 - Counties in this region >
Level 3 - Towns in this county >
Level 4 - Details in this county -

Level 1 - Region no2>
Level 2 - Counties in this region >
Level 3 - Towns in this county >
Level 4 - Details in this county -

The counties are under the specific region, i.e southwest has devon / cornwall and such under it, whilst scotland has some scotish place that i cant remember of the top of my head heh.

Is there a way of echoing a list of everything by level with the link? but only that level? suppose i could do by level id in the database, but would prefer something thats already been passed through (like <? echo $level1 ?> or some such.

Cheers.
Quote Reply
Re: [ryanvtwod] Getting current page name like <?echo $title> In reply to
Mmm... in category.html, did you actually read the top comments?

Quote:
<?/*
File : category.html
Description : This file displays a single category page.
Tags : On this page, you have all the properties of the category
you are viewing, plus:

links => A list of all links in this category.
links_loop => A loop of all the links in this category.
category => A list of all the subcategories.
category_loop => A loop of all the subcategories.
related => A list of all the related categories (only when build_category_yahoo is
set to No)
related_loop => A loop of the related categories.
header => A custom header for this category.
footer => A custom footer for this category.
random => Random numbers useful for banners ads. Also random1, random2, random3
are available.
title_linked => The full category name with each section linked.
title => The full category name with each section not linked.
category_name_escaped =>
A URL escaped version of the category, useful for
putting into links.

category_short => Just the last part of the category.
total => Total number of links in this category only (use Number_of_Links
for this category and all subcategory).
*/?>

Note the bit in red Wink

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Getting current page name like <?echo $title> In reply to
ah doh, read that like 20 times, and saw catagories_short 50 odd times, this is what i get for having off milk in the fridge :( been a long day heh.

Cheers once again Andy :)

Any ideas on the second part?
Quote Reply
Re: [ryanvtwod] Getting current page name like <?echo $title> In reply to
LOL... no problem.

>>>Any ideas on the second part? <<<

Afraid not.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Getting current page name like <?echo $title> In reply to
been going through the database a bit, and from what i can gather in retrieving a list of catagorys with links by level is to make a extra column with another ID, the problem that i can see so far is that the ID's are related only to the part thats behind it and nothing else at the moment.

the father ID only links it self up to that specific row of catagorys and to what that row is currently in.

I can't do a request and list by ID 1 - max 100 odd for countys because the towns are in the way (mixed in with there own ID tag)

There any other ways any of you guys have used? This wont be listed in the catagorys them self's, I have 3 links uptop for : Region Selection (which is the home, page.php?do=page ) / County Selection which has no link atm cause i'm trying to work it out how to list all counties. and then the last which is the Town Selection which lists all towns. So there effectively there own pages.

Any ideas etc appreciated :)
Cheers.
Quote Reply
Re: [ryanvtwod] Getting current page name like <?echo $title> In reply to
My @related category modification from last year might help solve your problem (I don't fully understand the question, though):

http://www.gossamer-threads.com/...?post=210464;#210464

Dan