Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Category paths

Quote Reply
Category paths
Hi Andy, everyone.

I know we've an option on the Build config where we can setup the build_root_url, but I'm wondering if its possible to:

Build my main index file on my root directory and all my categories and subcategories inside a folder.

Is this possible? If yes, will you mind to share with me instructions or setup on how to do this?

Thanks in advance!

Jesus
Quote Reply
Re: [Jesus] Category paths In reply to
Hi,

I have done this before, but its not that simple to setup :)

1) Setup your paths in the folder (including the homepage)
2) Setup a rewrite rule in your root .htaccess file:

Code:
RewriteRule ^/? /your_sub_folder/index.html [L]

That should then load the page in /your_sub_folder/index.html from the root of your site

Thats the easy part ... the hardest part is to get the URLs in the breadcrumb working right. The easiest would probably be a little global to tweak the breadcrumb. Something like:

tweak_title_loop
Code:
sub {
my @title_loop = ${$_[0]};
$title_loop[0]->{URL} =~ s|\Qyour_sub_folder/||g;
return { title_loop => \@title_loop; }
}

Then call it in your templates with:

Code:
<%tweak_title_loop($title_loop)%>

Totally untested, but will hopefully work Angelic

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 paths In reply to
Thank you Andy. I'll give this a try.

I'm also implementing the Mobile template as well, but I think this will not affect that, correct?
Quote Reply
Re: [Jesus] Category paths In reply to
Hi,

For the mobile - how are you doing it? If you are using another template set then you will also need to apply this "tweak" into those templates as well

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 paths In reply to
Yes, for the mobile I'm using your plugin, so I'll make the adjustment as well on that set.

Jesus
Quote Reply
Re: [Andy] Category paths In reply to
Hi Andy,

Here's my breadcrumb code:

Code:
<div id="breadcrumbs">
<div class="container">
<div class="row">

<div class="breadcrumbs eight columns">
<%Links::Utils::format_title($title_loop, separator => $crumb_separator, no_escape_separator => $no_escape_crumb_separator, include_home => 1, link_type => 2)%>
</div>

<div class="date-block eight columns">
<span id="current-date" class="date"></span><!-- date holder -->
</div>

</div>
</div>
</div><!-- end Breadcrumbs -->
Should I replace this:
Code:
<%Links::Utils::format_title($title_loop, separator => $crumb_separator, no_escape_separator => $no_escape_crumb_separator, include_home => 1, link_type => 2)%>
With this code:
Code:
<%tweak_title_loop($title_loop)%>
Thanks for the clarification,

Jesus
Quote Reply
Re: [Jesus] Category paths In reply to
No, you should call it before breadcrumb code.

Like that:

Code:
<!-- tweak title -->
<%tweak_title_loop($title_loop)%>
<%Links::Utils::format_title($title_loop, separator => $crumb_separator, no_escape_separator => $no_escape_crumb_separator, include_home => 1, link_type => 2)%>

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Category paths In reply to
Thank you Boris!
Quote Reply
Re: [Jesus] Category paths In reply to
Hi Andy & Boris,

I think I'm missing something, can you please take a look here: link

Unable to compile 'tweak_title_loop': syntax error at (eval 52) line 4, at EOF syntax error at (eval 52) line 5, near "} }" Inicio > Ciencia y tecnologia


Thanks in advance for your help!
Quote Reply
Re: [Jesus] Category paths In reply to
Mmm, try:

Code:
sub {
my @title_loop = ${$_[0]};
$title_loop[0]->{URL} =~ s|\Qyour_sub_folder/||g;
return { title_loop => \@title_loop }
}

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 paths In reply to
No luck, now I'm getting this error when trying to build pages.

A fatal error has occured:
Can't use an undefined value as a SCALAR reference at (eval 51) line 2.

Please enable debugging in setup for more details.


Here's the code:



Code:
sub { my @title_loop = ${$_[0]}; $title_loop[0]->{URL} =~ s|\Qdirectorio-de-monterrey/||g; return { title_loop => \@title_loop } }


Quote Reply
Re: [Jesus] Category paths In reply to
Shoot over GLinks admin logins, and I'll have a quick look for ya.

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 paths In reply to
I'm sending an email to you at andy@ultranerds.co.uk

Thanks
Quote Reply
Re: [Jesus] Category paths In reply to
Ok, needed a tweak:

Code:
sub {
my $title_loop = $_[0];
${$title_loop}[0]->{URL} =~ s|\Qdirectorio-de-monterrey/||g;
return { title_loop => $title_loop }
}

Tested, and thats working now :)

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!