Loading...
 
Skip to main content

External link icon should be a CSS class

Status
Closed
Subject
External link icon should be a CSS class
Version
5.x
Category
  • Feature request
  • Less than 30-minutes fix
Feature
Wiki Syntax (text area, parser, external wiki, etc)
Resolution status
Fixed or Solved
Submitted by
jacmoe
Volunteered to solve
jacmoe
Lastmod by
jacmoe
Rating
(0)
Description

In tikilib.php, the external link icon is hardcoded:

Copy to clipboard
if ($prefs['feature_wiki_ext_icon'] == 'y' && !$options['suppress_icons']) { $ext_icon = "<img border=\"0\" class=\"externallink\" src=\"img/icons/external_link.gif\" alt=\" (external link)\" />"; }


That is not good if you want that icon to be different.
You have to overwrite img/icons/external_link.gif with your own, and remember to re-overwrite it when updated to a new Tiki.

It would be better to either allow the user/admin to give a link to an alternative icon, or even better: put it in CSS, so that it can be overwritten in themes.

A quick fix would be to change line 5806 and line 6245 from this:

Copy to clipboard
$ext_icon = "<img border=\"0\" class=\"externallink\" src=\"img/icons/external_link.gif\" alt=\" (external link)\" />";

to this:

Copy to clipboard
$ext_icon = "<span class=\"externallink\">   </span>";

And then put a CSS class in design.css or other appropriate css file, so that it can be overridden by theme css:

Copy to clipboard
.externallink { background: url(img/icons/external_link.gif) no-repeat; }
Solution

In the end, I just added a new preference variable: external link icon source.
Much better solution, IMO.

Fixed by revision: 26985 (trunk)

Importance
5
Easy to solve?
8
Priority
40
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
3170
Created
Friday 07 May, 2010 19:57:53 UTC
by jacmoe
LastModif
Saturday 08 May, 2010 00:43:35 UTC


Show PHP error messages