 | |  |
 |

MalaK_3araby
User
Sep 19, 2002, 5:47 PM
Post #1 of 21
(9984 views)
Shortcut
|
|
[ADDON] Related Articles
|
Can't Post
|
|
Adding a Related Articles Link/Button. This is done using search.cgi and a custom (text or pulldown) field. We can use a text field for the writer to type the appropriate keywords (not tested but should work), OR we can predfine the various keywords in a dropdown menu for the writer to choose from (tested and works). Setup Instructions: 1- Login to your Admin area and go to Setup Options 2- pick a spare field (i.e: art_field3) to use and Enable it. 2.1- If you want to use pulldown field type, then in the field name type your keyword options, i.e: code: Keywords (,keywords set 1,keywords set 2,keywords set 3,keywords set 4) and Save. 2.2- Or you can use field type textfield if you want your writers to type in the keywords for thier articles, in which case just type Keywords in the field name .. and Save. 3- Open your Article template file in your editor and descide where you want to add the Related Articles button and paste this: code: <form action="$url_search$" method="post"> <input type="HIDDEN" name="keyword" VALUE="$art_field3$"> <input type="submit" value="Related Articles" STYLE="font-size: 8pt; font-family: Arial; color: #0000CC; background-color: #FFFFFF; border-style: solid; border-color: #FFFFFF; padding: 0; background-position: right 50%"> </form> Save and Upload, then Publish All pages. Note: the button face is formatted to look flat on a white background, change the button style if you need to. DONE. Image is attached to see what it looks like. comments? modifications? suggestions? Enjoy. Notes for ITools staff: I tried to avoid using a spare field and tried to use the summary field to base the search on but it did not work .. i mean i get no result unless the summaries are identical in artciles, which is never the case. This is what i did: Using the summary field Open your Article template file in your editor and descide where you want to add the Related Articles button and paste this: code: <form action="$url_search$" method="post"> <input type="HIDDEN" name="keyword" VALUE="$art_summary$"> <input type="submit" value="Related Articles" STYLE="font-size: 8pt; font-family: Arial; color: #0000CC; background-color: #FFFFFF; border-style: solid; border-color: #FFFFFF; padding: 0; background-position: right 50%"> </form> Now Save and Upload, then Publish All pages. -------------- Sure you can spell it, but do you get it?
|
|
Attachments:
|
related.gif
(8.76 KB)
|
|
|  |
 |

MalaK_3araby
User
Sep 19, 2002, 5:56 PM
Post #2 of 21
(9984 views)
Shortcut
|
|
Re: [MalaK_3araby] [ADDON] Related Articles
[In reply to]
|
Can't Post
|
|
screen shot -------------- Sure you can spell it, but do you get it?
(This post was edited by MalaK_3araby on Sep 19, 2002, 6:01 PM)
|
|
Attachments:
|
related-2.gif
(13.6 KB)
|
|
|  |
 |

MalaK_3araby
User
Sep 19, 2002, 6:14 PM
Post #3 of 21
(9983 views)
Shortcut
|
|
Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
The previous method provides the user with a button thats when clicked will direct the user to a page with all related articles .. but here is how to diplay a list of related artciles right underneath the Latest Headlines Column. See attached screen shot. Instructions: 1- create a new basic template to use to display the search reults and name it related_articles.html i use the attached related_articles.html file. Save and upload to your /templates/search/ folder. 2- open your article template (found in /templates/article) and find: code: <!-- INCLUDE TOP HEADLINES (from this category) --> <!--#include file="$file_headlines$" --> <!-- template include : $file_headlines$ --> <img src="$_imageurl$set1_maple/spacer.gif" height=1 width=150><br> add after that add the following html code: code:
<hr> <!--#include virtual="/artman/exec/search.cgi?template=search/related_articles.html&perpage=5&keyword=$art_field3$&start=1" --> Note the PERPAGE value and change as you like .. i set mine to 5. also note the sparefield number .. i use $art_field3$ Save and upload. Please ALWAYS BACKUP Your Templates BEFORE you modify them just in case you need to revert. You have been warned Enjoy. If you use this, please let me know .. it will make me feel good :) -------------- Sure you can spell it, but do you get it?
|
|
Attachments:
|
related_articles.html
(4.90 KB)
|
|
|
related_list.gif
(26.1 KB)
|
|
|  |
 |

