The flexifilter module is a powerful site-building tool. However, one thing that it's missing is a link component. Instead of using a link component, current flexifilters have to do complicated, slightly hackish stuff, such as prepending <a href="... etc. Instead, a link component would provide an easy, clean way of doing this.
Basic description:
Should be able to parse links in the form of either: link|title or title|link
Should not have "|" locked in as the divider; rather, it should be admin-specified.
Should be able to parse empty titles such as simply link into links such as <a href="link">link</a>
Should not attempt to make a link on an empty() link unless admin-specified.
Admin should be able to specify a prefix for the links; for example, http://en.wikipedia.org/wiki/
Deliverables:
A patch against flexifilter.components.inc.
Mentor:
cwgordon7
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | flexifilter_link_02.patch | 13.36 KB | florisla |
| #7 | export.txt | 1.54 KB | amitaibu |
| #1 | flexifilter_link_01.patch | 12.55 KB | cwgordon7 |
Comments
Comment #1
cwgordon7 commentedComment #2
amitaibuPatch fails agains 6.x-1.1-rc1:
$ patch -p0 < flexifilter_link_01.patch
patching file flexifilter.components.inc
Hunk #2 FAILED at 666.
Hunk #3 FAILED at 828.
2 out of 3 hunks FAILED -- saving rejects to file flexifilter.components.inc.rej
patching file flexifilter.flexifilters.inc
Comment #3
cwgordon7 commentedApplicable to CVS HEAD, please.
Comment #4
amitaibuMinor bug:
The delimiter doesn't appear by default.
bigger bug:
original content
--------------
[[hello|hello]]
[hello|hello]
filtered content (appears as link)
--------------
hello]]
</p> <p>[hello|hello]</p>export
-------
a:8:{s:5:"label";s:4:"Test";s:11:"description";s:11:"just a test";s:2:"id";s:1:"2";s:7:"enabled";b:1;s:8:"advanced";b:0;s:5:"delta";s:1:"1";s:10:"components";a:3:{i:0;a:3:{s:5:"class";s:26:"flexifilter_link_component";s:8:"settings";a:6:{s:8:"ordering";s:1:"0";s:7:"divider";s:1:"|";s:8:"no_links";i:0;s:10:"check_path";i:0;s:6:"prefix";s:0:"";s:4:"step";s:7:"process";}s:2:"id";s:2:"94";}s:7:"id_next";i:95;s:9:"id_prefix";s:22:"flexifilter_component_";}s:3:"fid";s:3:"new";}
Comment #5
cwgordon7 commentedYou need to wrap it within a chunk grabber for anything useful to happen. What's happening here looks like a strange combination of a naive use of flexifilter with the line break filter.
Comment #6
amitaibuThe minor bug is still there - "The delimiter doesn't appear by default" (i.e. I get a drupal error message "Divider field is required.")
Comment #7
amitaibuAnother strange issue I get, although I must admit I'm still somewhere on the learning curve of this module :)
original preview:
this is a '''test'''
Component: Linkifier:
<a href="/D6/?q=this%20is%20a%20%3Cstrong%3Etest%3C/strong%3E">this is a <strong>test</strong></a>attached flexifilter export.
Comment #8
florisla commentedAmitaibu, for #7: The double quotes around 'test' are apparently being used to give the text a bold layout using the HTML 'strong' tag. So another filter (flexifilter component?) is interfering here.
This is the explanation:
In URL encoding (used in the href), the html brackets < and > are encoded as %3C and %3E. In HTML encoding (used between the 'a' tags), they are encoded as < and >. Similarly, spaces are URL encoded as %20.
Comment #9
florisla commentedHere is a modified version of the patch in #1 above.
Changes:
Still to investigate:
This component is now in use on an experimental Drupal install of mine, using the following filter:
Comment #10
kenorb commentedComment #11
florisla commentedLet's close this tag (DROP doesn't exist anymore, and interest in this flexifilter component has faltered)