Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

getting %title_linked% to work on add_success template

Quote Reply
getting %title_linked% to work on add_success template
anyone know how i can get the %title_linked% to appear on the add_success page? i just get "Unkown Tag: title_linked" when i try it.
Quote Reply
Re: getting %title_linked% to work on add_success template In reply to
You need to add:

title_linked => &build_linked_title,

to the parameters passed in HTML_Templates.pm

But, I think the problem is a bit deeper. The cgi-generated forms do not know what level you are in, and you'll always return "Top"

If you want to make the add/modify forms context sensitive, I think a bit of code has to be added to let the program know where you want it to think it is.

Quote Reply
Re: getting %title_linked% to work on add_success template In reply to
Yup, build_linked_title will take a string, break it up on the "/" character. It then starts with Top, then links up everything except the last category.

Actually, you only want to pass in "Add" then, not "Top/Add".

Sorry,

Alex
Quote Reply
Re: getting %title_linked% to work on add_success template In reply to
You can put:

title_linked => &build_linked_title ("Top/Add")

to get the Top - Add displayed.

Cheers,

Alex
Quote Reply
Re: getting %title_linked% to work on add_success template In reply to
So you can pass a parameter to it? Cool.
Quote Reply
Re: getting %title_linked% to work on add_success template In reply to
I can't seem to get that to work. exactly where do you put that line?
Quote Reply
Re: getting %title_linked% to work on add_success template In reply to
The line goes into the %globals array at the top of the HTML_Templates.pm file in the LINKS directory.

This is where the templates are generated from, and it's analogous to the site_html_templates.pl file from links 2.0

If you were using a set of templates with a templates.cfg file, you need to import that file into the html_templates.pm file, and declare all the variables with 'my ()' to make it mod_perl/strict compatible.

Make sure each pair in the %globals hash ends with a ',' _except_ the last one before the '}' and that that has a ';' after it.

Quote Reply
Re: getting %title_linked% to work on add_success template In reply to
Or you could just write it into the Add Success Page:

<a href="<%build_root_url%>">Top</a> - <a href="<%db_cgi_url%>/add.cgi">Add</a> - Success

(or something similiar).

Cheers,

Alex