My hobbies are my passion. Whether or not I receive donations, I will continue to do what I love. If you would like to focus my efforts towards a specific project, donating will help (Use the optional instructions/comments field).
Sat
May
28

2005

mem_glinklist

I have made some major updates to my Group Link List plugin. This version has only been tested with Textpattern 1.0rc3 and is not guaranteed to work with an earlier version. If you are still using an older version of Textpattern, you should really start asking yourself “why?” If you came up with a good answer, then maybe you should check out the Original Posting and then email me to obtain the older install file.

Changes

Version 0.8.1

  • mem_link_date
    • Fixed date formating.
  • mem_if_category_empty
    • Added argname attribute.
  • mem_glinklist
    • Fixed argname and category attribute behavior.

Version 0.8:

  • Added tag mem_if_category_empty
  • mem_glinklist:
    • Removed attribute “linkto”.
    • Added attribute “catform” to allow altering the format of the category heading.
    • Form is parsed and $GLOBALS[‘thislink’] is set to be compatable with other plugins.
  • mem_categories:
    • Form is parsed and $GLOBALS[‘thiscategory’] is set to be compatible with other plugins.
    • Added template tags: mem_cat_link, mem_cat_crumbtrail, mem_cat_title, mem_cat_count
    • Added attributes: break, limit, wraptag, argname

Download

file: mem_glinklist.txt [25.25KB]
Category: Textpattern
download: 1778

Documentation

  • mem_glinklist
  • mem_if_category_empty
  • 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”.
  • 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).
  • 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”.
  • argname—(optional) The url query argument used for category links. Default is ‘lc’
  • catform—(optional) The name of the form to use to generate the category heading for a list. Default will use '<txp:mem_cat_crumbtrail />'.

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:

Template tags that can be used within the form for mem_glinklist are similar to those used by <txp:linklist />. This plugin sets $GLOBALS[‘thislink’].

  • <txp:link />—linklist tag
  • <txp:linkdesctitle />—linklist tag
  • <txp:link_description />—linklist tag
  • <txp:mem_link_date />—This outputs the date the link was entered. This tag can be used by linklist.
    • format—(optional) Any strftime format string that will be used for displaying of the date

<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_if_category_empty

This will conditionally parse the enclosed tags if the specified category is empty. Support <txp:else />.

Tag Attributes:

  • name—The name of the category.
  • type—(optional) The type of category specified by the “name” attribute. Default is ‘link’.

Examples:

  • <txp:mem_if_category_empty name="stuff">The category has is empty.<txp:else />The category is not empty.</txp:mem_if_category_empty>

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. Default is all categories.
  • sort—(optional) Specifies how the category list will be sorted. Default is ‘name’.
  • break—(optional) The tag that will break the items in the list. Default is none.
  • limit—(optional) The max number of categories to show. Default is 0 (no limit).
  • wraptag—(optional) The html tag that will wrap the category list. Default is none.
  • argname—(optional) The url query argument used for category links. Default is ‘lc’

Template tags that can be used within the form for mem_categories. This plugin sets $GLOBALS[‘thiscategory’] with the current category that is being processed.

  • <txp:mem_cat_id />—The numeric id of the category.
  • <txp:mem_cat_name />—The name of the category.
  • <txp:mem_cat_title />—The title 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.
  • The remaining tags can be used by any plugin that sets $GLOBALS[‘thiscategory’].
  • <txp:mem_cat_count />—The number of items (article,image,link,or file) in the category.
  • <txp:mem_cat_link /> or <txp:mem_cat_link><txp:mem_cat_name /></txp:mem_cat_link>—An html link tag that points to the specified category with the proper query parameter. Default link text is the category title.
    • argname—(optional) The url query argument used for category links. Default is ‘lc’.
    • class—(optional) This specifies the CSS class name. Default is “mem_cat_link”.
  • <txp:mem_cat_crumbtrail />—The crumbtrailed name of the category.
    • 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”.

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>

Comment

I love this plugin! But … I’am missing a search link funktion, and perhaps a submit link function.

Greetings Brian, Denmark

Brian Christensen · 06/27/05 01:38 AM · #

Hi, I’m looking to use this awesome plugin for a site I’m working on, but I note the following you may want to consider looking into.

1. When entering an HTTPS link in textpattern, the glinklist plugin renders out http://https://www.foo.com, not https://www.foo.com.

2. It would be wonderful if the links created with mem_categories would use relative hrefs. For example, I have this stuff in a section called bookmarks, where I have a glinklist on the left and a mem_categories on the right. It would be great if the glinklist would show everything by default, and clicking the mem_categories link could filter, but this does not seem to work. I can’t get mem_categories to work both with querystring and default to all, and the links from glinklist is all to my root. Any thoughts?

danboe · 08/16/05 06:30 PM · #

This plugin is very nice. My question is that when you have columns=”2”, it doesn’t appear to work correctly if a category has an odd number of items in it. It doesn’t display the last (or only item).

Malial · 10/13/05 10:47 PM · #

Textile Help