Sat Feb 05, 2005
Group Link List Plugin
One of my initial plugins was mem_glinklist (Group Link List) which filled the need of having links outputted under their categories. It is what drives my links page. It has gone through many iterations and has gotten great responses from the Textpattern community. The file has been downloaded hundreds of times and is used on many sites. I figure it is about time I post an entry about it.
This documentation is outdated and the download link for this version has been removed. Here is the new post.
Client Plug-in Tags:
mem_categories
This will output a list of categories.
Tag Attributes:
- form—Specifies which form contains the list template.
- type—(optional) If specified, only categories of the specified type will be listed. If not specified, all types will be listed.
Template tags that can be used within the form for mem_categories.
<txp:mem_cat_id />—The numeric id of the category.<txp:mem_cat_name />—The name of the category.<txp:mem_cat_type />—The category type name. E.g. “link”, “article”, “image”, etc.<txp:mem_cat_parent_id />—The numeric id of the current categories parent.<txp:mem_cat_link />—An html link tag that points to the specified category with the proper query parameter. The text of the link is the category name.
Examples:
<txp:mem_categories form="cat_list" type="link" /><txp:mem_categories type="link"><txp:mem_cat_id /> - <txp:mem_cat_link /></txp:mem_categories>
mem_glinklist
The tag mem_glinklist functions the same as txp_linklist, except groups all links under their category heading. The main purpose for this plugin is to allow for a page containing organized lists of links. This plugin supports breadcrumb style category headings.
Tag Attributes:
- category—(optional) A comma separated list of categories that are to be group listed. If this value is not specified, or empty, then all categories will be
displayed. To include the uncategorized links, then add a comma to the end. E.g. category=”Blogs I Read,Comics,” will output links for the
categories “Blogs I Read”, “Comics”, and all uncategorized links. If this attribute is omitted, then it will use whatever categories are listed
in the url ("index.php?s=Section&lc=Cat1,Cat+2"). Note that this uses “lc” and not “c”, which is used throughout
textpattern. This is intentionally so to allow a specific category of articles and links to be independently specified. If the category
attribute and the url do not list a category, then it will default to all link categories. - columnclass—(optional) The CSS class that will be set for each column’s wraptag. Default is “mem_list_column”.
- columns—(optional) This specifies how the links with in a category will be outputted. There will be up to columns sets of links, where each set is wrapped in its own div that is tagged with the class attribute of “mem_list_column”. Default is “1”.
- columnwraptag—(optional) The html tag that will wrap each column with in a category list. Default is “div”.
- crumbtrail—(optional) The string that will be placed between each level of the category heirarchy. If this attribute is not specified, then the category heirarchy will not be shown.
- crumbroot—(optional) Specifies whether the root (empty) category will be shown. To enable, set attribute to “1”.
- form—(optional) The form that will be used. Default is “plainlinks”.
- headless—(optional) If enabled (set to “1”), then the category heading will be supressed. Default is “0” (disabled).
- headclass—(optional) The CSS class that will be set for each head’s wraptag. Default is “mem_list_head”.
- headwraptag—(optional) The html tag that will wrap each category heading. Default is “div”.
- limit—(optional) The max number of links to show per category. Default is 0 (no limit).
- linkto—(optional) If enabled (set to “1”), this creates all links as links back to /textpattern/link.php?id=#. Default is “0” (disabled).
- listclass—(optional) The CSS class that will be set for each category’s list. Default is “mem_list”.
- listwraptag—(optional) The html tag that will wrap each category list. This contains the columns and head for a single category. Default is “div”.
- sort—(optional) Specifies how the links will be sorted within their category groupings. This accepts the same sorts as txp_linklist. Default is “linksort”.
- sortbycat—(optional) Specifies whether the categories will be sorted. Default is “0” (disabled).
- uncategorized—(optional) Specifies the category name to use for links that are not linked to a category. Default is “Uncategorized”.
Template tags that can be used within the form for mem_glinklist are the same that can be used for built-in Textpattern tag <txp:linklist />. The output will take the form of:
<div class="mem_list">
<div class="mem_list_head">Category Name</div>
<div class="mem_list_column">...</div>
<div class="mem_list_column">...</div>
</div>
Examples:
<txp:mem_glinklist form="mylinks" category="Blogs,News" class="linklist" sort="linksort" />
mem_redirect
This will output an html anchor tag that is redirects back to “link.php”. This is used to log out going links.
Tag Attributes:
- id—The id of the target link.
- form—The form that contains the template for the generated link text.
Template tags that can be used within the form for mem_redirect.
<txp:category />—The category of the link.<txp:description />—The description text of the link.<txp:id />—The id of the link.<txp:linkname />—The name of the link.<txp:url />—The url of the link.
Examples:
<txp:mem_redirect id="1" />—output—<a href="/textpattern/link.php?id=1" title="Link description from db">Link name from db</a><txp:mem_redirect id="1"><txp:id /> - <txp:url /></txp:mem_redirect>—output—<a href="/textpattern/link.php?id=1" title="Link description from db">1 - http://link.url.com/</a>
Comment
http://www.armidapublications.com/en/
What I would like to achieve is a kind of submenu. ie under the ‘books’ category to have a glinklist of books by genre. The publisher of the site is not web savvy, so would like to make it as simple as possible.
My questions.
1. is it possible with this plugin to click on a ‘link category’ heading and for that link to lead to a page listing the list of links under thet link category?
2. is it possible to achive this with the use of one permanent form and one template?
3. For the life of me I just can’t figure it out.
I have posted the above questions on
http://forum.textpattern.com/viewtopic.php?id=1978&p=5but I hought it would be nice to ask the developer directly:)
— colak · 02/20/05 05:27 AM · #
Commenting is closed for this article.






