Linker
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Component created
Component changed
Component body
Adds metadata (size and filetype) and useful formatting to inline links to files and images.
Enhance file download links
Turns a link like [read this document]
into something like [read this document (report.pdf - PDF; 1.5M)]
This is recommended or required by a number of Web Standards Usability Guidelines,
such as those of the United Nations or New Zealand Government
This attempts to meet WAI 11.3 ("Provide information so that users may receive documents according to their preferences")
Enhance inline images
Turns simple embedded images into styled items, linked to the larger size, and annotated with a title or caption pulled from the database.
This makes it easier for an editor using a limited WYSIWYG tool to just embed small image derivates directly, and have the system look after the technical housekeeping automatically and consistently.
Explanation and motivation
A write-up on why this is useful and what it does is included in the docs.


Usage
This is a text filter so to enable it, admin the Formats at/admin/config/content/formats
Enhance file download links
There, enable "Enhance inline links (linker)"
This filter should usually be run AFTER "Convert URLS into links"
and AFTER "Correct URLs with Pathologic" (if used).
To enable file link enhancement, select "Lookup file info" in the
"Filter settings"
Additional formatting settings are available:
-
The "Themable" version will give you a file type icon,
but not size by default - though this can be added by your themer. -
The custom "Tokens" version gives you full control of the markup and lets
you choose the order etc of the icon, size, type, title and wrapper markup. -
"View mode" is available only if you are using
file_entity.moduleand
integrates withmedia.module.
You can choose any managed "view mode" to embed
... though that's often overkill for inline text, it's powerful, and can
help if you want to really manage your versioned documents by pointing
users to the placeholder page for copyright or versioning info..
Enhance inline images
A simple WYSIWYG tool will let you embed images into your page.
A sensible editor will ensure that they use the generated 'medium' or 'small' image style or whatever is appropriate - not the 'original' most of the time. But it's nice to link to the original usually, it would be really good to add the caption and alt text automatically, and maybe extra markup or styles would be appropriate also.
When you enable the option "Add anchor links to embedded images (Linker)" in your input format, it will will:
- Detect simple inline images in the HTML
- Look up the database to find their original versions and metadata
- Add a 'link' around the img to make it clickable, linking to the larger screensize
- Add the title text that is the img caption
- Add some css classes that can add styles or behaviours
See Also
Other tools, notably insert.module
media.module do this job *better* and may be useful for new development.
They are recommended!
However, they require you to use that tool from the start, and all the time, as their markup is idiosyncratic.
The "Linker" module will simply enhance *existing* stable content with a better presentation and behaviour, and works on valid round-trip HTML, compatible with content written ten years ago and ten years into the future.
Insert.module
WYSIWYG (and html) plugin to add links to attached file fields into your text.
A UI helper that embedded markup direct into your content, not a filter or enhanecr.
Inline.module
An older token-based filter that would help embed links to attached files.
Focused on images, and overtaken in D6 by img_assist and more.
https://drupal.org/project/inline
