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. *
Authorrot
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.

Details

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.

Instructions

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

README

TextformatterImageLinkInterceptor

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="//dwiwkfc06fegq.cloudfront.net/assets/files/1/hansi.jpg" alt="Hansi">
  </a>

Should be filtered to be:

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

Comments

No comments yet. Be the first to post!

Post a Comment

Your e-mail is kept confidential and not included with your comment. Website is optional.