Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
adcantu Posted October 6, 2018 Posted October 6, 2018 Hello I am trying to create a plugin to add a country flag in the hovercard. I am using <span class="ipsFlag ipsFlag-{$country}"></span> but the flag doesn't show up. It seems that the flags.css isn't even loading. How can I have my plugin ensure that css is loaded? Also if I want to pull css from an installed app how could I make my plugin do that as well?
bfarber Posted October 8, 2018 Posted October 8, 2018 \IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'flags.css', 'core', 'global' ) );
adcantu Posted November 17, 2018 Author Posted November 17, 2018 Thanks! I'm still having issues with the css not loading. Not sure where I need to put this. I tried to hook it into includeCSS, that didn't work. I put it under the <ips:template parameters="" /> in my plugin.phtml, not working either. Any direction? {{\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'flags.css', 'core', 'global' ) );}} <span class="ipsDataItem_main"> <span class='ipsFlag ipsFlag-{expression="mb_strtolower($country)"}'></span> </span>
bfarber Posted November 19, 2018 Posted November 19, 2018 You want to put that in a backend PHP file - at the time template files are compiling it may (or may not, depending on order) be too late to define additional CSS files to load in that manner.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.