Smd imagery - A Textpattern CMS plugin for managing images in the Write panel.

Overview

smd_imagery

Insert images into your Write panel. Very handy for people who run photoblog or image-heavy sites, or those who categorise images for inclusion in articles.

Features

  • Replace category names with image id values in the Article Image field.
  • Comma-separate category names to grab id values from them all at once.
  • Order of image id values is preserved.
  • Craft custom image sets based on an image category, or load images from an article field.
  • Build a list of id values or a complete tag to paste into your article via a template.
  • Fast and efficient: only one query.

Installation / Uninstallation

Requires Textpattern 4.5+

Recommended: Textpattern 4.6+

Download the plugin, paste the code into the Textpattern Admin→Plugins panel, install and enable the plugin. For bug reports, please raise an issue.

To uninstall, delete the plugin from the Admin→Plugins panel.

Usage

Once installed, two new buttons labelled Fetch and Manage appear below the Article Image field. Both of these allow you to insert images into your article, but they do it in different ways, as detailed below.

Populating Article Image by category

Use the Fetch button to immediately ask the database to grab the image id values from any category names listed in the Article Image field. If you are using Textpattern v4.6.0 or later, just save or publish the article: the image id values will be fetched for you automatically and populated in the Article Image box.

Notes:

  • The order of id values already present in the Article Image field is perserved after replacement.
  • Any categories that do not exist (or typos) will remain in the list.
  • Any category names that are wholly numeric will not be fetched, as the plugin cannot distinguish between them and id values.
  • The maximum number of characters — incuding commas and spaces — that can be stored in the Article Image field is 255 by default. This is why the plugin doesn’t put spaces between its id values. If you insert a category name that results in the image id list exceeding this number of characters, the article will throw an error when saving.

Examples

Example 1

  • Create an image category called holiday_snaps.
  • Upload some images and assign them to that category.
  • On the Write panel, type holiday_snaps into the Article Image field.
  • Hit Fetch.
  • Note that holiday_snaps has been replaced with a list of image id values that were assoaciated with that category.

Example 2

  • Create a few image categories.
  • Upload some images to each.
  • On the Write panel, list the image category names in the Article Image field.
  • Hit Fetch and note the content of the Article Image field has been populated with the id values from each of the categories.

Example 3

Do something similar to Example 2, but before httng the Fetch button, sprinkle some other image id values in the Article Image field. For example:

15, 42, holiday_snaps, 6, night-out, 129

After hitting Fetch, note that the id values pulled from the database are replaced in-situ. Also note that if one or more of the id values you’ve typed are the same as any in the categories you’re fetching, the duplicates will not be fetched. Further, if all of the id values that comprise a category are already in the Article Image field, that category name will remain in the list.

Crafting image lists by hand

For more control over your image lists, and where you can insert the resulting values, use the Manage button. This will pop up a dialog box that contains a radio button to allow you to choose between two methods of fetching images:

  • By category: to load images by the chosen category, at the chosen size, ordered by the chosen property in the desired order depicted by the arrow.
  • From field: to load images from the selected article field, in the order defined in that field.

In the latter case, the plugin searches for images in the following order:

  1. A straight list of id values.
  2. <txp:images id="x, y, z, ...">.
  3. <txp:images name="file1.jpg, file2.png, file3.jpg, ...">.
  4. <txp:image id="x" /> <txp:image id="y" /> <txp:image id="z" />
  5. <img src="http://example.org/images/x.jpg" /> <img src="http://example.org/images/y.png" /> <img src="http://example.org/images/z.jpg" />

Notes:

  • Selecting the empty entry at the top of the category list will fetch all uncategorized images.
  • If you have the smd_thumbnail plugin installed, any active profiles you have defined are also available in the ‘size’ dropdown.
  • If you choose ‘Image’ as the size, it will fetch every full-size image in the chosen category. This may take some time if the number of images is large!

Once you have selected your image category/field and properties, hit the nearby Fetch button. All images that match the criteria of that size will be loaded in the dialog window for your consideration. You may drag and drop the images to reorder them to taste, or hit the ‘x’ button to remove an image from the list. It will not delete the real image on disk, just remove it from the list in the dialog box.

As you alter the images in the dialog box, the Result textarea box at the bottom of the dialog is updated in real-time to reflect the list of id values that represent your chosen image set. At any time you can copy that list and paste it into the Article Image field, a custom field, the body, etc in order to build your gallery.

You may also use the Template box to specify a template into which the list will be inserted. The entire set will then be available in the Result box. This is primarily designed for creating tags such as <txp:images> from your lists. For example, you could define your tag template as:

