I think with the template I have installed for Joomla that the Page Class Suffix is broken for some reason so I cannot easily add CSS changes that way. I was amazed at how hard it was for me to locate how to do this. I searched forever on Google and could not find the correct answer as most people discussed using Page Class Suffix which again was not an option for me. Anyhow when it came down to it I took the following steps to do this and was really surprised at how easy it was.

In Extensions >> Template Manager you can assign pages to different templates with Joomla. So the easiest solution for me was to copy my current template over to a new directory as described below.

  1. Copy Joomla Template: cp -Rp templates/current-template templates/new-template
  2. Make Any Changes:vi templates/new-template/css/template.css (Modify any CSS parameters you would like to be different)
  3. Navigate Joomla Admin: Open up the Joomla admin, Go to Extensions >> Template Manager; Click the radial button next to the new template; Click Edit;
  4. Associate New Template To Page/Pages: Under Menu Assignment click the radial button next to Select From List; Highlight the pages you want to use this new template;
  5. Your Done: Save the new template; Check your pages!

Thats it! You could have a different template for each page if you wanted to. In my case I only wanted to front page to be different.

So if you just want a different template on your frontpage for instance then follow the directions above and in 5 minutes it can be using a new template. This was way easier than I was expecting it to be! Joomla has yet to let me down.

This method would allow you to assign different CSS stylesheets to each page within Joomla if you wanted to. I would suggest against doing this for more than one or two pages though as your users will catch themselves downloading endless copies of the same files if you have a different Joomla template for each page.

If you want to become a Joomla ninja check out the book below.


List Price: $44.99 USD
New From: $0.94 USD In Stock
Used from: $0.01 USD In Stock

DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail
Tags: , , , , ,
12 Responses to “Add CSS Per Page With Joomla – Page Class Suffix Not Working”
  1. Mike says:

    Hi i want to know what do you mean with ” cp-rp”for the first step and step 2 “vi”what does this mean. Another thing i tried to follow your instructions but with no result. When i make a copy of my current template i get a copy of the same template. Ok when i try to edit the css i get a error in joomla. I did it with an editor and safe what i modified in the new copy web folder. This also dit not work.
    I want a homepage layout with different pages when i navigate. I hope you understand my problem. And hopefully you can help me with this

    [Reply]

    alex Reply:

    Hello Mike,

    Both of those are Linux CLI commands.

    1. “cp -Rp” means to recursivelly copy all contents of that folder with the same permissions.
    2. “vi” is a common Unix text editor. You can replace vi with whatever your favorite text editor is.

    The steps I have written out above were performed close to a year ago but I am sure they are accurate in creating different styles for each page. I hope you are able to accomplish your goal but if you are unable to accomplish your goal using the steps above I would be happy to resolve the issue for you via consulting. If you are intrested feel free to contact our team via the contact form on this site.

    Good luck!~

    [Reply]

  2. Daniel says:

    OH MY GOD !!! How i can missed that ?! Great article mate. Thanks for pointing me out of the trouble.. Take care

    [Reply]

    alex Reply:

    Hello Daniel,

    No problem man. Glad it helped out. Thanks fot taking the time to leave feedback!

    Thanks.
    alex

    [Reply]

  3. Josh says:

    Thanks alex! Great solution. Helped me out a ton. Much appreciation.

    [Reply]

    alex Reply:

    Hello Josh,

    No problem at all. Glad the article helped you out. Thanks for taking the time to leave feedback.

    Thanks.
    alex

    [Reply]

  4. Frankie says:

    This was a great tip on fixing a bunch of layout problems I’ve been having.

    I couldn’t get the layout to show up on my control panel after I duplicated it so I just installed a bunch of random templates and replaced their contents with my current template, ready for editing. Further more, after working on this technique (yes I am gonna call it a technique), I’ve developed different template sets for different needs – some gutted out of other templates for their layout, some for their graphic sets, you could say I’ve gone all frankenstein on the thing. Its given me the kind of freedom you get with a play html page.

    Thanx a lot,

    [Reply]

    alex Reply:

    Hello Frankie,

    No problem. Glad you found the information to be useful. Thanks for taking the time to leave feedback.

    Thanks.
    alex

    [Reply]

  5. Frankie says:

    Couldn’t get the themes to show up…*

    [Reply]

    alex Reply:

    Hello Frankie,

    As noted above thanks for taking the time to leave feedback…

    Thanks.
    alex

    [Reply]

  6. Sri says:

    Worked awesomely! Stopped me worrying about huge lines of codes.. Thanks a lot :)

    [Reply]

    alex Reply:

    Hello Sri,

    Great to hear. Thanks for posting feedback.

    Thanks.
    alex

    [Reply]

  7.  
Leave a Reply

*Type the letter/number combination in the abvoe field before clicking submit.

*