Joomla Templates shop

Premium Template

Search files

Search For: 
Search File Titles: 
Search File Descriptions: 
Home
Style members sections using a unique CSS ID PDF Print E-mail
Written by Administrator   
Wednesday, 28 March 2007

How many times have you wished you could style things differently for members than the public on your Joomla! site? Well, we just had a project that it was mandatory, so we set out to come up with some code to allow us to style the CSS separately. This is how it’s done…

Insert this PHP code just below your body tag to add an id called #members only when someone is logged in.


<?php if ( $my->id ) { echo "<div id=\"members\">"; } else { }; ?>

and add this just above the end body tag in your template…


<?php if ( $my->id ) { echo "</div>"; } else { }; ?>

You may now use some creative CSS to style things differently for members. For example, if you have a white header for the public, you can change it to red when members log in by using the following CSS…


#members #header {background:#990000}

If for some reason it doesn’t change then try adding !important on the end of the color and it will override any cascading issues.

I hope you find this little piece of code useful for your Joomla! projects. I know it has given us a LOT more control over our Joomla! pages. Enjoy!

Hits: 851
Comments (2)Add Comment
css web desgin
written by sezer, May 02, 2008
CSS "Cascading Style Sheets" LessoNs - WeB DesigN LessoN - - Web site : http://WWW.css-lessons.ucoz.com/index.html


report abuse
vote down
vote up
Votes: +0
css Template
written by :-: S€ZæR ->, May 14, 2008
css web template page (example) -- http://www.css-lessons.ucoz.co...e-page.htm
report abuse
vote down
vote up
Votes: +0

Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

busy




Reddit!Del.icio.us!Facebook!Slashdot!Netscape!Technorati!StumbleUpon!Newsvine!Furl!Yahoo!Ma.gnolia!Free social bookmarking plugins and extensions for Joomla! websites!
Last Updated ( Sunday, 22 July 2007 )
 
< Prev   Next >

Polls

Best hosting for joomla
 

Newsflash

Freqently people want to know how to customize the free templates that come with Joomla.  And, knowing how to do some template customization is an important Joomla skill to have.

A frequent question on the Joomla forums is, "how to I change or remove the "footer" text on a template."

It might be a "Template by ---- " or "Powered by Joomla"  or something like that.

Read more...