Sign Up for OSTraining

Welcome, Guest
Username: Password: Remember me

TOPIC: CSS class for a joomla page

CSS class for a joomla page 11 months 4 weeks ago #49836

  • gilles
  • gilles's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 988
  • Karma: 0
In 2.5, is there a way to easily add a class to an entire page? a CSS class so I could style elements of this particular page as I please?

In the menu item edit page, I see a "page suffix" entry but when I add something in here and view the resulting page source, the class is nowhere to be found.

Or... should I be adding something in the article edit page?
Gilles
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 4 weeks ago #49839

  • jmc
  • jmc's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 1426
  • Thank you received: 118
  • Karma: 8
Hi Giles
Is this the sort of thing you were looking for?
docs.joomla.org/Using_Class_Suffixes#Page_Class_Suffix
Regards
Mark
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 4 weeks ago #49840

  • gilles
  • gilles's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 988
  • Karma: 0
Thanks for the quick response Mark.
Kind of. I did come across this page from another post on OST but I can't seem to find the "page class Suffix" field?

has it changed in 2.5?
Gilles
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #49868

  • tessa
  • tessa's Avatar
  • OFFLINE
  • Moderator
  • Posts: 4032
  • Thank you received: 138
  • Karma: 10
Hi Gilles,

Do you have any fields on the Parameters/Page Display Options that says "Page Class"? =] Or any field with the word "Class"?
Warm Regards,

Tessa Mero



Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #49888

  • gilles
  • gilles's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 988
  • Karma: 0
Hi Tessa,

Which screen are you refeering to? where should I be looking for this?
See my post re: what I see on menu edit page. If it's supposed to be done some other way, could you specify where?

In the article edit, there is no such filed.
Cheers,
Gilles
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #49892

  • jmc
  • jmc's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 1426
  • Thank you received: 118
  • Karma: 8
Hi
Menu Manager - select the menu for the page you want to alter -Page Display Options -Page Class.
Page Class = Page Class suffix.
Hope this helps.
Mark
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #49893

  • gilles
  • gilles's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 988
  • Karma: 0
Thanks Mark,
It's exaclty what I do. However, when I look at the source of the resulting page in firefox, and search for the text i entered in "page class", it's nowhere to be found.

I even tried with a leading space in front of the suffix I want. It just doesn't appear.

what am i doing wrong?

Gilles
Gilles
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #49909

  • edandrea
  • edandrea's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 3105
  • Thank you received: 7
  • Karma: 0
Have you added the css to your template.css file?

ed
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #49911

  • gilles
  • gilles's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 988
  • Karma: 0
Yes, i did.

Ed, please read above...
the class does *not* appear in the source of the page rendered by joomla. So it's irrelevant whether the CSS declaration is in my css file or not.
G
Gilles
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #49916

  • edandrea
  • edandrea's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 3105
  • Thank you received: 7
  • Karma: 0
Can you post a link? If you can let me know the answers to these questions.

What menu type did you add the suffix to?
What is the class name you added?
Did you use a space or no space in the example?

Ed
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #49917

  • jmc
  • jmc's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 1426
  • Thank you received: 118
  • Karma: 8
Hi Giles
Just to let you know I have spent the last 3 hours trying to get this to work in 2.56and have failed miserabley! I shall be very interested in a solution.
Regards
Mark
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #49955

  • gilles
  • gilles's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 988
  • Karma: 0
Hi Mark,
Thanks for trying so hard. I spent many hours as well prior to posting. I'm glad the problem is reproducible.

I wonder if Nick would happen to know? He's helped in a similar situation with 1.5.x a while back. Diff problem but similar.

Gilles
Gilles
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #49956

  • gilles
  • gilles's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 988
  • Karma: 0
Hi Ed,
Thanks for persisting. Please remove the link when you can.

answers to your questions:

1. removed
2. menu type: article > single article
3. current class name: ggsuffix
4. tried with and without a leading space.

Did you try it Ed?
Mark tried and he couldn't get it to work for him either.
Gilles
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #49967

  • tessa
  • tessa's Avatar
  • OFFLINE
  • Moderator
  • Posts: 4032
  • Thank you received: 138
  • Karma: 10
Hi Gilles,

Are you using a custom template? According to this article I just read:
forum.joomla.org/viewtopic.php?t=307363

It requires making a php call to the page class suffix on the template, if you don't already have it.

I haven't tried this, but worth checking it out. :-)

If this isn't it, I'll try to participate into finding a solution. Since your first post, I've been filled with curiosity as much as Mark is. :-)
Warm Regards,

