icons

1 view
Skip to first unread message

Alan Mask

unread,
Mar 31, 2008, 3:08:33 PM3/31/08
to FacBackOPAC
I've worked on FBO since one of Mikes presentations last year. After
a bit of a work slowdown, I've come back to work on it.

Mike suggested I post to this group regarding my current problem. I
recently upgraded to the latest version. I can't, however, get my
icons to display. here is the breakdown:


From Config.py:

'Book' : '<img src="http://public.wartburg.edu/library/art/opac/ipac-
icon-book.gif/ipac-icon-book.gif" alt="book" />'


FBO (where icon would be) i see this:

<img src="http://public.wartburg.edu/library/art/opac/ipac-icon-
book.gif/ipac-icon-book.gif" alt="book" />



View source (FBO):

</td>
<td align="right">&lt;img src=&quot;http://public.wartburg.edu/
library/art/opac/ipac-icon-book.gif/ipac-icon-book.gif"
alt=&quot;book&quot; /&gt;</td>
</tr>

Appreciate any thoughts.

Alan

Gabriel Sean Farrell

unread,
Apr 1, 2008, 6:36:26 PM4/1/08
to facba...@googlegroups.com
On Mon, Mar 31, 2008 at 3:08 PM, Alan Mask <aam...@gmail.com> wrote:
> Mike suggested I post to this group regarding my current problem. I
> recently upgraded to the latest version. I can't, however, get my
> icons to display. here is the breakdown:
[snip]

> View source (FBO):
>
> </td>
> <td align="right">&lt;img src=&quot;http://public.wartburg.edu/
> library/art/opac/ipac-icon-book.gif/ipac-icon-book.gif"
> alt=&quot;book&quot; /&gt;</td>
> </tr>

The more recent versions of Django do autoescaping of template
variables -- looks like that's your trouble. How recently did you
upgrade? Revision 143 of FBO, from about a month ago, sends the
doc.format_icon_url through the "safe" filter, and should solve your
problem.

In the move toward a CSSZenOpac-type FBO I want to change the current
situation, though, in that I'd rather handle icons in the CSS instead
of a config file. As it is now, we've got:

# discovery/config.py
FORMAT_ICONS = { 'eAudio' : '<img
src="http://catalog.spl.org/hipres/images/formaticons/ipac-icon-eaudio.gif"
alt="eAudio" />',
...
}

# discovery/templates/search.html
<td align="right">{{ doc.format_icon_url|safe }}</td>

I'd rather have something like:

# discovery/templates/search.html
<div class="{{ doc.format }} format"><span>{{ doc.format }}</span></div>

# media/001/001.css
.format span {
display: none;
}
.eAudio {
background-image:
url(http://catalog.spl.org/hipres/images/formaticons/ipac-icon-eaudio.gif);
}
...

It's a little more verbose, but it allows the icons to change from
stylesheet to stylesheet. And we don't run into these templating
issues.

Reply all
Reply to author
Forward
0 new messages