When only icon_filter is used, icons are displayed correctly only directly after clearing cache, when I reload page, icons disappear (the css files are not loaded). When some of other modules (ex. icon_block) are enabled and icon is added to menu or block title, all is ok with icon_filter module too.

Comments

dw72’s picture

Priority: Normal » Major
markhalliwell’s picture

Hmm, sorry for not responding right away. I've been looking into this though and this isn't going to be an easy fix. Not sure exactly the best approach for this. I'm thinking that I'll probably have to end up creating a {cache_icon_filter} table to coincide with the {cache_filter} table and then somehow figure out a way to inject the necessary resources when that particular field is used.

markhalliwell’s picture

Issue summary: View changes

Clarification of text

zilla’s picture

i was going to ask a separate question but instead will ask here because i wonder if this may be an easier way to manage insertion in text.

right now, i use span class in a text area to place a glyphicon (and it resizes correctly on devices, etc) by using the code
<span class="glyphicon glyphicon-bullhorn"></span>

however, if i'm using fontalla font awesome and i've named it "fontella font awes" - then could this support a placement in a similar way, like:

<span class="fontella fontawes fontawesome-bullhorn"></span>

do i need_an_underscore? or a different name on the second part, like just the the icon, as in:

<span class="fontella_fontawes-bullhorn"></span>

vlooivlerke’s picture

Hi, I dont know if this is the right place but I am having a very wierd experience with the icon api. This is how i reproduce the disappearing act.

First I installed some fontello icons that work.

Then I add an icon field to taxonomy and edit a few terms and assign icons to them.

Now i create a view with a simple navbar with icons.

If i display the navbar and the taxonomy icons on the same page all icons are visable.

But here is the bug. if i go to a page where only the nav bar is showing the icons in the navbar disappear. It is as if the icon display from icon fields is assisting in the load of all icons on the page. but if you just want to show <i class="icon fontello icon-flag" aria-hidden="true"></i> in a text area or view header it will not load.

Any idea? Or am I doing someting wrong

cimo75’s picture

Issue summary: View changes

Hi, I can see the same behavior as in the original post, is there any advance on this one?
tx

peacog’s picture

I got around the problem by including the font stylesheet in my theme. I added it to my theme .info file, like this:

stylesheets[all][] = ../../files/icon/fontello/myfontpack/css/myfontpack.css

You could also do it using drupal_add_css() in hook_init() in a custom module, or in a preprocess hook.

markhalliwell’s picture

Status: Active » Fixed

Committed 6c7cfd4 to 7.x-1.x:

Issue #2070095 by Mark Carver | dw72: Icons is not displayed when using only icon_filter.

You can apply a patch from here: http://drupalcode.org/project/icon.git/patch/6c7cfd4

cimo75’s picture

Hi I ve applied the patch but the behavior is the same: icons appear upon clearing the cache then css is not loaded anymore.

markhalliwell’s picture

Where are you inserting the text? Icon filter would really only apply to fields, so I'm not sure how this isn't working unless you're manually inserting text somewhere that isn't a field.

cimo75’s picture

I am using the tokens in a block body.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jbrauer’s picture

Status: Closed (fixed) » Active

Reopening as I'm seeing the behavior in #8 ... the font and style sheet are included on the first page load after cache clear but not again until the next cache clear.

The filter in my case is applied to the text in a block placed in the footer region.

(If you'd rather I'd be happy to open as a separate issue if it should be)

markhalliwell’s picture

Yes it should be open. I meant to respond and then it automatically closed and I forgot about it for a while.

I did look into this before and the problem lies in core and the block module, specifically _block_render_blocks() and check_markup() and how they handle caching of data.

I really don't have a solution for this and kind of low on my priorities ATM. The only thing I remember thinking before was somehow preprocessing the view content on the theme level, but that would be really expensive I think. Plus it would already be the rendered markup (not the filter tag) that would need to be extracted. Not entirely sure the bundle and icon names could be extracted to attach the necessary resources.

To get something working, the easiest way to ensure that the resources are loaded is to add a preprocess function for the block in question (or the page since this is the footer) and manually invoke:

$bundle = icon_bundle_load('bundle_name');
icon_process_attached($bundle);
jbrauer’s picture

Thanks that works better than the hack I had... Maybe a crude but effective means would be a checkbox on each bundle to "force to be included on all pages" and then a preprocess page function in the module...

  • Commit 6c7cfd4 on 7.x-1.x, icon_tabs-integration by Mark Carver:
    Issue #2070095 by Mark Carver | dw72: Icons is not displayed when using...
mr.alinaki’s picture

Still not working in latest -dev...

  • markcarver committed 6c7cfd4 on 8.x-1.x
    Issue #2070095 by Mark Carver | dw72: Icons is not displayed when using...
skin’s picture

Still not working.

mspirit’s picture

Still not working for me too