canvey
User
Sep 20, 2002, 5:26 AM
Post #4 of 21
(9960 views)
Shortcut
|
|
Re: [MalaK_3araby] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
Looks good - I guess the key to the keywords (no pun intended) is that they are all seperated by commas - therefore to use the $summary one would have to extract the summary, inserting a comma for each space, and perhaps removing common words like ' a,and,the,on,at' etc. otherwise on most articles every other article would be linked. Of course the method mentioned is more manual, but depending upon the number of articles could be easily handled. Thank you for sharing.
|
|
|  |
 |

MalaK_3araby
User
Sep 20, 2002, 8:54 AM
Post #5 of 21
(9949 views)
Shortcut
|
|
Re: [canvey] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
hi canvey and thanks for the input mate. i used the term "keywords" for words that define the artcile type and then its used to link related artciles ... however, keywords as meta tags are very possible and are a better idea since it helps indexing with search engines and can still be used to relate artciles: <META NAME="KeyWords" CONTENT="hard coded key words and/or $art_field3$"> Re. using the summary field: i am not quite sure how everyone uses the summary field, but i use it to present abstracts about the story .. there for 2 articles that are related will most likely differ in summary. i got the whole idea when i needed sub-categories that i can assign articles to and then provide the user of a way to pick artciles within that sub-cat .. <i am avoiding hardcoding subcategories> .. anyhow .. this all developed just a little and turned out to a dual porpose idea: relating articles using keywords. edit reason: typ0s .. grrr -------------- Sure you can spell it, but do you get it?
(This post was edited by MalaK_3araby on Sep 20, 2002, 8:57 AM)
|
|
|  |
 |

taylor
User
Sep 21, 2002, 10:11 AM
Post #6 of 21
(9910 views)
Shortcut
|
|
Re: [MalaK_3araby] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
The link/button method worked for me--but the other way did not--and that is the method I wanted to work! I get this error message: [an error occurred while processing this directive] Help? Taylor
|
|
|  |
 |

MalaK_3araby
User
Sep 21, 2002, 10:37 AM
Post #7 of 21
(9908 views)
Shortcut
|
|
Re: [taylor] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
Hiya taylor .. glad you like it and the button worked for you. Re. the 2nd method where you list the Related Articles: - please check the path to search.cgi used in the include line - make sure you uploaded the attached related_articles.html template into your search folder - make sure you are not missing anything. code: <hr> <!--#include virtual="/artman/exec/search.cgi?template=search/related_articles.html&perpage=5&keyword=$art_field3$&start=1" --> The above is all in one line. Let me know how it goes plz. G. Luck -------------- Sure you can spell it, but do you get it?
|
|
|  |
 |

taylor
User
Sep 21, 2002, 11:10 AM
Post #8 of 21
(9904 views)
Shortcut
|
Re: [MalaK_3araby] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
MalaK_3araby-- Look in your private message box for my reply.. Taylor
|
|
|  |
 |

taylor
User
Sep 21, 2002, 12:24 PM
Post #9 of 21
(9900 views)
Shortcut
|
Re: [taylor] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
It works! This is a great feature, Malak! Thank you for sharing this with us! Taylor
|
|
|  |
 |

MalaK_3araby
User
Sep 21, 2002, 12:31 PM
Post #10 of 21
(9899 views)
Shortcut
|
|
Re: [taylor] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
great news and i am so glad you like it .. and you are VERY welcome. MalaK -------------- Sure you can spell it, but do you get it?
|
|
|  |
 |

mgdamore
User
Dec 22, 2002, 9:59 AM
Post #11 of 21
(9673 views)
Shortcut
|
|
Re: [MalaK_3araby] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
Malak Love the add on - but AM returns a null search if there is nothing in the keyword feild. Have you come-up with anyway around this - or at least a way to tell the user there is nothing? - Mike
(This post was edited by mgdamore on Dec 23, 2002, 9:46 AM)
|
|
|  |
 |

