-
2005-03-14
Esther
A small change that is easy to accomplish: I would like media links which are not images displayed with a file icon. I did this for my installation by adding the following line in format.php.
-----[ open file inc/format.php ]-----
-----[ search ]-----
//prepare name
if($isimg){
$link['name'] = '<img src="'.$cache.'"';
if($w) $link['name'] .= ' width="'.$w.'"';
if($h) $link['name'] .= ' height="'.$h.'"';
if($t) $link['name'] .= ' title="'.$t.'"';
if($a) $link['name'] .= $a;
$link['name'] .= ' class="'.$class.'" border="0" alt="'.$t.'" />';
}else{
-----[ insert after ]-----
$link['class'] = 'file';
-----[ open file style.css ]-----
-----[ search ]-----
/* link to some embedded media */
a.media {
color:#436976;
text-decoration:none;
}
a.media:hover {
color:#436976;
text-decoration:underline
}
-----[ insert after ]-----
/* link to embedded files */
a.file {
background: transparent url(images/file_icon.png) 0px 1px no-repeat;
padding: 1px 0px 1px 16px;
color:#436976;
text-decoration:none;
}
a.file:hover {
color:#436976;
text-decoration:underline
}
-----[ save all ]-----
-
2005-05-13
benpollinger
Nice idea, would like this too
-
2005-07-07
dminstrel
I have the latest version and can't find the format.php file. Where's that code now? How difficult would it be to be able to designate a different icon for different file formats (PDF, OpenOffice, etc.)
-
2005-07-12
tekl
I would also like to see this in a following release. Maybe for this type of media it would better not showing it's namespace. (archive.zip instead of wiki:archive.zip).
-
2005-07-12
Esther
The above code snipplet was for a previous version of DokuWiki. But I guess it wouldn't be too hard to implement this with file type specific icons according to mime.conf. The image files would have to be named <extension>_icon.gif - so for example doc_icon.gif. If no such an image is found, the generic file_icon.gif would be displayed.
If Andi thinks that this is a good idea and will take it into the main code, I will send a patch.
-
2005-07-12
andi
A patch would be welcome, but I suggest to support png and gif images (placed into lib/images/fileicons) similar to the smileys.
-
2005-07-21
tekl
Any news about this topic?