Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-10-07 22:29:32

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

smd_imagery: for photographers, photobloggers and category geeks

Please welcome my first new official plugin in ages.

Anyone who has followed anything I’ve ever said about our dear Article Image field knows I’m a big proponent of leaving it the hell alone in its lowest form as it is now: supporting a simple list of IDs. With the release of this plugin I hope the reason for my stance is now clear: because everyone’s image workflow is different, core cannot satisfy everyone with a pretty interface. Plugins can.

This plugin is optimised for those who use a lot of images in Txp and especially those who categorise them and tie their image workflow to articles. Over the past few weeks as I have been iteratively tweaking this plugin, it has been undergoing some heavy testing by one of the world’s best wedding photographers, Ross Harvey. This plugin would not have existed without his amazing patience and feedback, so I thank him and hope he doesn’t mind me quoting him here:

Txp now has better image handling for photographers than WordPress. All because of you!

Ross has gigabytes of images to manage, so if that quote alone gets you excited, don’t listen to any more of my waffle. Just grab yourself a copy, install it on Txp 4.6.0+ and play. Although it does work on 4.5.x, it’s not as pretty or fully featured.

Still here? Guess you want to know what it does. Well, first of all, upload some images to your Textpattern installation. And if you’ve categorised them, even better because the plugin will love you. Then open up your Article Image twisty on the Write panel. Two new buttons there allow you to make your own galleries depending on how you work. Give the first one a try. Type an image category in the Article Image field and hit Get IDs. Boom! It integrates with your existing lists so you can add images to them from many categories in one go. And it’ll only load one of each image in, removing duplicates.

If that’s not enough, go DIY. Hit the Manage button and a dialog pops up. Choose an image category from the select list and hit Fetch. All image thumbs in that category will be loaded. You can rearrange them via drag ‘n drop, and delete images from the list (don’t fret: they’re safe on disk) until you’re happy with your gallery. Copy the list of IDs out of the Result box and stick ‘em where you like.

Not enough? Make your own tag to house your gallery using the Template box:

<txp:images id="{smd_imagery_list_id}" class="gallery" wraptag="div" />

As soon as you leave the box the Result will be instantly updated, replacing the {smd_imagery...} tag with images in your collection. If you prefer each image in its own tag:

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

Go nuts. Mix HTML with <txp:...> tags to your heart’s content. Offload stuff to a Form; whatever you want. Your template and settings will be saved for next time.

If you already have articles with image tags in them, switch the plugin’s mode to load By field and it’ll scan your nominated field for images and load them into the image browser for you to rearrange. The plugin documentation describes stuff in more detail. Oh, and it integrates with smd_thumbnail so you can preview your images at custom sizes.

I’m sure the plugin could do more in future, like remember more than one template or scan articles for custom image patterns, but I thought I’d let you try it now and see what you think. I decided to ditch my support for both jmd_image_selector and its sister smd_image_selector, because they’re just not optimised for today’s image connoisseur. This plugin is a reimagination of those old plugins, but with a focus on speedy workflow for the busy image website owner.

Please report what fun or features you can dream up, either here or on the Issue tracker. And enjoy image/category harmony, smd style.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#2 2016-10-08 06:32:26

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Re: smd_imagery: for photographers, photobloggers and category geeks

Gorgeous! My wife is also wedding photographer so I’ll give it a try for sure. Thanks Stef

es-es text pack (Not sure how to better translate “Fetch” in this case, I think “Consultar” is good enough, but perhaps other user will suggest you another term):

#@smd_imagery
smd_imagery_dialog_title => Insertar imágenes
smd_imagery_fetch_btn => Consultar
smd_imagery_id_btn => Obtener IDs
smd_imagery_image => Imagen
smd_imagery_opt_cat => Por categoría
smd_imagery_opt_fld => Desde campo
smd_imagery_organise_btn => Gestionar
smd_imagery_result => Resultado
smd_imagery_template => Plantilla

Last edited by milosevic (2016-10-08 07:14:27)


<txp:rocks/>

Offline

#3 2016-10-08 07:21:57

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_imagery: for photographers, photobloggers and category geeks

milosevic wrote #302029:

es-es text pack

Thank you! I’ll upload it to the repo as a separate file and incorporate it into the plugin in the next version.

Not sure how to better translate “Fetch” in this case, I think “Consultar” is good enough, but perhaps other user will suggest you another term.

