An additional outputfilter that enhance file and image links informations in rich text
Project description
==============================================================================
collective.outputfilters.enhancelinks
==============================================================================
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**
Features
--------
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
Installation
------------
Install collective.outputfilters.enhancelinks by adding it to your buildout::
[buildout]
...
eggs =
collective.outputfilters.enhancelinks
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::
<adapter
for="your.package.interfaces.IYourContent"
provides="collective.outputfilters.enhancelinks.interfaces.ILinkEnhancerProvider"
factory=".adapters.YourContentEnhanceLink"
/>
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.
__ http://pypi.python.org/pypi/collective.mtrsetup
Contribute
----------
- Issue Tracker: https://github.com/PloneGov-IT/collective.outputfilters.enhancelinks/issues
- Source Code: https://github.com/PloneGov-IT/collective.outputfilters.enhancelinks
Compatibility
-------------
This product has been tested on:
* Plone 4.2
* Plone 4.3
It works with Archetype-based and Dexterity-based (`plone.app.contenttypes`__)
standard File and Image content-types.
__ http://pypi.python.org/pypi/plone.app.contenttypes
License
-------
The project is licensed under the GPLv2.
Credits
-------
Developed with the support of:
* `Regione Emilia Romagna`__
All of them supports the `PloneGov initiative`__.
__ http://www.regione.emilia-romagna.it/
__ http://www.plonegov.it/
Authors
-------
This product was developed by RedTurtle Technology team.
.. image:: http://www.redturtle.it/redturtle_banner.png
:alt: RedTurtle Technology Site
:target: http://www.redturtle.it/
Contributors
============
- RedTurtle Technology, sviluppoplone@redturtle.it
Changelog
=========
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.
[cekk]
0.1.2 (2015-12-09)
------------------
- Fix additional infos position when a link has some children (for example a span)
[cekk]
0.1.1 (2015-12-03)
------------------
- Handled UnicodeDecodeError in Transform
[cekk]
0.1.0 (2015-12-02)
------------------
- Initial release.
[cekk]
collective.outputfilters.enhancelinks
==============================================================================
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**
Features
--------
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
Installation
------------
Install collective.outputfilters.enhancelinks by adding it to your buildout::
[buildout]
...
eggs =
collective.outputfilters.enhancelinks
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::
<adapter
for="your.package.interfaces.IYourContent"
provides="collective.outputfilters.enhancelinks.interfaces.ILinkEnhancerProvider"
factory=".adapters.YourContentEnhanceLink"
/>
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.
__ http://pypi.python.org/pypi/collective.mtrsetup
Contribute
----------
- Issue Tracker: https://github.com/PloneGov-IT/collective.outputfilters.enhancelinks/issues
- Source Code: https://github.com/PloneGov-IT/collective.outputfilters.enhancelinks
Compatibility
-------------
This product has been tested on:
* Plone 4.2
* Plone 4.3
It works with Archetype-based and Dexterity-based (`plone.app.contenttypes`__)
standard File and Image content-types.
__ http://pypi.python.org/pypi/plone.app.contenttypes
License
-------
The project is licensed under the GPLv2.
Credits
-------
Developed with the support of:
* `Regione Emilia Romagna`__
All of them supports the `PloneGov initiative`__.
__ http://www.regione.emilia-romagna.it/
__ http://www.plonegov.it/
Authors
-------
This product was developed by RedTurtle Technology team.
.. image:: http://www.redturtle.it/redturtle_banner.png
:alt: RedTurtle Technology Site
:target: http://www.redturtle.it/
Contributors
============
- RedTurtle Technology, sviluppoplone@redturtle.it
Changelog
=========
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.
[cekk]
0.1.2 (2015-12-09)
------------------
- Fix additional infos position when a link has some children (for example a span)
[cekk]
0.1.1 (2015-12-03)
------------------
- Handled UnicodeDecodeError in Transform
[cekk]
0.1.0 (2015-12-02)
------------------
- Initial release.
[cekk]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for collective.outputfilters.enhancelinks-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55cbf70d90032f9b623f0ed385a3e599953801cc8821856b926161e7be1d8dc9 |
|
MD5 | 5ec585498966d26ffa999b6dbeca4e9c |
|
BLAKE2b-256 | 3f1cf48a9c39ac1c5e03ec46c1b303daa57b1d04a2a2f8f052929ed023dc205b |