TextformatterPageImages by kixe, diogo

Allows you to insert images in a text area by referencing them with tags in the following format [[fieldName,Number,class]]. All Parameters are optional. Configurable base class and wrapper.

Textformatter Page Images

Syntax


  • includes an image-tag in the Textfield by using [[fieldname(optional),number(optional),class(optional),page-ID(optional)]]
  • if using this module Names of Imagefields shouldn't start with a number
  • If a class (CSS) is added Fieldname and/or Number and/or leading Comma is mandatory
  • Comma is mandatory from two Parameters and up

Look at the Examples for easy understanding

Examples


[[]] matches the first or only one picture in the first or only one image-field if exists
[[images]] matches the first or only one picture in the named image-field
[[4]] matches the fourth picture in the first or only one image-field
[[3,left]] matches the third picture in the first or only one image-field and adds the class left
[[,right]] matches the first or only one picture in the first or only one image-field and adds the class left
[[images,3,top]] matches the third picture in the image-field named 'images' and adds the class top
[[,,,1234]] matches the first or only one picture in the first or only one image-field of the page with ID = 1234
[[images,3,top,1234]] matches the third picture in the image-field named 'images' of the page with ID = 1234 and adds the class top

Settings


  • One or more basic classes could be added to the image tag
  • Define custom markup for wrapper. Any PageImage property surrounded by curled brackets will be replaced by the related value. Additional properties (class, index, urlSmall, urlMedium, urlLarge) available. Default markup:
<img class="{class}" src="{url}" alt="{description}"/>

Hooks


function wrapper() is hookable with instance of Pageimage as argument.

Compatibility


Works well with other text formatters such as Markdown.

Thanks


to Diogo for the nice module TextformatterImageTags which is the mother of this module.

Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Twitter updates

  • ProcessWire 3.0.182 core updates– More
    23 July 2021
  • ProcessWire 3.0.181 has fixes and improvements as usual, but the biggest addition is a nice pull request for multi-language module translations, plus major updates to our Helloworld and ProcessHello demonstration modules. This post covers it all— More
    2 July 2021
  • ProcessWire 3.0.180 core updates– More
    18 June 2021

Latest news

  • ProcessWire Weekly #376
    In the 376th issue of ProcessWire Weekly we'll cover the latest core updates, two new third party modules for ProcessWire, and more. Read on!
    Weekly.pw / 24 July 2021
  • ProcessWire 3.0.181 core updates + “Hello World”
    ProcessWire 3.0.181 has fixes and improvements as usual, but the biggest addition is a nice pull request from LostKobrakai, plus major updates to our Helloworld and ProcessHello demonstration modules. This post covers it all.
    Blog / 2 July 2021
  • Subscribe to weekly ProcessWire news

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits