Gossamer Forum
Home : Products : Links 2.0 : Customization :

nonenglish - linked title shows Top:3 - should be Top:Red Shoes

Quote Reply
nonenglish - linked title shows Top:3 - should be Top:Red Shoes
Hi All

Working with the nonenglish mod.

My site is in English. I'm using the nonenglish mod so that I can create pages that look like this (lowercase categories):

...../fred/index.html
...../wilma/index.html
...../red_shoes/index.html

But, the field values in nonenglish would be what I want the visitors to see:

Fred
Wilma
Red Shoes

The sub build_linked_title_mb is displaying the ID of the category or subcategory:

Top:1
Top:2
Top:3

However, I want it to display the nonenglish value:

Top:Fred
Top:Wilma
Top:Red Shoes

How can I change the the build_linked_title_mb to display the nonenglish value rather than the cat ID number? I've tried a lot of things and searched a bunch of threads, but haven't found anything.

Code:
sub build_linked_title_mb {
# --------------------------------------------------------
# Returns a string of the current category broken up
# by section, with each part linked to the respective section.

my ($input) = $_[0];
my ($description) = $_[1];
my (@dirs, $dir, $output, $path, $last, @descs, $desc);

@dirs = split (/\//, $input);
@descs = split (/\\/, $description);
$last = pop (@dirs);
$last = pop (@descs);

$output = qq| <A HREF="$build_root_url/">Top</A> :|;
foreach $dir (@dirs) {
$path .= "/$dir";
$desc = shift (@descs);
$output .= qq| <A HREF="$build_root_url$path/">$desc</A> :|;
}
$output .= " $last";

return $output;
}

Many thanks Smile
Quote Reply
Re: [DogTags] nonenglish - linked title shows Top:3 - should be Top:Red Shoes In reply to
Did you just add this mod to an existing site, or are you setting up a new one? Sounds like a problem in adding the mod, mainly links.def. As downloaded, the mod goes in position [8] (as I recall...), if you have it in a different position, you will need to change some numbers in site_html_templates.pl, and maybe in nph_build.cgi. I have used this mod in several installs of Links, but never had it show the ID number in the breadcrumb...

It does have an issue with the breadcrumb trail not appearing correctly, and the page title, too. I agree it's good to use to keep files names lowercase.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] nonenglish - linked title shows Top:3 - should be Top:Red Shoes In reply to
In Reply To:
Sounds like a problem in adding the mod, mainly links.def

Do you mean category.def?

If there is something that has to be done with links.def, too, I friggin missed it Frown

Nonenglish would be the fourteenth field [13] in category.def. I tried changing any field references to [13] but then the breadcrumb trail went blank for any cat and subcat.

Top: (blank)

I'm trying to get the hack to look at a different field, but it doesn't seem to be responding. Crazy

Any other possible thoughts?

Many thanks, Leonard Smile
Quote Reply
Re: [DogTags] nonenglish - linked title shows Top:3 - should be Top:Red Shoes In reply to
Sorry, yes I did mean cat.def.Blush

I think I tried to add it as a different field number once, and it didn't work. Have you tried putting it in as number 8? Of course, you know about adding the nw field into your existing database, right? Otherwise, it will throw everything off.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] nonenglish - linked title shows Top:3 - should be Top:Red Shoes In reply to
Thanks, Leonard.

Yeah, I've added many fields before. I'll keep plugging away.

I gotta fix another thing, too, which I'll post in another thread.

Cheers! Smile