Gossamer Forum
Home : Products : Links 2.0 : Customization :

creating linked "category name"

Quote Reply
creating linked "category name"
In rate_success.html, I'd like to add something like this:

===
Go back to Home : Category : Sub Category
===

so that when when "Home : Category : Sub Category" is clicked, the visitor goes back to the page where he/she starts the rating process. How to get the URL of "Home : Category : Sub Category"?

Thanks.


Quote Reply
Re: creating linked "category name" In reply to
You will have to do the following:

1) Add the following codes to the top of your sub site_html_rate_success routine:

Code:

my $printcat = shift;
my $clean_category = &build_clean($rec{'Category'});
$printcat = qq~$clean_category~;


AFTER the following codes:

Code:

my (%rec) = @_;


(Seventh time I have posted these codes in the past two months in this forum...Wink).

"Thinking out of the box (codes) is fun and effective."

2) Then define the tag in the tag definition area of this sub:

Code:

printcat => $printcat


3) Then in your rate_success.html routine, add the following codes:

Code:

<a href="<%build_root_url%>/<Ętegory%>">
<%printcat%></a>


Regards,

Eliot Lee
Quote Reply
Re: creating linked "category name" In reply to
Hi, <%printcat%> doesn't print the category. I've the following in my site_html_templates.pl:

===
sub site_html_rate_success {
# --------------------------------------------------------
# This routine determines how the rate success page will look like.

my (%rec) = @_;
my $printcat = shift;
my $clean_category = &build_clean($rec{'Category'});
$printcat = qq~$clean_category~;

&html_print_headers;
print &load_template ('rate_success.html', {
%rec,
%in,
%globals,
title => $title,
Title => $title,
printcat => $printcat
});
}
===

I added <%printcat%> to rate_success.html just to check if the category is printed out and I got blank. Any idea what I'm missing? Thanks.


Quote Reply
Re: creating linked "category name" In reply to
Okay...I think I have solved the problem...for some reason, only the ID field is being passed in the sub rate_it routine.

So, here is what you have to do....

1) Replace the codes I gave you for the sub site_html_rate_success routine with the following codes:

Code:

my $printcat = shift;
my $clean_category = &build_clean($in{'Category'});
$printcat = qq~$clean_category~;


Put these codes in both the sub site_html_rate_success and sub site_html_rate_failure routines.

2) Then add the following tag definitions in the sub site_html_rate_success and sub site_html_rate_failure routines:

Code:

printcat => $printcat,
Category => $in{'Category'},


3) Then in your rate.html and rate_error.html files, add the following hidden field:

Code:

<input type="hidden" name="Category" value="<Ętegory%>">


4) Then in your rate_success.html file, add the following codes:

Code:

<a href="<%build_root_url%>/<Ętegory%>/">
<%printcat%></a>


I have this working in my site now...along with a javascript back link that takes people to the exact page where they found the link since I have the rating option available in the search results, award pages, etc.

Regards,

Eliot Lee
Quote Reply
Re: creating linked "category name" In reply to
<% Category%> and <%printcat%> still print blank. Furthermore, <%URL%> and <%title%> are no longer recognized in rate_success.html after I added your modifications.

Quote Reply
Re: creating linked "category name" In reply to
Welp...Don't know what to tell you because guess what...IT WORKS for me! Check the codes AGAIN!

Best of luck finding a solution!

Regards,

Eliot Lee