Table of Contents
A better tool for this has been released by Yoshi, and you can find the LinkList module at his site.
Using a weblog
* XFN Friendly - OPTIONAL - included by default, see notes about removal.
* Searchabe
* Each link is an entry, so easy to sort and user orderby on.
* Bookmarklet-able
So there are several steps that need to be taken in order to do this.
Template Group
# Go to the index in your weblog group and copy the entire contents out.
# Create a new template group called “links”
# Open the auto created index and paste in the template code from step 1.
# Find the exp:weblogs container and replace it with this code:
<ul>
{exp:weblog:entries weblog="links" orderby="title" sort="asc" limit="99"}
<li><a href="{urllink}" rel="{urlxfn}" title="{urldesc}">{title}</a> {urldesc}</li>
{/exp:weblog:entries}
</ul>
‘’’Note: In the above code, if you do NOT wish to use XFN, remove the - rel="{urlxfn}" - from the code.
Save it.
# Create a new template in the links template group and call it “linklist”
# Paste this code into it:
<ul>
{exp:weblog:entries weblog="links" orderby="random" sort="desc" limit="7" dynamic="off"}
<li><a href="{urllink}" rel="{urlxfn}">{title}</a></li>
{/exp:weblog:entries}
</ul><br />
<p><a href="/index.php/links/">that was a random sampling, now go see the rest</a></p>
Note: In the above code, if you do NOT wish to use XFN, remove the - rel="{urlxfn}" - from the code.
4. Save.
Custom Fields
This makes use of EE’s ability to create custom fields.
# Click admin
# Click “"Custom Weblog Fields”
# Create New Group called Links
Now we are going to create three custom fields. For each of these please ensure that you find where it says “Text Formatting” and set it to “none”. All will be of format “Textarea”
# Create a field with the above parameters. Short name: urllink. Label: URL
# Create a field with the above parameters. Short name: urldesc. Label: Description
# Create a field with the above parameters. Short name: urlxfn. Label: Relationship (XFN) - OPTIONAL: skip this one if you do not wish to utilize XFN.
Links Weblog
# Go to Weblog Management
# Create a new Weblog
# Shortname: links
# URL: http://www.yoursite.com/index.php/links/
Note: This assumes that EE runs at the base of your site and not at a subdomain. You should follow the same ‘link name convention’ that your main weblog uses, just append /links/ at the end.
# Fill in the rest of the values with whatever you want except....
# Find the field “Automatically turn email and links into real links - and set that to “No”. Make sure you do this for the entries NOT the comments.
# I kept comments off for this but you can do whatever you want - if you turn them on the templates will require modifications to show them etc.
# Save.
Now you need to associate the custom weblog field group we made earlier to this new weblog. Click on “Manage Weblog” and then click on “Edit Preferences”. Choose “none” for category (if you want to categorize your links, you can add a category group then choose that here; this doesn’t cover that.), “default” for status and “links” for field group.
Now, all that you need to do is figure out where you want the short version of the randomized linklist to appear on your front page and embed the linklist template.
Publishing Links
Now, to publish your links all that you do is this.
# Click publish.
# Choose the “links” weblog: I will use my site as an example
# Put “distant, early morning” into the title.
# Put “http://www.lisajill.net” into the URL
# Put “bind yourself to me; close your eyes to feel free.” into the description
# Fill in your XFN relationships. This I do manually although I may add some more custom fields later when I get my head around it. You should read the parameters so that you know what to enter. Most of mine are either just “friend” or “acquiantance” although some are “friend, met” and one even has “friend, met, muse”! simply enter the comma seperate keywords into the Relationship field to add these, or you can leave it blank.
Note: If you are going to use XFN please remember to read the specs and to change your <head> to <head profile="http://gmpg.org/xfn/1"> anywhere that your blogroll entries may appear.
Anyway, that’s it! Pretty simple and now it’s very easy to update. You can create a bookmarklet in “edit your profile” and choose “URL” as the auto populate field. Then when you click the bookmarklet it will fill in the title automatically with the title of the page you’re viewing, and the URL with the URL of the site you are at when you click the bookmarklet. Then you merely need to click Submit, or add a description and relationships then click submit. Very fast and easy.
Links by Category
A further modification is that you can show entries by category, by using this code:
<ul>
{exp:weblog:category_archive weblog="links" style="linear" show_empty="no"}{categories}
<li>{category_name} <ul>
{exp:weblog:entries weblog="links" orderby="title" sort="asc" category="{category_id}"}
<li><a href="{urllink}" >{title}</a></li>
{/exp:weblog:entries} </ul>
</li>{/categories}{/exp:weblog:category_archive}
</ul>
Thanks to TPaine in this thread - there are also instructions on formatting it as a definition list.
<dl>
{exp:weblog:category_archive weblog="links" style="linear" show_empty="no"}{categories}
<dt>{category_name}
<dl>
{exp:weblog:entries weblog="links" orderby="title" sort="asc" category="{category_id}"}
<dt><a href="{urllink}" title="{urldesc}">{title}</a></dt>
<dd>{urldesc}</dd>
{/exp:weblog:entries} </dl>
</dt>{/categories}{/exp:weblog:category_archive}
</dl>
It is possible to use this for a communal website. You have one ‘blogrolling’ weblog, and each author posts their links to it. Then, to show only that authors links, you can utilize code similar to this.
{exp:weblog:entries username="petunia"}
<a href="{urllink}">{title}</a> {/exp:weblog:entries}
where petunia is replaced by the name of the author.
I hope that helps someone. Please feel free to leave feedback with questions or clarifications or any help that’s required. I’m happy to help and to improve this walkthrough based on suggestions.
