How to Change the Appearance/Template of Different Pages on a Joomla 1.5 Site

Posted on 2009-02-22
Last Modified: 2012-05-06
I'm trying to develop a Joomla 1.5 site with a Mainsite (where all pages are accessible by the public without logging in) and a Portalsite (where the various functions, tools and viewable content made available to the users are based on their access level).

The Mainsite's Mainmenu items differ from the Portalsite's Mainmenu items but should share two common menu items, a Home link and a Portal link.  The 'Home' link (whether activated from the Mainsite's main menu or from the Portalsite's main menu) would always take the user to the Mainsite's homepage.  Similarly the 'Portal' link would always take the user to the Portalsite's homepage whereon a user, prior to logging in, could view structured information explaining the functions available in the Portal, and after logging in, could view whatever content he/she was entitled to and make use of whatever tools/functions his/her access level entitled him to.

I can navigate around at a novice level through the backend of a Joomla site and create various user levels, sections, categories, and articles and publish them to various areas of the sites but (being a relative beginner in Joomla and a total beginner in PHP) I bog down when I start trying to change the structure of different pages or want to free format my page's content (as I might if I was just creating a static html page in Dreamweaver).  I know enough to be able to do this reasonably well if I were to code it all as static pages in html/css (using html templates and css stylesheets) but I need the features of a CMS system for where I'm going with this project and once I step into the Joomla 1.5/PHP arena, I'm totally out of my league.

To illustrate:

Let's assume points to the Mainsite homepage and points to the Portalsite homepage.

The Mainsite would have the following Mainmenu items visible on all its pages:

Contact Us
Portal (this would link to the publicly viewable pre-login portion of the Portalsite)

The Portalsite would have the following Mainmenu Items visible to the public on it's homepage, prior to user log-in. as well as a login/register module:

Home (would link back to Mainsite homepage)
What's This
Contact Us

Once a user logs in to the Portalsite, some or all of the following Mainmenu items would appear, depending on the user's assigned access level:


along with a set of 'Tools' generally available in the left hand margin of the logged-into Portal site (this tool set would not be visible until after user log-in and would have varying functionality depending on the user level).

The Mainsite's homepage would contain the 'flash' (either literally as a Flash module or rotating image slideshow etc.).  However, the Mainsite's other pages (e.g. Background, Services, etc.) may not display this 'show' module or might contain a differently sized 'show' (e.g. banner style or smaller size or repositioned on page).  The Mainsite's Contact Us page or Help page would probably use standard Joomla modules or extensions but which should be 'fit' inside the Mainsite's wrapper, to maintain the look and feel of the Mainsite.

The Portalsite's homepage (prior to user login) would be to introduce say prospective clients or portal users to the functionality available through the portal  but once logged-in the Portalsite would be used primarily by staff/clients/contractors who need to work or interact through the portal (e.g. share project info, upload/download files, access/send corporate email or private messages, desktop share, remote control each other's desktops, online conference, etc.).  This 'site' would generally not contain any of the 'flash' or 'showlike' modules on most pages (except perhaps Help pages or Tutorial pages) and would maximize functionality and useable screen space.

Specifically, I don't know how to go about doing the following:

a) Maintain common portions for both the Mainsite and Portal (e.g. background image/color, logo, main menu styling (e.g. fonts, link behaviour, etc.), footer; without having to maintain duplicate sets of 'stylesheets' or 'templates' for the common portions.  For example, if I change the colour scheme for the Mainsite or the logo for the Mainsite (ie these being 'common portions' to both sites) I would want those changes reflected on the Portalsite.

b) Allow different page 'structures' or 'layouts' between the various pages of each site (subject to maintaining the common portions described in a) ) while still maintaining the benefits of the CMS system (obviously I can hard code everything but that defeats the goal of using Joomla).

I've taken a first stab at this in Joomla by using a third-party template for the Mainsite homepage which has a rotating image slideshow module built in  and then creating a similar template (by more or less duplicating the entire template and all its modules, etc.) and modifying the html/css of the duplicated template to do what I want (e.g. hiding the slideshow and its div) but this approach is about as inefficient and 'kludgy' as it gets.  This allows me to assign a different 'template' to different Mainmenu items but makes maintaining the resulting multiple templates i'll end up with a real mess.

There must be many more elegant ways to do this through perhaps php tags which will vary which Joomla modules or Mainmenu items or CSS style sheets are used on given pages and which divs appear on given pages.

Expert guidance much needed and appreciated.


Question by:qeng
    LVL 19

    Expert Comment

    Just get JUGA. It'll do what you describe. You'll also need the addition juga tools (hidden_by_juga for eg)

    Author Comment

    Thx for replying.  I had a quick read through the Juga links and a quick look through their demo.
    Unless I'm mistaken, Juga seems to be geared towards doing a better job than core Joomla components for  hidding and showing content or links based on User Level or assigned Groups but it's not clear to me that it does anything to address using different templates for different pages or sections of either the Mainsite or Portalsite.
    For example, at present I can choose not to publish the Mainsite's slideshow on that site's secondary pages (e.g. Background or Services, etc.) but what remains on those secondary pages are the divs and structure of the Mainsite's template.  The divs don't disappear, they just show without content.  For example if on the Mainsite home page I want to use a left module to show the 'slideshow' and a right hand module to show text content, but on the Background page I want to show only one module which spans the entire width of the wrapper, subjected to a different css styling than the Homepage, it doesn't seem that JUGA is geared to help with this.
    Am I misunderstanding what Juga does?
    LVL 19

    Expert Comment

    I use juga to show-hide module output and restrict access to modules, menu items and resources. If the site displays everything possible, then parts are hidden based on user groups, you basically have what you need right?

    Author Comment

    @v2Media,Juga may come in handy for part of my issue once users have registered/logged in but it doesn't address the problem I'm describing if a non-logged in user (e.g. public guest) goes to a different page (menu item) ... how to change the template layout there.  Also Juga is not free and doesn't seem to have any demo version to trial version to test out (have bought way too much faulty software to do that any more).
    Thx for replying anyhow.
    Is there no way to add tags to the PHP code which selects a different template or different css style sheet based on the page (ie menu item) id?
    LVL 19

    Accepted Solution

    I don't see why not.

    However having developed a few components for Joomla, I can see that what you want would require re-writing a substantial portion of the Joomla core files (which kills its upgradability) to enable more than one theme/template to be active. Then there would be a component to give a new advanced parameter to the menu system, a mod that tracks what theme/css/template to display based on url parameters - the list goes on.

    In short, you'd need to hire a professional coder and get a bank loan because such a job would be several thousand. This is because Joomla is not designed to be 2 websites in one.

    Author Closing Comment

    Thx for input V2Media.  Have been delving into customizing the master template to achive what I need.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    A colleague recently asked me about how to give his client a small part of the web site that could be completely under the client's control.  Since I have done this sort of thing before to add emergency banners to a web site, I decided I would creat…
    Both Easy and Powerful How easy is PHP? (  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now