Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
GrooveOnBeat Posted July 24, 2016 Posted July 24, 2016 As I add conditionals in the HTML templates, is there a way to add those conditionals in the CSS files? Or conditionals can only work in HTML templates?
GrooveOnBeat Posted July 24, 2016 Author Posted July 24, 2016 7 minutes ago, Rikki said: Yes, you can use logic in CSS files I must have done it wrong then. So something like this should work? {{if \IPS\Dispatcher::i()->application->directory == 'forums' and \IPS\Dispatcher::i()->module->key == 'forums' and \IPS\Dispatcher::i()->controller == 'forums' and in_array(\IPS\Request::i()->id, array(1,2,3))}}
Rikki Posted July 24, 2016 Posted July 24, 2016 Ah, no, that won't because CSS files are compiled down when saved, so you can't write logic that depends on anything happening per-page. You can do something like this: {{if theme.rounded_photos}} ...for example.
GrooveOnBeat Posted July 24, 2016 Author Posted July 24, 2016 23 minutes ago, Rikki said: Ah, no, that won't because CSS files are compiled down when saved, so you can't write logic that depends on anything happening per-page. You can do something like this: {{if theme.rounded_photos}} ...for example. Let's say I wanted to call up CSS classes based on the page, member, member group, etc., am I then restricted within templates or blocks?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.