Posts Tagged: textpattern


2
Aug 06

txp:dml_rand_masthead

I wanted to use a random, rotating image as my site’s masthead and there was no simple way to do this in Textpattern. Initially I wrote a form with custom PHP code, including the Textpattern config, connecting to the database, doing a query… it seemed messy. So I started over and decided to do it as a plugin.

To install:

  1. Download the plugin file (see link below)
  2. Go to Textpattern’s admin tab
  3. Go to the plugins tab
  4. Paste the contents of the downloaded file into the text box and click upload.
  5. Once the plugin shows up in the list, you’ll have to click ‘no’ in the Active column to change it to ‘yes’; then the plugin will be active.

To use:

  1. Upload your masthead images using Textpattern’s image system. Put them all into the same category. I’ll use “site-masthead” as an example.
  2. Where you want the masthead to appear, add the tag <txp:dml_rand_masthead category="site-masthead" />

By default, the link will be built so that the tool tip is “Go to main page.” You can change this to any value you want by adding the linktext attribute, e.g.: <txp:dml_rand_masthead category="site-masthead" linktext="Return to home page"/>

You can also give the class="classname" attribute to attach a CSS class to the masthead.

Download dml_rand_masthead-0.5.txt


19
Feb 06

txp:dml_article_thumb

Textpattern provides the <txp:article_image /> tag, which I use in the templates for the majority of posts on my site. However, for some reason it doesn’t provide an equivalent tag for the thumbnail version of an article image. Since I use thumbnails in my RSS feed, this was problematic for me. This plugin was my answer to the problem.

To install:

  1. Download the plugin file (see link below)
  2. Go to Textpattern’s admin tab
  3. Go to the plugins tab
  4. Paste the contents of the downloaded file into the text box and click upload.
  5. Once the plugin shows up in the list, you’ll have to click ‘no’ in the Active column to change it to ‘yes’; then the plugin will be active.

To use:

  1. Make sure your article has an article image assigned. The article image is listed under the advanced options.
  2. Put a <txp:dml_article_thumb /> tag where you want the thumbnail to appear.

The article image should be the image’s ID number only. Don’t add a file extension or anything, just the ID, i.e. 52. To put the full size image into the article, use <txp:article_image />.

Download dml_article_thumb-0.6.txt