Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Search with link in more than one cat

Quote Reply
Search with link in more than one cat
I have not thought that i have to care for the search one more time in my life. I remember it was always a big problem years ago. But my users have needs and i have to solve them. :)

For now we have a red car and a blue car. Both are in cat "cars" and one in cat "red", one in cat "blue".

1. If i search for them the search result seems to depend on which LinkID/CategoryID is found first in the table CatLinks. I have no idea how to solve this. Maybe i have to forbid some cats from the search. Maybe this will help in my example, but maybe not for the real situation.

2. If i group links with cats, this happens only in every page of my search results. With a lot of cars it is possible to have on page 1

red
...
...

blue
....

...

cars
...
...

but on page 2 again some of this cats.

Maybe i can get rid of with a limited search result, so i have only one page of results. (but ...)


For now i will read again the manual and think about the search. :)

Maybe i should have only links not grouped, but with an additional information about all(!) (or all not excluded) categories the reside in.
Quote Reply
Re: [Robert] Search with link in more than one cat In reply to
Hi,

Yeah, this was always a bit of a PITA for me too. Its due to the way the detailed_url is created. It will take the first category it finds, and use that in the detailed_url (assuming of course you are using category names in the URL)

There is also a similar issue with multiple categories in detailed breadcrumbs. i.e there is just 1 detailed page, but it could be linked from several categories.

All that said, I'm not sure there is a lot you can do about your situation Unsure

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] Search with link in more than one cat In reply to
I was buisy for so many hours, weeks and month with LSQL in the last ten years (first use was maybe 2003) that i remember all about it. My usual problem was and is that i dont speak perl at all and doing a lot of things in php to solve my needs.

Maybe i have programed a search.php also some years ago, i should watch my archives for that. :)

For now we have two problems to solve:

1. A detailpage is build only one time, but with a cat that we cant really choose.
2. Search and group has the same problem
3. Search groups for every page and not at all.

Any ideas how to solve it?
Quote Reply
Re: [Robert] Search with link in more than one cat In reply to
In short for detailed:

1. instead of detailed.html i could use an detailed.php that i will make for myself.
2. i can use the detailed from lsql, but as php. Instead of using the normal variables, i recalculate the breadcrump from the link it is called. (Home > Red Cars > BMW 1212 or Home > BMW > BMW 1212)
3. I choose one master-cat (if possible from the systematik) and let lsql choose that lid/cid from catlinks that i like. (only possible with link in one master cats and more secondary cats), maybe like
choose from catlinks where ID = x and Cat in (a,b,c) with the knowledge that a link is always only in one a,b,c.

Any other idea?

For the search i will find more ideas later, have to leave my office now. :(
Quote Reply
Re: [Robert] Search with link in more than one cat In reply to
Hi,

I guess you could - but I'm not sure about the PHP side. One possible way, is to actually "duplicate" links, when they are in more than one category. Thats not too hard if they don't have images etc, but if you have FILE images then it gets more complex (as you need to duplicate them all). Also, you would need a way to "link" them together... so when they get edited, it would also do the other one(s) as well.

Its a shame GT never came out with a solution for this, as it would be a nice fix.

Sorry I can't be much more help!

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] Search with link in more than one cat In reply to
You are joking. :)
Than i would prefer another field in CatLinks for sorting.

I am not shure how i would manage it, but probably the solution with premium-cats should do the trick for me this time.

Say i have soccer-clubs and players. The clubs are in cats for the city and the league, the players are in a couple of cats. But only the clubs have a detailed page (the players are included in the club´s detailed page)

So i have to choose the cities and not the league for my clubs as cat for the detailed link. Because of having around 15 RootCats it should be possible to filter the CatLinks. In php i would do this in a minute, in perl i will start now trying it. :)

But on the other side i just have the idea to calculate the breadcrump using the referer. Maybe this is the better solution. (I use .php instead of .html, so i am able to have static pages with partially dynamic content in the same time.
Quote Reply
Re: [Robert] Search with link in more than one cat In reply to
Ok, well if you're happy with PHP, then I guess thats your only real option. Still a shame its not something that GLinks can handle (from a programmatic point of view, I can see why - especially seeing as detailed pages used to just be /Detailed/1234.html... i.e no category names in)... but then, you still had the issue with the breadcrumbs being wrong.

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: [Robert] Search with link in more than one cat In reply to
Sorry to ask, but I am not 100% certain what you want to achieve. Could you please explain it again.
Quote Reply
Re: [Robert] Search with link in more than one cat In reply to
Hi Robert,

maybe it would be an option to make a search plugin. I am not sure if that is the right track, but in /Links/User/Search.pm there is:

Code:
# And format the link results.
my (@link_results_loop, $link_results, %link_output);
if ($link_count) {
my $results = $link_sth->fetchall_hashref;
$links->add_reviews($results);
@link_results_loop = map Links::SiteHTML::tags('link', $_) => @$results unless $CFG->{build_search_gb};
if ($CFG->{build_search_gb}) {
my @ids = map { $_->{ID} } @$results;
my $catlink = $DB->table('CatLinks','Category');
my %names = $catlink->select('LinkID', 'Full_Name', { LinkID => \@ids })->fetchall_list;
foreach my $link (@$results) {
push @{$link_output{$names{$link->{ID}}}}, Links::SiteHTML::tags('link', $link);
}
}
}

Maybe there is a way to push a link to the array for every CatLink. I will take a closer look at that if this is the right approach.