Posted July 24, 20168 yr 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?
July 24, 20168 yr Author 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))}}
July 24, 20168 yr 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.
July 24, 20168 yr Author 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?
Archived
This topic is now archived and is closed to further replies.