Lionel
User
Jan 13, 2003, 5:58 PM
Post #12 of 21
(9609 views)
Shortcut
|
|
Re: [mgdamore] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
Love this! Thanks Malak.
|
|
|  |
 |

MalaK_3araby
User
Jan 22, 2003, 8:27 PM
Post #13 of 21
(9565 views)
Shortcut
|
|
Re: [mgdamore] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
Hiya mgdamore I am hardly available to support this addon so i extend my apology for not replying any sooner. Re. ur question: i have not looked at that, but i really see no problem if related articles not show since it means that there are no related articles. You might wanna look at this post: http://www.interactivetools.com/forum/gforum.cgi?post=2474;search_string=condition;t=search_engine#2474 It talks about IF condition (Empty then action). -------------- Sure you can spell it, but do you get it?
|
|
|  |
 | |  |
 |

Lionel
User
Jan 23, 2003, 7:31 PM
Post #15 of 21
(9544 views)
Shortcut
|
|
Re: [MalaK_3araby] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
I made a tiny correction in the template for row_link and row_ufile I changed $artname$ to <a class=navi href="$url_index$#$art_num$">$artname$</a> to link them to the anchor. If you don't they don't display links as they don't have any. I think that this is the best addon ever produced for AM . Go forum.cgi is nice too, but there is a small php called commenter.php that alows users to display comments directly below articles.
|
|
|  |
 |

Rozey
User
Apr 11, 2004, 1:25 PM
Post #17 of 21
(8181 views)
Shortcut
|
|
Re: [MalaK_3araby] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
I can't get this to work with my <?php include statement. Can you help? I can get the link button to work -- but I can't get it to bring in the results to the page using php include. What else can I do to show a list of related articles? I use PHP pages -- not html/shtml Thanks! Rozey
|
|
|  |
 |

MalaK_3araby
User
Apr 14, 2004, 5:19 PM
Post #18 of 21
(8108 views)
Shortcut
|
|
Re: [Rozey] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
Php gurus, anyone? -------------- Sure you can spell it, but do you get it?
|
|
|  |
 |

Eric
Product Specialist

Apr 15, 2004, 10:24 AM
Post #19 of 21
(8080 views)
Shortcut
|
|
Re: [Rozey] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
Hi Rozey, Thanks for the forum post . PHP includes work a little differently than server-side includes. While server-side includes uses web path, with php you need to use the file path. To demonstrate the difference, let's say when you login to your web server through FTP and your FTP client tells you that your web root folder is in /var/www folder. Say there's a test.html file on the web root folder (ie. /var/www) you want to include. With SSI the code would be: <!--#include virtual="/test.html" --> With php include you need: <?php include '/var/www/test.html';> Now the question becomes ... how do I find out the file path? For some servers that'll be easy since it's shown on the FTP client. However, some servers are set up to hide this information from you and the FTP client so in those cases you may need to contact your web hosting provider for the file path information. I hope this helps. If you have other questions please let me know. Cheers, Eric Lau - Product Specialist support@interactivetools.com
|
|
|  |
 |

ccunet
User
May 12, 2004, 4:51 AM
Post #20 of 21
(7416 views)
Shortcut
|
|
Re: [Eric] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
I've gotten the link version of this partially working. The related links show in the proper place however when I enter the keywords I only get a single link to the same article as the one I'm reading. I've tried removing the spaces between the keywords (still separated by commas) but that didn't work. Tried no commas that too did not work. Any help appreciated on this one. ccunet
|
|
|  |
 |

Eric
Product Specialist

May 12, 2004, 3:48 PM
Post #21 of 21
(7243 views)
Shortcut
|
|
Re: [ccunet] Listing related articles in the article page
[In reply to]
|
Can't Post
|
|
Hi ccunet, Thanks for the forum post . Without the ability to examine your installation I wouldn't know what the issue is and how to resolve it since I've never seen this issue before. If you'd like, I could take a look at your server and I may make better progress. Simply fill out a support form: https://www.interactivetools.com/support/email_support.cgi with your FTP information and I can get on it right away! :) Cheers, Eric Lau - Product Specialist support@interactivetools.com
|
|
|  |
|