Hi all,

My icons have imported ok as you can see here

If I look at the page source for this page I can see <span title="home" class="icon icomoon icon-home" aria-hidden="true"></span>

If I use this same code on my test page I can see the code in firebug but no icons are displayed.

Any ideas please what I am missing?

Thanks...

Comments

markhalliwell’s picture

Title: Icons not displaying » Icons not showing when CSS is aggregated
Project: Icomoon » Icon API
Version: 7.x-1.0 » 7.x-1.x-dev
Category: Support request » Bug report

I appears that aggregation could be the reason. It's likely that we need to introduce a parser to rewrite resource paths so they're absolute.

It would work if http://ico-test.desertfish.co.uk/sites/ico-test.desertfish.co.uk/files/i... were instead of just starting with: url('fonts/..');

@font-face {
	font-family: 'icomoon-hop';
	src:url('http://ico-test.desertfish.co.uk/sites/ico-test.desertfish.co.uk/files/icon/icomoon/icomoon_hop/fonts/icomoon-hop.eot?r9qht5');
	src:url('http://ico-test.desertfish.co.uk/sites/ico-test.desertfish.co.uk/files/icon/icomoon/icomoon_hop/fonts/icomoon-hop.eot?#iefixr9qht5') format('embedded-opentype'),
		url('http://ico-test.desertfish.co.uk/sites/ico-test.desertfish.co.uk/files/icon/icomoon/icomoon_hop/fonts/icomoon-hop.woff?r9qht5') format('woff'),
		url('http://ico-test.desertfish.co.uk/sites/ico-test.desertfish.co.uk/files/icon/icomoon/icomoon_hop/fonts/icomoon-hop.ttf?r9qht5') format('truetype'),
		url('http://ico-test.desertfish.co.uk/sites/ico-test.desertfish.co.uk/files/icon/icomoon/icomoon_hop/fonts/icomoon-hop.svg?r9qht5#icomoon-hop') format('svg');
	font-weight: normal;
	font-style: normal;
}
markhalliwell’s picture

Status: Active » Postponed (maintainer needs more info)

Actually, core's CSS aggregation should be parsing this already: drupal_build_css_cache(), which calls _drupal_build_css_path().

I was taking a closer look at view-source:http://ico-test.desertfish.co.uk... it doesn't appear that the CSS is being loaded at all. Are you using the icon_filter module? Do you have it enabled for that text format? Are you using the icon tag: [icon:icomoon_hop:home] or are you simply putting in the raw HTML?

juc1’s picture

@ Mark Carver thanks for your help. I have added a screenshot (yellow border) of my edit page.

The icon tag and raw HTML seem to give the same result = clear all caches and the icons display ok. Reload the page and they do not display.

"Aggregate and compress CSS files" at /admin/config/development/performance does not seem to make any difference to this behaviour. "Aggregate and compress CSS files" checked is here, "Aggregate and compress CSS files" unchecked is here.

Any ideas please?

markhalliwell’s picture

Are you sure you're actually using the latest dev release of Icon API?

I committed the fix for fields which isn't in a stable release at the moment
https://drupal.org/comment/8514357#comment-8514357

This issue is probably a duplicate of the related issue.

juc1’s picture

No I didn't realise I was supposed to be using the dev release - anyway the dev release seems to fix the issue so thank you :)

markhalliwell’s picture

Title: Icons not showing when CSS is aggregated » Icons not showing
Status: Postponed (maintainer needs more info) » Closed (duplicate)