Module Suffix Class use to change text-align in some modules

575 views
Skip to first unread message

Duane Mitchell

unread,
May 3, 2011, 11:39:31 PM5/3/11
to Gantry Framework for Joomla Users
I'm using the standard Gantry theme, rt_gantry. I want to center the
h2 title in the feature-a module. I'm thinking the best way to do it
is to use a Module Suffix Class. I can't figure how to do that. I can
get all the text in the module to center but I just want the title.
I'm confused as to where to put the over ride. I don't know whether it
goes in the template.css, the gantry.css, or the style1.css. (I'm
using the style1 option.)

In the module itself I have tried both "_centerheading" and "
centerheading". That's no-space and with a space.

I can see changes using the style1.css. If I put ".centerceading {text-
align: center;}" in the css it will change all the text but all I want
to center is the h2 title. If I add ".title {text-align: center;}" to
the css then just the module title is centered but the all module
titles are centered.

Can someone share a few lines of code to help me sort this out?

Thanks.

Duane Mitchell

Grant Preston

unread,
May 3, 2011, 11:54:07 PM5/3/11
to gantry-framework...@googlegroups.com
Hi Duane,

I'm not a pro at CSS yet but I think you are on the right track and I believe you pair the two together and you'd probably make these changes in the style1.css file if that is what you are using. So if I have this correct you would put something like .title .center_heading {text-align: center;}
And then add .center_heading as your Module Suffix Class. Give that a try and again I am still learning CSS but i'm fairly certain it is that or something close to it because you are wanting to affect only the ones that have both classes involved which you can then specify by adding the suffix.

If I am off on this can someone please correct me.

Best...

> --
> You received this message because you are subscribed to the Google
> Groups "Gantry Framework for Joomla Users" group.
> To post to this group, send email to
> gantry-framework...@googlegroups.com
> To unsubscribe from this group, send email to
> gantry-framework-for-j...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/gantry-framework-for-joomla-users?hl=en
>
> Gantry Framework Homepage: http://www.gantry-framework.org

all80

unread,
May 4, 2011, 3:56:14 AM5/4/11
to Gantry Framework for Joomla Users
try:
.centerheading h2 {text-align: center}

This will center only the H2 heading and not the rest of the module.


Mark

Duane Mitchell

unread,
May 4, 2011, 7:51:31 AM5/4/11
to gantry-framework...@googlegroups.com
OK, this worked. Very simple, thanks. Did a lot of searching couldn't find an answer anywhere.

I tested this one line in the template.css, gantry.css, and style1.css files and it works in all of them. I assume that if I were to put this line in template.css it will affect all styles in the template and if I were to put it into gantry.css it will affect all styles of all templates using Gantry. Lastly, by putting these changes in just the style1.css file it affects only this style in only this template. I like this last, finer grain method of change best.

Duane Mitchell

Duane Mitchell

unread,
May 4, 2011, 6:51:14 PM5/4/11
to gantry-framework...@googlegroups.com
I know I responded to this but I haven't seen it show up.

Anyway, this worked perfectly. Using the Module Suffix Class in Gantry is easy though the existing docs and examples are not.

On May 4, 2011, at 3:56 AM, all80 wrote:

all80

unread,
May 5, 2011, 4:25:34 AM5/5/11
to Gantry Framework for Joomla Users
Glad to be of service.
Reply all
Reply to author
Forward
0 new messages