Gossamer Forum
Home : Products : Gossamer Links : Discussions :

What's Related on detailed pages?

Quote Reply
What's Related on detailed pages?
Hello,

I am trying to find a way to have individual articles (links) be related to one another somehow. (Instead of categories being related). What I'd like to have happen at the end of an artcile is to list other articles (links) that a reader might be interested in if they liked this particular article (link).

I believe the way it works now is that the system will show related categories. Do I understand this correctly?

How can I make the system offer related articles (links)?
Quote Reply
Re: [Evoir] What's Related on detailed pages? In reply to
Would the relationship be one-to-one? Meaning that articles could only be related to one other article? If so, then add a column in the Links table called RelatedLinkID and this would be a drop-down of other links with their associated LinkID.

If articles can be associated with MANY other articles Like with related categories, then you'd need to create another table called Links_RelatedLinks with the following attributes:

LinkID (INDEX, NOT UNIQUE)
RelatedLinkID (INDEX, NOT UNIQUE)
========================================
Buh Bye!

Cheers,
Me
Post deleted by Paul In reply to

Last edited by:

Paul: Apr 5, 2002, 11:30 AM
Quote Reply
Re: [Heckler] What's Related on detailed pages? In reply to
What's that, Paul? Tongue
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Heckler] What's Related on detailed pages? In reply to
I was about to say RelatedLinkID could be unique but then I realised it needs to be "not unique" otherwise you could only use a related link id once which would be no good.

Last edited by:

Paul: Apr 5, 2002, 11:35 AM
Quote Reply
Re: [Paul] What's Related on detailed pages? In reply to
Welp, that would be wrong. Since the table attributes I provided were for a 1->M connection between articles (having many related articles), I was giving the CORRECT column properties.

Good day! Mad
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Heckler] What's Related on detailed pages? In reply to
Yeah I know, thats why I deleted my post Wink
Quote Reply
Re: [Paul] What's Related on detailed pages? In reply to
I would want multiple articles to be related to the one you are reading. Is this major change, or something simple?

Last edited by:

Evoir: Apr 5, 2002, 11:38 AM
Quote Reply
Re: [Evoir] What's Related on detailed pages? In reply to
Major if you aren't comfortable creating tables or editing them in your MySQL database, or if you have never created your own Global or Plugin.

Might be better to investigate whether an existing hook in the script would be useful in creating this global.

Buh bye!
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Evoir] What's Related on detailed pages? In reply to
It is "fairly" simple.

You'd need a new table as Eliot mentioned and then you can select the related articles for each detailed page using a global.

You'd use the link id in the select query. eg...

my @related = $DB->table('New_Table')->select( { LinkID => $link_id }, 'RelatedID' )->fetchall_list;

Then you'd have all the related id's in @related and could just select the records from the Links table and build the output.

my $cond = GT::SQL::Condition->new('ID', 'IN', \@related);
my $sth = $DB->table('Links')->select( $cond );

Last edited by:

Paul: Apr 5, 2002, 11:45 AM
Quote Reply
Re: [Evoir] What's Related on detailed pages? In reply to
Like I already mentioned, since you, Evoir, are not comfortable with hacking/modifying scripts and a non-technical person, this modification WOULD be "fairly" complicated.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Heckler] What's Related on detailed pages? In reply to
Well Im happy to help him with the code, thats of course unless you want to do it? Wink
Quote Reply
Re: [Paul] What's Related on detailed pages? In reply to
honestly,

I would prefer to not get help from Heckler, and he knows this. Heckler has sent me threatening messages in the past and I have asked him to leave me alone, and I have asked Alex for assistance on this matter. I would prefer if Heckler never responded to my questions. As you'll notice, I stear pretty clear from him. I am sorry to be so blunt, but this is pretty well known by the parties involved.

So, Paul, I would b very grateful if you helped me. Oh, and I am a "her". Smile

Last edited by:

Evoir: Apr 5, 2002, 11:54 AM
Quote Reply
Re: [Evoir] What's Related on detailed pages? In reply to
Are you ok with creating the new table yourself?

If so, I can try and rustle up some code for the new related link tag to put in the detailed page whilst you create the table.

>>Oh, and I am a "her".<<

Blush .../me = sorry + embarassed

Girls are better than boys anyway (Im not sucking up...honestly Cool)

Last edited by:

Paul: Apr 5, 2002, 11:59 AM
Quote Reply
Re: [Paul] What's Related on detailed pages? In reply to
I never have created a table. Can't I do that in MYSQLMan? I'm willing to give it a try. Smile Am I likely to screw something else up?

Oh, and no problemo about the gender thing. I am secure in my gender identity! Cool

Last edited by:

Evoir: Apr 5, 2002, 12:06 PM
Quote Reply
Re: [Evoir] What's Related on detailed pages? In reply to
Hmm ok I hope this works right:

1. Open up mysqlman and next to "Tables:" click "Create"

2. Enter the table name, something like: Related_Links

3 Enter 2 for the number of columns.

4. On the next page you'll see a lot of form fields... don't panic!!

5. Enter the following info:

Row1:

Field: LinkID
Type: INT
Length: 8 (to be safe)
Attributes: Leave blank
Null: Select NOT NULL
Default: Leave blank
Extra: Leave unselected

Row2:

Field: RelatedID
Type: INT
Length: 8 (to be safe)
Attributes: Leave blank
Null: Select NOT NULL
Default: Leave blank
Extra: Leave unselected

I think I have that right.

That should work ok. Let me know how you get on.

The only bummer with this is that you can't really administer this from the admin panel...eg when adding/verifying links you can't select related links as Links SQL won't recognise this new table. So it will need to be done using mysqlman or a custom script (which is pretty easy), that unless Im totally forgetting something.

Last edited by:

Paul: Apr 5, 2002, 12:15 PM
Quote Reply
Re: [Paul] What's Related on detailed pages? In reply to
hmmm. Why won't the admin recognize the new table? Is there a way to ask it nicely to recognize the new table? Wink Would oh so cool if when adding a new article (link) one of the fields to fill out is "related articles".

Last edited by:

Evoir: Apr 5, 2002, 12:37 PM
Quote Reply
Re: [Evoir] What's Related on detailed pages? In reply to
Frown

It will only recognise the links table when adding/verifying as it is reading from the Links def file so you can add columns to the Links table and the admin panel will pick it up, but with a seperate table, Links SQL won't recognise it by default.

Alex may be able to prove me wrong but the only way I can think is to create a seperate script that would list your links and have a multi-select, again with the links listed allowing you to select a link and then select related links for the link you selected and then insert it into the new table. (if that made sense Laugh)

Last edited by:

Paul: Apr 5, 2002, 12:31 PM
Quote Reply
Re: [Evoir] What's Related on detailed pages? In reply to
Uh...It's a public forum, missy.

So, the fact of the matter is I can respond to your posts if I want to! All I was doing was trying to help you and as you have done many times, you have been ungrateful!

Best of luck, missy!
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Heckler] What's Related on detailed pages? In reply to
Alex, please.