Download & Extend

Add configuration option for URL types

Project:Related links
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

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

#1

Actually, 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.

#2

This 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.

#3

Title:filtering link types?» Add configuratoin option for URL types
Version:5.x-1.0» 6.x-1.x-dev
Category:support request» feature request

#4

Title:Add configuratoin option for URL types» Add configuration option for URL types