Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

just a bit of presentation luxury?

edited April 2007 in Vanilla 1.0 Help
i think there should be a way of toggling themes between pages? say, you use the 'blackdiamond' as your main theme but want the comments page to appear in 'blackandwhite'?..

Comments

  • Options
    First off, just a bit of pedantry. Themes are the things which change the markup ((X)HTML), styles are the things that change the presentation (CSS+images).

    Anyway, if you want different styles for different pages, the best way would probably be to get the parts of each style you want, and put them into a new one. Every page has its own class in the body tag. For instance, the comment pages have CommentsPage, the accounts page has AccountPage and so on. So it shouldn't be too hard to merge two styles, and make sure they're only applied to the right pages.
  • Options
    edited April 2007
    you could probably do something like this: if ($Context->selfUrl == "comments.php") { $Context->Head->ClearStyles(); $context->Head->AddStyleSheet( [.. style you want .. ] ); }
    You obvisouly have to repeat the addstyle for each style that you need, this may be more than just your theme. And also repeat the entire if sentence per page that is to get an exception. I hope this helps. Look here for documentation: Head class
  • Options
    @bjn: yes, thanks, styles are styles and themes are themes. right:)
    as for the pages-solution, then what about the body-background and the panel?
    @ MrDo - thanks, i'll try that
    :)
  • Options
    Mr Do's solution might be the easiest.

    I hadn't really thought of the panel, but I guess you'd take all #Panel styles from blackdiamond and change #Panel into .DiscussionsPage #Panel and the #Panel things from blackandwhite, and change those into .CommentsPage #Panel. That way they'd only be parsed on the right page. But as I said, Mr Do's solution might be easier, since it would save you digging through the styles, and would be super upgrade-proof as well.
  • Options
    thanks again. try both
  • Options
    nope, doesn't seem to work this way so far. maybe it's because the url that is being called is never actually the "comments.php" one?
  • Options
    you have to use the correct php file. my comments.php is just an example
  • Options
    edited April 2007
    ok, done it. but by putting if ($Context->selfUrl == "comments.php") { $Context->Head->ClearStyles(); } <link rel="stylesheet" type="text/css" href="/forum/themes/vanilla/styles/blackandwhite/" media="screen" /> into the head tag through Nuggets (while making it available in Post Comment and Cooments List only). perhaps , i was putting in the last line wrongly ptherwise? PS: in fact, putting in just smth like: <script> ClearStyles(); </script> followed by the link to the needed style and then indicating the pages to which this should be applied is quite enough. the rest Nuggest handle beautifully :)
This discussion has been closed.