Template for a site that I want to have two looks....

Everything to do with Joomla! 1.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Locked
blbeta
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Wed Apr 06, 2011 11:14 pm

Template for a site that I want to have two looks....

Post by blbeta » Tue May 10, 2011 8:13 pm

I am somewhat new to Joomla and want advise on the best or most efficient method to do the following to a website.

I want to be able to change the look based on the menu item selected or the article. Basically have it use different CSS for body backgrounds, headers, and what have you.

The only thing I saw with some quick research is the "page suffix class" on the menu items. I read how to use it with space and without.

Is this the best avenue to use different CSS to have two looks on a site depending where the user navigates to? I'll be making my own custom template.

Or am I better off having two joomla installs on subdomains. Seems like this should be unnecessary.
IE: maindomain.com
look1.maindomain.com (joomla 1 installtion)
look2.maindomain.com (joomla 2 installtion)

User avatar
Yuank
Joomla! Explorer
Joomla! Explorer
Posts: 286
Joined: Fri May 06, 2011 10:50 pm

Re: Template for a site that I want to have two looks....

Post by Yuank » Wed May 11, 2011 5:27 am

Page class suffix is the way to go, you can also give the body tag a php so every menu item you´ll have a body class plus the item name to change on css (body_aboutus). Then the modules should have the countmodules php code to show only where selected.
Or
You could have as many templates as you want...I wouldn´t recommend this, but give it a try if you want.
-------------------------------------------
http://www.[youtube].com/watch?v=oc7W_rkjmuM Marca Perú!!!
http://www.[youtube].com/watch?v=nFtmSE5oPDA Peru Brand!!!

Very clever video to get to know a great Country

blbeta
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Wed Apr 06, 2011 11:14 pm

Re: Template for a site that I want to have two looks....

Post by blbeta » Wed May 11, 2011 8:24 pm

I will look into the php, I really know nothing of it. Of course I knew nothing of HTML or CSS at one point as well. Deciding to finally swith to a CMS has been great and has provided me with a lot of new material to learn.

The page suffix is where I will start and I'll dive into the php as needed.

Thanks for the advice.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44089
Joined: Sat Apr 05, 2008 9:58 pm

Re: Template for a site that I want to have two looks....

Post by Webdongle » Wed May 11, 2011 8:33 pm

Page class suffix http://docs.joomla.org/Using_Class_Suffixes and module class suffix to display the modules to match.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

blbeta
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Wed Apr 06, 2011 11:14 pm

Re: Template for a site that I want to have two looks....

Post by blbeta » Fri May 20, 2011 1:02 am

Anything in 1.5 that adds suffix class to body and other custom HTML elements? I don't really need it, but am curious.

From briefly looking at 1.6+ features, I assume this will be easier with some CSS template improvements?

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44089
Joined: Sat Apr 05, 2008 9:58 pm

Re: Template for a site that I want to have two looks....

Post by Webdongle » Fri May 20, 2011 2:33 am

blbeta wrote:Anything in 1.5 that adds suffix class to body and other custom HTML elements? I don't really need it, but am curious....
You obviously didn't understand the information on the pages you were given the links to.

blbeta wrote:....
From briefly looking at 1.6+ features, I assume this will be easier with some CSS template improvements?
The Template overrides and class suffix works the same on 1.5 and 1.6
Last edited by Webdongle on Fri May 20, 2011 5:51 pm, edited 1 time in total.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

blbeta
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Wed Apr 06, 2011 11:14 pm

Re: Template for a site that I want to have two looks....

Post by blbeta » Fri May 20, 2011 3:25 pm

Webdongle wrote:You obviously didn't understand the information on the pages you were given the links to. The Template overrides and class suffix works the same on 1.5 and 1.6
I understood the one link just fine. I was able to change the menu look and the look of articles stemming from the new menu just fine.

I suppose I didn't word it clearly enough. From what I could see those suffixes for the menu items and modules only put the classes on Joomla generated items and not on body tags nor the divs I setup in my custom template.

My reference to 1.6 was that I thought I remembered reading somewhere that in 1.6 css in templates was handle better/differently that "might" make what I was trying for possible.

What I was able to do with the suffixes in 1.5 was enough. I was just curious if more was added in 1.6 in regards to taking it a step further and being able to do something similar with the body tags and such when linked to different menu.

Although I have not heard the term template override before, I expect that may yield some results on that front with some research. Even if it doesn't I will become more educated.

EDIT: Just looked at a Template overrides article. Tyvm for that new info, I expect it will come in handy.
http://docs.joomla.org/How_to_override_ ... omla!_core

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44089
Joined: Sat Apr 05, 2008 9:58 pm

Re: Template for a site that I want to have two looks....

Post by Webdongle » Fri May 20, 2011 6:13 pm

blbeta wrote:....

I understood the one link just fine. I was able to change the menu look and the look of articles stemming from the new menu just fine.

I suppose I didn't word it clearly enough. From what I could see those suffixes for the menu items and modules only put the classes on Joomla generated items and not on body tags nor the divs I setup in my custom template.
.....
http://docs.joomla.org/How_to_override_ ... omla!_core
My apologies, I thought I had also posted the link to Template overrides(but you know what thought done ) :-[

If you use Template overrides you can add code to the div classes in the default.php files for Articles blogs etc.

For example (templates/ja-purity/html/com_content/article/default.php
If you add
<?php echo $this->escape($this->params->get( 'pageclass_sfx' )); ?>
in
<div class="article-content">
you get
<div class="article-content<?php echo $this->escape($this->params->get( 'pageclass_sfx' )); ?>">
Then if you apply a page class suffix of
_newclasssuffix
<div class="article-content">
displays as
<div class="article-content_newclasssuffix">

So you would then put in the css
.article-content_newclasssuffix {
font xxx;
}

You could also specify hyperlink underline different to the rest of the site.
something like
.article-content_newclasssuffix a:link, article-content_newclasssuffix a:visited, article-content_newclasssuffix a:hover, article-content_newclasssuffix a:visited{
text-decoration:none;
}
(not 100% certain the a: syntax accurate. But should give you an idea of the different possibilities.)
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".


Locked

Return to “Templates for Joomla! 1.5”