<txp:images id="{smd_imagery_list_id}" form="gallery" />

Whichever images you choose in the list, their id values will be inserted in place of the {smd_imagery_list_id}, in real-time. If you prefer image names, you may elect to define your tag something like this:

<txp:images name="{smd_imagery_list_name}" form="gallery"
   wraptag="div" class="photos" />

There are also a pair of specialised replacement tags to return quoted lists of ids or names: {smd_imagery_list_id_quoted} or {smd_imagery_list_name_quoted}.

If you wish to insert each image individually, you might like one of these templates:

<txp:image id="{smd_imagery_id}" />

or

<txp:image name="{smd_imagery_name}" />

You can copy and paste the complete tag(s) from the Result box and paste it into your article somewhere, or use it as a sneaky tag builder for galleries. Your template could even include an smd_macro! If using the core tags, your gallery Form can, of course, be used to render anything you like using the <txp:image>, <txp:image_info> and <txp:image_url> et al tags.

Notes:

  • Your chosen image size, field, template tag and sort options are automatically remembered and recalled each time you open the dialog box so you can rapidly build galleries on photo-heavy sites.
  • When using the <txp:images> tag to construct galleries using its name attribute, the resulting gallery will not contain images in the order you specify. Only its id attrbute will return them in the defined order.
  • The dialog box is dog ugly under Txp 4.5.x because jQuery UI is not included, nor styled to match the admin theme. Using the plugin under Txp 4.6+ offers a much cleaner experience.
You might also like...
MassPlugCompiler - Textpattern CMS plugin compiler

mtxpc mtxpc compiles Textpattern CMS plugin sources into installer packages. Supports multi-file structure and a JSON manifest file. Install Using Com

Rah cache minify - HTML compressor module for rah cache Textpattern CMS plugin

Minify module for rah_cache This is a minify module for rah_cache, a full-page caching solution for Textpattern CMS. Rah_cache_minify will minify HTML

Etc cache - Cache plugin for Textpattern CMS

etc_cache Download | Packagist This Textpattern plugin provides an events-driven cache solution for Textpattern CMS. Textpattern is fast, but when you

Etc pagination - Pagination plugin for Textpattern CMS.

etc_pagination Download | Packagist This Textpattern plugin creates a paginated navigation bar on listings. It has a wide variety of attributes – so y

Zem contact reborn - An extensible HTML form mailer plugin for Textpattern CMS.

com_connect Contents Introduction Installing and upgrading Migrating from zem_contact_reborn Usage Tags com_connect tag com_connect_text tag com_conne

Rah comment spam - Comment anti-spam plugin for Textpattern CMS

rah_comment_spam Packagist | Issues | Donate Rah_comment_spam provides customizable anti-spam tools for Textpattern CMS’ comment system. Set minimum a

A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch screens with a resolution of 1024x600 connected to a Raspberry Pi.

EDStatusPanel A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch scr

Rah backup - Takes backups from Textpattern CMS installations

rah_backup Packagist | Twitter | Donate Rah_backup keeps your important site safe from disastrous events. Rah_backup is an admin-side backup utility p

Rah sitemap - XML sitemap generator for Textpattern CMS

rah_sitemap Packagist | Issues | Donate Sitemap plugin for Textpattern CMS. Generates Sitemaps.org XML sitemaps for your site, which help Google and o

Comments
  • Enhance regex when scanning for images

    Enhance regex when scanning for images

    Two features need building into the regex when importing images from an article textarea field:

    Multiple images

    Make this regex less greedy:

    <txp:image[s]?.*((id)\s*=\s*"([0-9, ]+)"|(name)\s*=\s*"(.+?)").*?\/?>

    It currently only picks the last image if more than one at a time are in a group. For example:

    <txp:image id="393" />
    <txp:image id="394" />
    
    Some text...
    
    <txp:image id="395" /><txp:image id="396" />
    

    The plugin will only pick up image IDs 394 and 396, but it should extract all four of them.

    Parse Textile-inserted images

    Enhance the regex so it can check for !/path/to/images/id.ext! format images too. With / without domain.

    bug enhancement 
    opened by Bloke 0
  • Czech textpack

    Czech textpack

    #@smd_imagery smd_imagery_dialog_title => Vložit obrázky smd_imagery_fetch_btn => Vyhledat smd_imagery_id_btn => Připojit ID obrázků smd_imagery_image => Obrázek smd_imagery_opt_cat => Podle kategorie smd_imagery_opt_fld => Z pole smd_imagery_organise_btn => Upravit smd_imagery_result => Výsledek smd_imagery_template => Šablona

    opened by milosberka 0
  • French textpack

    French textpack

    #@smd_imagery smd_imagery_dialog_title => Insérer des images smd_imagery_fetch_btn => Retrouver smd_imagery_id_btn => Récupérer les IDs smd_imagery_image => Image smd_imagery_opt_cat => Par catégorie smd_imagery_opt_fld => Récupérer du champ smd_imagery_organise_btn => Gestion smd_imagery_result => Résultat smd_imagery_template => Modèle

    opened by jpdupont 0
