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

Globals-Print backward link

Quote Reply
Globals-Print backward link
Completing the form of adding of the link, I need to print right here
for the user the HTML code, for adding of the backward link to my
site from his one.
Used must be static pages and (Build Settings - foreign_char = Yes)

For example.
The user is adding the link into the "Computer" category.
The URL to the "Computer" category is http://site.com/1/333/
Category names /333/ - "Computer"

The general code of the link for adding into the templates add.html :
<a href="<%URL_ADDED_CATEGORY%>"><%NAME_ADDED_CATEGORY%></a>

As a result, must be printed:
<a href="http://site.com/1/333/">Computer</a>

Please, help me to write such a code:
sub { .... URL_ADDED_CATEGORY .... NAME_ADDED_CATEGORY }





Quote Reply
Re: [Vldm] Globals-Print backward link In reply to
Hi,

If your global name is 'LinkBack, it can be used as below
<%LinkBack($CatLinks.CategoryID)%>

--- global code ---
sub {
my $id = shift;

my $db = $DB->table('Category');
my $rs = $db->get($id) or return;
my $output ="";
my $url = $CFG->{build_root_url} . "/" . $db->as_url($rs->{Full_Name}) . "/" . $CFG->{build_index};
return qq|<a href="$url">$rs->{Name}</a>|;

}
--- global code ---

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Globals-Print backward link In reply to
Hi,
global - LinkBack print :
Error: Variable 'LinkBack' is not a code reference

Quote Reply
Re: [Vldm] Globals-Print backward link In reply to
Hi,

Sorry if my message is not clear.
You have to create a global-LinkBack and place the code into that box.

Cheers,



Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Globals-Print backward link In reply to
Sorry,I have made a mistake. Now nothing is printed
Quote Reply
Re: [Vldm] Globals-Print backward link In reply to
OK. You should send me your admin panel as private message to that I can take a look.

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Globals-Print backward link In reply to
Hopefully you did NOT edit the globals.txt directly.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [tandat] Globals-Print backward link In reply to
Thanks works, but works only in add_success.html, in modify.html and in add.html does not work - prints is empty?
What to make that worked in add.html?
Quote Reply
Re: [Vldm] Globals-Print backward link In reply to
Hi,

Happy new year!

You can place that global in those template and ensure that the categoryid is available, then the 'linkback' url will be printed out. Othewise, it is empty.

In the add_sucess.html template, it is 'CatLinks.Category' and in add.html and modify.html template, that is 'ID' but in add.html, that is not always available.

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Globals-Print backward link In reply to
It would be very necessary that <%LinkBack ($CatLinks. CategoryID) %> worked in add.html, and still it is necessary to send a code of the return reference on E-Mail the user added the reference.