Gossamer Forum
Home : Products : Links 2.0 : Customization :

No spaces in the file name.

Quote Reply
No spaces in the file name.
Hello ,

I`m no longer using <%ID%>.html when generating Detailed pages.... i now use <%Title%>.html ...so my links look like this : /Detailed/Digital%20Hazard.html .


Does anyone know who can i make the script automaticaly add "-" or "_" where the empty space should be ? I`d Like the links to look like this /Detailed/Digital-Hazard.html

Thank you very very much !
Quote Reply
Re: [smarty] No spaces in the file name. In reply to
I'm not sure where you are doing this but:

Code:
sub site_html_detailed {
# --------------------------------------------------------
# This routine will build a single page per link. It's only
# really useful if you have a long review for each link --
# or more information then can be displayed in a summary.
#
my %rec = @_;
my $clean_title = $rec{'Title'};

$clean_title =~ s, ,-,g;

return &load_template ('detailed.html', {
total => $total,
grand_total => $grand_total,
title_linked => $title_linked,
clean_title => $clean_title,
title_unlinked => $title_unlinked,
hitsday => $hitsday,
%rec,
%globals
} );
}


then use <%clean_title%> in the html page

I didn't try it out...


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] No spaces in the file name. In reply to
HI,

This didn`t worked..

Don`t i have to add clean_title => $clean_title, other 'sub build....' ?



Thank you !
Quote Reply
Re: [smarty] No spaces in the file name. In reply to
I did a small test and it does work. You just need to find the right place for it.

try it in sub site_html_link {


detailed_url => "$build_detail_url/$clean_title$build_extension",


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [smarty] No spaces in the file name. In reply to
this is a potentialy problematic modification. you have to guarantee you won't have any links with identical titles, otherwise you'll be overwriting your details pages and they won't match up.

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy logic] No spaces in the file name. In reply to
Hi ,

I`ve added that code to 'sub ......link' ....and after a 'Build All' it shows the link to the detailed page correctly (with "-"), but it doesn`t build the detailed files with "-" ...

P.S. i don`t have duplicate title names...so no need to worry about overwriteing.