Fork me on GitHub

Loading a differnt theme style based on module .764  Bottom

  • Hello-

    I'm using travelouge theme on .764 and have a probably really easy question but I caouldn't locate the answer searching. It's a hard thing to search on anyways...

    I want to either change the theme entirely or at least the CSS referenced if a particular module is loaded. Something like this (and I thought I saw this in pn.8 but not sure):

    if $module = 'TheGate' {
    use this template = "thegate.htm"; }

    I a total noob whit Smarty and PHP so don't laugh. I think you get the point. Anyways, any help would be appreciated.
  • well, for a Xanthia template you could use

    Code

    <!--[if $module == "TheGate"]-->
     link rel="StyleSheet" href="css/theGate_layout.css" type="text/css" />
    <!--[else]-->
     link rel="StyleSheet" href="css/normal_layout.css" type="text/css" />
    <!--[/if]-->

    In Xanthia you can assign template to a module, I have only done this once, so I don't remember.... icon_smile


    perhaps this works too [never done this]:

    Code

    <!--[if $module == "TheGate"]-->
     <!--[include file="theGate.htm"]-->
    <!--[else]-->
     <!--[$maincontent]-->
    <!--[/if]-->


    - Igor
  • Even easiest if you learn how to assign a specific template to your modules at the Xanthia Admin Panel, in the Edit theme options. You can clone your master.htm (in example), rename it to thegate.htm and assign it to TheGate module.

    No conditionals needed with this assignment method.

    And EVEN EASIEST with 0.8. Just an addition in your theme's pageconfiguration.ini:
    [TheGate]
    file = thegate.ini

    and in the thegate.ini:
    page = thegate.htm
    palette = yourpalette

    [blocktypes]

    [blockpositions]

    [blockinstances]


    Good luck with that ;)

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Thanks so much for your suggestions, I will try this and report back for future searching :)
  • I tried using Xanthia to assign thegate.htm to the module but couldn't seem to get that working so...

    I edited my master.htm to say..

    Code

    <!--[if $module == "TheGate"]-->
    <!--[include file="TheGate.htm"]-->
    <!--[else]-->


    Then I put in the master htm stuff then at the end did the

    Code

    <!--[/if]-->


    Then I made thegate.htm just replace the changes in the else from master.htm

    Then called those changes in the CSS for the newly created header images, etc.

    It worked beutifully. Thanks for the help guys.
  • jaenosjelantru

    I tried using Xanthia to assign thegate.htm to the module but couldn't seem to get that working so...

    I edited my master.htm to say..

    Code

    <!--[if $module == "TheGate"]-->
    <!--[include file="TheGate.htm"]-->
    <!--[else]-->


    I agree this will work... but it is defeating what Xanthia does already. Are your module templates initialized?

    Anyway, here is a neat trick you can use for stylizing module stuff through the master.htm.

    Code

    <div id="<!--[module]-->

    You can use any element body, div, span, ect. and just assign the module as the id. Then reflect any change you need in your style.css.





    --
    David Pahl
    Zikula Support Team
  • Of course you could also apply this logic to a style sheet filter... ect. pnRender and CSS are awesome this way..


    --
    David Pahl
    Zikula Support Team
  • So what might you do here if you wanted to apply this to the news modules.

    I want to change the banner if I'm on one specific topic of the news module. I did the following

    Code

    <!--[if $module == "News" && $topic == "1"]-->
    <h1 id="blogheader"></h1>
    <!--[else]-->
    <h1 id="header"></h1>
    <!--[/if]-->


    But this doesn't seem to work. I I take out the topic it works ok.

    Thanks
    Jason
  • You can always use <!--[pndebug]--> to see the loaded variables.


    In this case, the $topic vas is a module specific variable, and it's assigned after the Theme templates are already loaded, so, you need to get the topic value from the input before use it in Theme templates. Something like:


    Code

    <!--[pnvarcleanfrominput name="topic" assign="topic"]-->
    <!--[if $module eq "News" and $topic eq 1]-->
    ...



    Try that icon_wink

    --
    - Mateo T. -
    Mis principios... son mis fines
  • I did it something like that. I was able to find a subvariable for the topic in the $info variable with . I have to say that's a very handy tool.

    Jason

This list is based on users active over the last 60 minutes.