londoh VIP
Total posts: 137
21 Sep 2013 15:39

if the 'nofollow' filter param is set then multiple rel attributes are set in filter link. rel="tooltip" and rel="nofollow"

AFAIK multiple rel attributes arent allowed, but multiple values within a single rel are ok

multiple rel's means html doesnt validate, but worse; it seems one or the other of the rel's isnt acknowledged.

a typical link with problem looks like this:

<a class="filter-link" rel="nofollow" href="/?task=records.filter&filter_name[0]=filter_8&filter_val[0]=12345&section_id=1&cat_id=20" rel="tooltip" data-original-title="Show all records where <b>Postcode</b> is equal to <b>12345</b>">12345</a>

Below is a suggestion for a fix for filter.php to combine rel values.

Please include this or some other fix.

    public static function filterLink($name, $value, $text, $type, $tip = NULL, $section)

    {

        $url = 'task=records.filter';

        if($type && count($section->params->get('general.type')) > 1)

        {

            $url .= '&filter_name[1]=filter_type';

            $url .= '&filter_val[1]=' . $type;

        }

        $url .= '&filter_name[0]=' . $name;

        $url .= '&filter_val[0]=' . urlencode($value);

        $url = self::url($url, $section);

        $rel = '';

        if(JComponentHelper::getParams('com_cobalt')->get('filter_nofollow', 1))

        {

            $rel = 'rel="tooltip nofollow"';

        }else{

            $rel = 'rel="tooltip"';

        }

        $patern = '<a class="filter-link" %s href="/%s" ' . $rel . '>%s</a>';

        return sprintf($patern, ($tip ? ' data-original-title="' . htmlspecialchars($tip, ENT_COMPAT, 'UTF-8') . '"' : NULL), JRoute::_($url), $text);

    }

Last Modified: 02 Mar 2014


Sergey
Total posts: 13,748
23 Sep 2013 03:44

Thank you. Added.

Powered by Cobalt