Tessa Mero



Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #49976

  • gilles
  • gilles's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 988
  • Karma: 0
Thanks for the article Tessa. However I don't think what the author is doing is the simple task I 'm trying to do. He states that he knows how to do a simple page class suffix.

perhaps I'm missing something. the template I'm using is from Yootheme.

Can you try to see if you can get it to work on one of your menus items please?
G
Gilles
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #49978

  • tessa
  • tessa's Avatar
  • OFFLINE
  • Moderator
  • Posts: 4032
  • Thank you received: 138
  • Karma: 10
Hi Gilles,

I tried to reproduce this on a couple other 2.5 Joomla sites, but could not. It was showing in my source code correctly.

However, I ran into an article that explains how to create a page class suffix if you are using a Yootheme template. It seems there are a few extra steps you need to take.
www.yootheme.com/themes/documentation/le...custom-page-suffix-2
Is this what you are looking to do?
Warm Regards,

Tessa Mero



Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #50020

  • gilles
  • gilles's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 988
  • Karma: 0
Hi Tessa,
I think you're onto something. :)
I posed a question to Yootheme in this regard and will post back their response. As strange as it seems, looks like you're correct and that the page class suffix does not work with their/this templates.
G
Gilles
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #50022

  • jmc
  • jmc's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 1426
  • Thank you received: 118
  • Karma: 8
Hi
Have you tried switching to one of the default templates. I thought that it might be due to a framework template but have just tried on a simple site and failed yet again!
Cheers
Mark
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #50024

  • gilles
  • gilles's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 988
  • Karma: 0
Hi Mark,
No I haven't tried switching yet. Will do though. Very strange that it doensn't work for you either.
Gilles
Gilles
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #50026

  • tessa
  • tessa's Avatar
  • OFFLINE
  • Moderator
  • Posts: 4032
  • Thank you received: 138
  • Karma: 10
Hi gilles,

I'm glad we are getting closer and closer to the answer. Let me know how it worked out on a simple yootheme template as well. :-)
Warm Regards,

Tessa Mero



Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #50035

  • gilles
  • gilles's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 988
  • Karma: 0
Hi Tessa,
Good news! it works using a std template. It's an issue with Yootheme's Warp.
I'm communicating with their support to see what this is all about. They have provided a 'hack" but am questioning it as it would mean always re-coding when updating the template. Not very suitable.
Thanks for solving this.

Mark, not sure why it's not working with your test using a std template.

Will update you.
G

Gilles
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #50036

  • jmc
  • jmc's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 1426
  • Thank you received: 118
  • Karma: 8
Hi Giles
Yes working for main content area on a simple template. The other day I was struggling with a Gaven framework.
Your other option if you wanted to change even more of the page would be to use a copy of your template for that page.
I do like a solution; even a partial one - its much easier to go to sleep!
Regards
Mark
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #50037

  • gilles
  • gilles's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 988
  • Karma: 0
At this point, instead of using the menu item page class suffix I simply wrapped the entire content in a div with a custom class. I don't like the idea of hacking code in this case.
Strange how some frameworks break this function. Silly, really.

Thanks Mark,
Gilles
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #50041

  • tessa
  • tessa's Avatar
  • OFFLINE
  • Moderator
  • Posts: 4032
  • Thank you received: 138
  • Karma: 10
Hi Gilles,
Hi Tessa,
Good news! it works using a std template. It's an issue with Yootheme's Warp.
I'm communicating with their support to see what this is all about. They have provided a 'hack" but am questioning it as it would mean always re-coding when updating the template. Not very suitable.
Thanks for solving this.

I am excited for you! Good news for you is even great news for us. :-)
Warm Regards,

Tessa Mero



Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #50048

  • gilles
  • gilles's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 988
  • Karma: 0
Hi again OST,
fyi, I got a response from Yoo... goes like this:
Warp5.5 is now considered legacy, for Warp6 this will work out-of-the-box and yes you will lose the change when updating that's why I called it a "hack". You are free to apply it or not...
Greetings,

silly ... but true :)

Gilles
Please become a member of OSTraining to reply to this post.

CSS class for a joomla page 11 months 3 weeks ago #50072

  • tessa
  • tessa's Avatar
  • OFFLINE
  • Moderator
  • Posts: 4032
  • Thank you received: 138
  • Karma: 10
Hi Gilles,

That is good to know. Thank you for following up with us. :-)
Warm Regards,

Tessa Mero



Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

Sign Up for OSTraining

Copyright 2013 Open Source Training, LLC. All rights reserved.