I’ll trust your judgement. Since it just grabs all images it finds in the given category or from the article field chosen, if you need inspiration for a translation, maybe ‘grab’ or ‘load’ or something like that?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2016-10-08 11:11:52

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: smd_imagery: for photographers, photobloggers and category geeks

Cool idea! Sounds great for building large custom image sets out of a mix of sources or for cherry-picking individual images from images in a category.

One thing I didn’t quite get from your description here but is made a bit clearer in the plugin docs is how the Template box works. That’s a kind of tag builder, right, that constructs a ready-populated tag for you to paste into your article’s body or excerpt field?

If you want several gallery tags in an article, I guess you use the article_image field as a kind of image-selector helper for the tag builder.

And: great to see a new official plugin from you too!

Not sure how to better translate “Fetch” in this case, I think “Consultar” is good enough, but perhaps other user will suggest you another term.

I’ll trust your judgement. Since it just grabs all images it finds in the given category or from the article field chosen, if you need inspiration for a translation, maybe ‘grab’ or ‘load’ or something like that?

or “retrieve”, “find” or perhaps “look up” …


TXP Builders – finely-crafted code, design and txp

Offline

#5 2016-10-08 12:10:43

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Re: smd_imagery: for photographers, photobloggers and category geeks

milosevic wrote #302029:

es-es text pack (Not sure how to better translate “Fetch” in this case, I think “Consultar” is good enough, but perhaps other user will suggest you another term):

¿recoger, quizá? (o recuperar)

—-
@ Bloke

Sounds like a kick-ass plugin. Not sure if it is something for me, atm – main use case for images here is 3, 4 images per (long) article. I very briefly played with so far, and will do so more, perhaps I’ll find something to enhance the articles anyway.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#6 2016-10-08 13:47:34

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_imagery: for photographers, photobloggers and category geeks

jakob wrote #302034:

great for building large custom image sets out of a mix of sources or for cherry-picking individual images from images in a category.

Exactly. I did consider allowing you to choose a category, add images to the pool from it, choose another category, add more, etc, but (at the moment at least) it will replace any images in the pool when you Fetch from another category. If you don’t categorise, you’ll find the plugin hard going!

how the Template box works. That’s a kind of tag builder, right, that constructs a ready-populated tag for you to paste into your article’s body or excerpt field?

Yup. It sticks the list of images you’ve selected (id or name) into the template in place of the chosen placeholder. So your template really can be anything: <txp:images>, <txp:image>, <txp:article-image>, <img src="...">, a macro, some lightbox, whatever you want. It just builds the output for you so, even if you don’t paste it into your article or custom fields, you can use it as an advanced image tag builder for galleries.

Replacement tags available so far:

  • {smd_imagery_list_id}: All image id values as a comma-separated list.
  • {smd_imagery_list_name}: All image names as a comma-separated list.
  • {smd_imagery_list_id_quoted}: All image id values as a quoted, comma-separated list.
  • {smd_imagery_list_name_quoted}: All image names as a quoted, comma-separated list.
  • {smd_imagery_id}: Each image id value as a separate template item.
  • {smd_imagery_name}: Each image name as a separate template item.

If you want several gallery tags in an article, I guess you use the article_image field as a kind of image-selector helper for the tag builder.

You could do that, yes.

I based the entire plugin around Ross’ workflow since it seemed logical to me:

  • Upload a truckload of related images for an event (about 200).
  • Stick them all in a category.
  • Create an article.
  • Load all the images from that category into an editable pool.
  • Cherry pick the ones to showcase, reorder them to tell a story.
  • Copy the complete tag to render them in the article body where you want them to appear, and Save.
  • … some time later… Decide you want to alter the gallery slightly. Visit article, load images from it (in the order originally presented), tweak the gallery, copy the new tag out of the builder back to your article. Save.

Loading category images into the article image field was just a starting point and an easy win for anyone who wants to use Forms to render galleries from the Article Image. If you do all your image curation outside of Txp and only upload the ones you want, in the order you want them, then that way of working saves the manual step. Just stick the category name in the Article Image field and fetch the images it contains. But as you say, it could be used as a scratchpad to get image id values that you could copy and paste into a template.

I can’t promise it’ll fit everyone’s workflow: requests for direct image upload capability and stuff like that will probably not be rolled in. But if you do have some ideas on how to refine the plugin to allow for additional functionality without breaking the core idea behind it, I’ll certainly consider it.

