Active
Project:
Related links
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Aug 2007 at 02:44 UTC
Updated:
11 Dec 2010 at 06:04 UTC
Is there a built in way of filtering links? For example, I don't want mailto links showing up in the parsed links. I made a quick hack in _relatedlinks_filter to do this but it really should be a config option:
function _relatedlinks_filter($links) {
$urls = array();
$url_cache = array();
foreach ($links as $link) {
if (!in_array($link['url'], $url_cache)) {
becomes
function _relatedlinks_filter($links) {
$urls = array();
$url_cache = array();
foreach ($links as $link) {
// kjh: added filter of mailto links
if (!in_array($link['url'], $url_cache) && !preg_match('/^mailto:/i', $link['url'])) {
Comments
Comment #1
bwong commentedActually, a more general approach would be useful. It would be handy to filter by link class. Likewise, I need to trim some links that are very long that also include . Right now I use a similar hack.
Comment #2
usera commentedThis is useful but also there should be some node override on the content type. Sometimes you do not want parse links displayed on 1 or 2 content items in a content type but that cannot be controled as it's listed only on the module configuration. Maybe limit it only to admins.
Comment #3
Zen commentedComment #4
Zen commented