Skip to main content

An additional outputfilter that enhance file and image links informations in rich text

Project description


.. image::

This product add a new outputfilter that generates additional informations for
Tiny MCE's internal link.

It's a substitute of `collective.tinymceplugins.advfilelinks`__,
that doesn't work with Plone >= 4.3 because it uses Products.TinyMCE >= 1.3.

.. contents:: **Table of contents**

For every link that points to an internal content (file or image),
in the rendered html will be added some new informations:

- The mimetype icon before the link text
- The mimetype and filesize after the link text
- The url of a File points to the direct download


Install collective.outputfilters.enhancelinks by adding it to your buildout::



eggs =

and then run "bin/buildout".

It doesn't need to be installed.

Extending content-types

This product is modular, so if you want to add this feature (or more features)
to some custom content-types you only need to provide a new adapter for the ``ILinkEnhancerProvider`` interface::


Then provide the Python adapter code::

from collective.outputfilters.enhancelinks.adapters import BaseEnhanceLink

class YourContentEnhanceLink(BaseEnhanceLink):

There are 4 basic methods for a basic override::

def get_url_suffix(filename):
""" Return additional suffix to append at the end of the url """

def get_icon_url(mime_infos):
""" Return the correct mimetype icon url """

def get_extension(content_file, mime_infos):
""" Return the filename extension"""

def get_formatted_size(content_file):
""" Return a formatted file size """

Additional mimetype icons
If you want more mimetype icons (for example for OpenOffice documents),
you could add and install `collective.mtrsetup`__ in your buildout.



- Issue Tracker:
- Source Code:


This product has been tested on:

* Plone 4.2
* Plone 4.3
* Plone 5.0
* Plone 5.1

It works with Archetype-based and Dexterity-based (``__)
standard File and Image content-types.



The project is licensed under the GPLv2.


Developed with the support of:

* `Regione Emilia Romagna`__

All of them supports the `PloneGov initiative`__.



This product was developed by RedTurtle Technology team.

.. image::
:alt: RedTurtle Technology Site


- RedTurtle Technology,


0.4.4 (2018-02-06)

- Better unicode/decode error handling
- Don't enhance links with "@@download" if already present in the href attribute
to avoid duplication

0.4.3 (2018-01-29)

- Use set() to remove duplicated entries in link detection

0.4.2 (2018-01-29)

- Fix xpath filter to get all old-style internal-links

0.4.1 (2017-12-18)

- Fixed unicode.

0.4.0 (2017-12-11)

- Add support for Plone5

0.3.0 (2017-01-26)

- Parse only links with `internal-link` class

0.2.1 (2016-12-21)

- Handle problems with malformed html that etree are unable to parse.
Transformation is skipped and a warning log message is send.

0.2.0 (2016-12-14)

- Avoid etree.tostring to auto close empty divs with `method="html"` parameter.
This prevents some problems with browsers that don't like self-closed div
and renders a wrong html.

0.1.2 (2015-12-09)

- Fix additional infos position when a link has some children (for example a span)

0.1.1 (2015-12-03)

- Handled UnicodeDecodeError in Transform

0.1.0 (2015-12-02)

- Initial release.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
collective.outputfilters.enhancelinks-0.4.4.tar.gz (36.7 kB) Copy SHA256 hash SHA256 Source None Feb 6, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page