Perhaps the ability to recall multiple templates might be nice. A bank of ones that you’ve previously saved would mean you could quickly toggle between different types of gallery, while still keeping the most recent one preloaded on next use. Not sure how to present that in the interface and allow certain ones you’ve defined to be saved. Perhaps a select list under the template box that’ll load the selected one in, and a Save box to stash any alterations. But then you have the issue of removing ones you no longer need, creating new vs overwriting (naming them?), and reordering them in the list, which are additional UI hurdles. Ideas welcome, but I couldn’t figure it out so went with the simple option for now.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#7 2016-10-08 13:50:49

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_imagery: for photographers, photobloggers and category geeks

phiw13 wrote #302037:

main use case for images here is 3, 4 images per (long) article.

If you categorise them in your Images panel, you can then just stuff that category name into the article image field and hit Get IDs to load them in ready for your <txp:article_image> tag to take over in your Page/Forms. Saves memorising IDs and translating them into the article by hand.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#8 2017-01-28 10:04:15

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: smd_imagery: for photographers, photobloggers and category geeks

Copy the list of IDs out of the Result box and stick ‘em where you like.

Thanks Stef for this new plugin.
Is it possible to insert a button in the organizer window to automatically copy (synchronize) the field “Image Article” ?

… Or a checkbox “Synchronize the Image Article field”.

Offline

#9 2017-09-11 18:36:48

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,595
GitHub Twitter

Re: smd_imagery: for photographers, photobloggers and category geeks

Hi Stef ;)

Here is what you’re looking for:

#@smd_imagery
#@language fr-fr
smd_imagery_dialog_title => Insertion d’images
smd_imagery_fetch_btn => Rafraîchir
smd_imagery_id_btn => Obtenir l’ID
smd_imagery_image => Image
smd_imagery_opt_cat => Par type
smd_imagery_opt_fld => Selon le champ
smd_imagery_organise_btn => Sélection
smd_imagery_result => Résultat
smd_imagery_template => Modèle

Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#10 2019-07-03 17:39:32

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: smd_imagery: for photographers, photobloggers and category geeks

After upgrading a site to 4.7.x recently, the managing editor noticed that smd_insert_image was no longer working. So I swapped it out for smd_imagery.

I love it! It’s so much cleaner and better-integrated than what we had before. But the workflow is pretty different, and I was wondering if there’s an easier way to get the results we want.

The main thing we want to do is select an image that was uploaded previously and insert a tag for that image into the article—in our case, a custom tag created with smd_macro. We have some custom classes that smd_image_insert allowed us to insert using select inputs too, but it appears that this method requires the editor to just know the classes by heart.

Here are the instructions I sent the site’s managing editor yesterday. Are there alternatives that would make a simpler workflow?

Thank you for all you do, @bloke! Cheers!

Offline

#11 2019-07-03 17:45:53

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: smd_imagery: for photographers, photobloggers and category geeks

Oops, here are the instructions:

  1. Using the “Categories” panel under “Content”, create a new image category for this post; Example: 2019-07-02
  2. Using the “Images” panel under “Content”, upload the post images and tag them with the category you created for this post.
  3. Open article editor for this post.
  4. If you don’t see it already, toggle “Article image” field to visible by clicking on the heading.
  5. Select the “Manage” button under “Article Image” field.
  6. Select the radio button labeled “By category”.
  7. Select category you created for this post from first select field.
  8. Click the button labeled “Fetch” to load the images tagged with the given category.
  9. Drag and drop images to reorder them. Click the red “x” icon to remove any images you don’t want.
  10. If you don’t see it already, enter this in the “Template” field:
<notextile>
<txp:picture class="[ classes ]" image_name="{smd_imagery_name}" caption="" />
</notextile>
  1. Select and copy the text appearing in the “Result” field. Paste this into the “Body” field.
  2. Edit the class and caption attributes as needed.

Offline

#12 2019-07-04 08:51:33

ibadullah
Member
From: Kabul, Afghanistan
Registered: 2017-09-16
Posts: 49

Re: smd_imagery: for photographers, photobloggers and category geeks

Hi,
i have a news website and every day i have more then 20 news and every news have the image, it is very difficult to find out the image when searching for a particular image in the Write panel in the article image section, is the there any plugin available to show all the images as boxes and after single click the image should select in the write panel.

Last edited by ibadullah (2019-07-04 09:06:16)

Offline

Board footer

Powered by FluxBB