About Image Link Interceptor

Processwire Image Link Interceptor Module

Category Text Formatters
Textformatter modules that provide run-time formatting for blocks of text (typically used with Text/Textarea fields).
Release StateAlpha
Non-stable. Not yet intended for use in production environments. *
Module Version0.1.1
Class NameTextformatterImageLinkInterceptor
Compatibility2.5, 2.6, 2.7
Date AddedApril 4, 2015
Last UpdatedApril 16, 2015
Recommended ByNew recommendations may take up to 1 day to appear.


I had the common css problem of not beeing able to format a link by its children.

Thus I ended up producing a very simple Textformater that adds a class to all anchors containing an image as the first child.


This module's files should be placed in /site/modules/TextformatterImageLinkInterceptor/
How to install or uninstall modules



Processwire Image Link Interceptor Module

@copyright 2015, Roman Seidl
based on HTML Image Interceptor Textformatter @copyright 2013, Martijn Geerts
Licensed under GNU/GPL v2, see LICENSE.TXT

This module simply adds a class to all links that contain images as the first child.

Thus the following:

  <a href="/">
    <img src="/site/assets/files/1/hansi.jpg" alt="Hansi">

Should be filtered to be:

  <a class="imglink" href="/">
    <img src="/site/assets/files/1/hansi.jpg" alt="Hansi">