Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Category Name with spaces = BAD URL

Quote Reply
Category Name with spaces = BAD URL
Hi All!

I have some code that places X number of links from sub-categories onto the category page, all is going well except I added a link for users to click to go directly to the sub-category from within the link block, this is the code:
Code:
<A href="<%config.build_root_url%>/<%Full_Name%>/">See All <%Name%> links HERE!</A>


Displaying the category using <%Full_Name%> works beautifully, just not as part of a URL

Anyone have any ideas?

Thanks,

George
Quote Reply
Re: [macbethgr] Category Name with spaces = BAD URL In reply to
Hi,

You need to create a valid URL in the global:

Code:
$hit->{URL} = $CFG->{build_root_url} ."/" . $DB->table('Category')->as_url( $hit->{Full_Name} ) . "/";

Its a bit hard to give an exact bit of code, without seeing the code you are using.

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] Category Name with spaces = BAD URL In reply to
Got it... How would I call it up in the template?
Quote Reply
Re: [macbethgr] Category Name with spaces = BAD URL In reply to
Hi,

I wouldn't recommend calling it in another global. Just put it in the one you are using :)

For every global request, the data has to get sent to the template, then to the global, then back again. For every global. As such, the less global requests you need to do , the more efficient the install will be.

Here is an example of how to do the tweak, using the global I gave you yesterday:

Code:
while (my $link = $link_sth->fetchrow_hashref) {
Links::SiteHTML::tags('link',$link);
$cat->{URL} = $CFG->{build_root_url} ."/" . $DB->table('Category')->as_url( $cat->{Full_Name} ) . "/";
$output .= Links::SiteHTML::display('link', { %$cat, %$link });
}

Hope that helps.

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!