Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [rocco] GLinks 3: Extending Crumb Titles to Custom Templates

Quote Reply
Re: [rocco] GLinks 3: Extending Crumb Titles to Custom Templates In reply to
$main_title_loop isn't a magic variable, it is passed in from the code, but isn't for your custom code. You need to create it yourself. The first argument to format_title (in this case $main_title_loop) should be an array of hashrefs with keys Name and URL (since most people don't link the last item, you can get away with just specifying Name).

So to generate the necessary structure that format_title is expecting you'll have to write a global like:
Code:
sub {
return [
{ Name => Links::language('LINKS_TOP'), URL => "$CFG->{build_root_url}/$CFG->{build_index}" },
{ Name => shift, URL => shift }
];
}
Then in the templates, do:
Code:
<%set main_title_loop = gen_title("Contact Page")%>

PS: pugdog's solution also works.

Adrian

Last edited by:

brewt: Apr 16, 2005, 3:20 PM
Subject Author Views Date
Thread GLinks 3: Extending Crumb Titles to Custom Templates rocco 2775 Apr 16, 2005, 8:39 AM
Thread Re: [rocco] GLinks 3: Extending Crumb Titles to Custom Templates
brewt 2722 Apr 16, 2005, 2:51 PM
Post Re: [brewt] GLinks 3: Extending Crumb Titles to Custom Templates
rocco 2694 Apr 16, 2005, 3:52 PM
Thread Re: [rocco] GLinks 3: Extending Crumb Titles to Custom Templates
pugdog 2697 Apr 16, 2005, 3:02 PM
Post Re: [pugdog] GLinks 3: Extending Crumb Titles to Custom Templates
rocco 2705 Apr 16, 2005, 4:28 PM