Releases(v0.10)
  • v0.10(Oct 7, 2016)

    First version of the image management plugin with attitude. For photographers, photobloggers and anyone with image-heavy sites who upload a lot of images to their Textpattern Content->Images panel and categorise them.

    Create galleries from pictures straight from Textpattern's Write panel. Load by category, browse, drag 'n drop to reorder or remove, then paste into your article image field, article body or any other field of your choosing. Or simply supply category names in your Article Image field, hit one button and load all images immediately.

    If visiting articles already populated with images, you can load those into the image browser and tweak your galleries to taste, then write them back to your article.

    Custom templates allow you to create any image tags of your choosing for wacky galleries or to offload tag generation to a Form -- you can even use smd_macros. And it integrates with smd_thumbnail so you can view your images at any resolution you desire.

    It's image-mungous.

    Source code(tar.gz)
    Source code(zip)
    smd_imagery_v0.10.txt(51.47 KB)
    smd_imagery_v0.10_en-gb_textpack.txt(309 bytes)
    smd_imagery_v0.10_es-es_textpack.txt(334 bytes)
    smd_imagery_v0.10_zip.txt(14.45 KB)
Owner
Stef Dawson
Part human, mostly code.
Stef Dawson
YCOM Impersonate. Login as selected YCOM user 🧙‍♂️in frontend.

YCOM Impersonate Login as selected YCOM user in frontend. Features: Backend users with admin rights or YCOM[] rights, can be automatically logged in v

Friends Of REDAXO 17 Sep 12, 2022
Smd horizon - Next/previous Textpattern article without restrictions

smd_horizon The existing tags <txp:next_title />, <txp:link_to_next /> and their prev counterparts cease to function when they reach the first/last po

Stef Dawson 1 Oct 22, 2019
Tom image grid - Plugin for Textpattern CMS : An optionnal grid display for images tab

tom_image_grid tom_image_grid is a plugin for Textpattern CMS. It allows a more compact display (as a grid) of the images list. The plugin adds two bu

Thomas Jund 5 Jun 30, 2019
Textpattern-for-Panic-Coda - A Textpattern CMS mode for Panic Coda

Textpattern elements for Panic Coda 2 Handy elements for use with Panic Coda 2 on a Mac when authoring files for the Textpattern CMS. This repository

Phil Wareham 8 Jun 26, 2017
Rah privileges - Configure Textpattern CMS' user-group privileges through Preferences panel

rah_privileges Packagist | Donate Configure admin-side user-group permissions from Textpattern CMS’ preferences panel. Install Using Composer: $ compo

Jukka Svahn 4 Apr 16, 2022
Textpattern-installer - Textpattern plugin and theme installer for Composer

Textpattern Installer for Composer Package directory | Issues Install plugins and themes to Textpattern CMS with Composer. $ composer require rah/rah_

Jukka Svahn 7 Apr 14, 2022
Oui instagram - Instagram user infos and recent images embedding plugin for @textpattern

oui_instagram Easily display Instagram recent images galleries. Plugin requirements required: Textpattern CMS 4.6+. recommended: aks_cache or any part

Nicolas Morand 4 Feb 20, 2020
Ied plugin composer - Inspired Plugin Composer: Create, publish and edit plugins from within Textpattern CMS.

ied_plugin_composer Create, publish and edit plugins from within Textpattern CMS. Creates a new page under the Extensions tab where you can edit and e

Stef Dawson 8 Oct 3, 2020
Smd thumbnail - Multiple image thumbnails of arbitrary dimensions

smd_thumbnail Download | Packagist If you’re bored of one Textpattern thumbnail per image and don’t fancy using an auto-resizing script or relying on

Stef Dawson 9 Dec 9, 2021
A web app for the resolution of a mobile game in wich you have 4 images and a list of letters, then a few boxes to fill with the word connecting the four images.

4images_1mot_solutions A web app for the resolution of a mobile game in wich you have 4 images and a list of letters, then a few boxes to fill with th

FOTSO Claude 3 Jan 13, 2022