Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthoralast
    • CommentTimeApr 19th 2007
     # 1
    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'?..
    •  
      CommentAuthorbjrn
    • CommentTimeApr 19th 2007
     # 2
    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.
    •  
      CommentAuthorMr Do
    • CommentTimeApr 19th 2007 edited
     # 3
    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
    •  
      CommentAuthoralast
    • CommentTimeApr 19th 2007
     # 4
    @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
    :)
    •  
      CommentAuthorbjrn
    • CommentTimeApr 19th 2007
     # 5
    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.
    •  
      CommentAuthoralast
    • CommentTimeApr 19th 2007
     # 6
    thanks again. try both
    •  
      CommentAuthoralast
    • CommentTimeApr 19th 2007
     # 7
    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?
    •  
      CommentAuthorMr Do
    • CommentTimeApr 19th 2007
     # 8
    you have to use the correct php file. my comments.php is just an example
    •  
      CommentAuthoralast
    • CommentTimeApr 19th 2007 edited
     # 9
    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
    :)
Add your comments
    Username Password
  • Format comments as