Fork me on GitHub

Changing styles within modules  Bottom

  • Hello,
    I've got a site I designed with Autothemes and I have a style problem. I need to know how to change the text color in a certain module. I have Module Styles active in the extras of Autothemes. Say I'm using a module like the Horoscopes module. Within my style sheet I put:

    Code

    Horoscopes {
        font-family: Geneva, Arial, Helvetica, sans-serif;
        font-size: 11px;
        font-weight: normal;
        color: #FFFFFF;
        background-color: #000000;
    }


    Figured that would work from the description given under module styles, but it doesn't do a thing. Anyone know what I'm doing wrong?
    Thanks in advance.
  • It wouldn't..... CSS is a generic web technology not a PN specific one and therefore it wouldn't know about a module. It's beyond the scope of this forum to teach CSS so I suggest that you might like to do some outside reading on CSS to get a feel for the basics. A search for 'CSS tutorial' on google would be a start.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • burbs

    Hello,
    I've got a site I designed with Autothemes and I have a style problem. I need to know how to change the text color in a certain module. I have Module Styles active in the extras of Autothemes. Say I'm using a module like the Horoscopes module. Within my style sheet I put:

    Code

    Horoscopes {
        font-family: Geneva, Arial, Helvetica, sans-serif;
        font-size: 11px;
        font-weight: normal;
        color: #FFFFFF;
        background-color: #000000;
    }


    Figured that would work from the description given under module styles, but it doesn't do a thing. Anyone know what I'm doing wrong?
    Thanks in advance.


    Yes I am familiar with this extra what it does is wraps all modules in a div with the div id being the name of the module. So for your code to work you will need to put the # in front of the module name, eg:

    Code

    #Horoscopes {
        font-family: Geneva, Arial, Helvetica, sans-serif;
        font-size: 11px;
        font-weight: normal;
        color: #FFFFFF;
        background-color: #000000;
    }


    This may work it may not - have a look at the source of your site when you are on the modules page - see if the div is wrapping the module HTML (in some cases it seems to ignore the module HTML and appear below the module HTML.

    EDIT: I'll just quickly add: If the module has tables and td's / divs with different classes they may over ride the mod specific CSS, if the bove doesn't work try this:

    Code

    #Horoscopes {
        font-family: Geneva, Arial, Helvetica, sans-serif;
        font-size: 11px;
        font-weight: normal;
        color: #FFFFFF;
        background-color: #000000;
    }
    #Horoscopes table{
        font-family: Geneva, Arial, Helvetica, sans-serif;
        font-size: 11px;
        font-weight: normal;
        color: #FFFFFF;
        background-color: #000000;
    }

    #Horoscopes div{
        font-family: Geneva, Arial, Helvetica, sans-serif;
        font-size: 11px;
        font-weight: normal;
        color: #FFFFFF;
        background-color: #000000;
    }


    That should cover it all...

    -Lobos

    --
    -Lobos
    Professional PHP Framework Services: Concept, Development and Deployment
  • Lobos,

    Thanks for stepping in. I wasn't aware that AutoTheme had an extra to implement that.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Hey Mark, No worries, I didn't know about it for a long time either - quite a good idea from Shawn - it allows you to make minor module specific text changes without the need to resort to creating a custom module template or call different stylesheets. It does however have an irritiaing little bug where sometimes it will not wrap the module HTML - instead the start and end div tagend up below the module. There is a work around however - you just put the div in the theme yourself and use the module name function as the id.

    -Lobos

    --
    -Lobos
    Professional PHP Framework Services: Concept, Development and Deployment
  • Thanks much guys, works like a charm now.
  • Lobos

    Hey Mark, No worries, I didn't know about it for a long time either - quite a good idea from Shawn - it allows you to make minor module specific text changes without the need to resort to creating a custom module template or call different stylesheets. It does however have an irritiaing little bug where sometimes it will not wrap the module HTML - instead the start and end div tagend up below the module. There is a work around however - you just put the div in the theme yourself and use the module name function as the id.

    -Lobos


    Agreed a very good idea. Xanthia has the same setup (at least will do in .760) via
    class=""> in the page templates. As an extension xanthia can also do the same for blocks
    allowing CSS to be targeted at different block types or individual blocks.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • i am having the same problem. when i do something similiar to what lobos said like:

    Code

    #Users {
       font-family: Geneva, Arial, Helvetica, sans-serif;
       font-size: 11px;
       font-weight: normal;
       color: #FFFFFF;
       background-color: #000000;
    }


    however, only the background color is changed. i cannot change the color of the text. what am i doing wrong?
  • goose, the text of what?
    your style sheet has alot of "text"
    each style sheet is different for each theme. It's hard to say. Change the colors see what happens. You'll find it
  • here is an example of what i'm talking about:
    http://www.one0one.org/Images/Hosting/text.jpg

    i want to change the white text there... that is why i tried adding the above code with "Users" hoping i could change it. thanks for the help.
  • you could make a new theme.html (placed in your theme directory) maybe theme6.html or however number it would be in sequence, and change the font for that page. Then make a custom module for NS-User and have it point to that HTML page. Im not sure if this will work, but you can try it out!
  • markwest

    Xanthia has the same setup (at least will do in .760) via
    class=""> in the page templates.


    Mark - I am actually doing something like this now - althougha bit more manually - with 750. I just create a module specific template (e.g. gallery.htm) then put in a div with an id that wraps the main content:

    Code

    <div id="gallery">
    <!--[$maincontent]-->
    </div>


    and then add the id in a nesting conifguration to the stylesheet (#gallery h1 {}) and I'm all set.

    I'll look forward to a more convenient way to do it. :)
  • Goose, as Lobos noted, the classes can cause issues with the basic Module CSS working. View source and make sure that's not the case, which it probably is.

    --
    Home Page | Find on Facebook | Follow on Twitter
  • 0 users

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