Page template body class not being included in Community Events pages

Home Forums Calendar Products Community Events Page template body class not being included in Community Events pages

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1065096
    Teresa
    Participant

    Hi – I’m using the latest versions of EC Pro and Community Events. I am using a specific page template for the EC pages (that I selected in the settings – where it says it’ll be used for Community Events pages too) and while the correct page template is being used, the body class generated by the theme (.page-template-eventscalendar-php) that goes with that template is not being added to any of the Community Events pages (but it is on the other events pages). Not a huge deal but a bit of a pain because I have to add extra classes everywhere in my stylesheet where the elements for that template are being styled, one for the event submission page and one for the event list page. (.tribe_community_list and .tribe_community_edit). It just seems like that’s a little bug that should be fixed.
    I do see another common body class in all the event pages: .tribe-theme-sv (my main theme is called sv) – if I use that instead for styling, can you confirm it will be there on ALL event pages?
    Thanks!

    #1065911
    Geoff B.
    Member

    Good evening Teresa and welcome back!

    Thank you for reaching out to us. We are sorry to hear about the .page-template-eventscalendar-php body class not being added to the Community Events pages.
    We will gladly try to assist you on this topic.

    I am using a specific page template for the EC pages (that I selected in the settings – where it says it’ll be used for Community Events pages too) and while the correct page template is being used, the body class generated by the theme (.page-template-eventscalendar-php) that goes with that template is not being added to any of the Community Events pages (but it is on the other events pages).

    You are right, by default, once you use a custom page template for your Events Calendar (not only of Community Events), the plugin will not attempt to add these classes on it’s own.
    You will have to add them manually to your page template if you want them to appear.

    So in short, it is not a bug, but intended behaviour.
    The reasoning behind this is that when selecting their own page template most people want to have total control over what gets displayed (hence the lack of default CSS classes being returned).

    You can probably achieve that fairly easily by using a combination of:

    1. our Themer’s guide
    2. A look at the templates found in /plugins/the-events-calendar/src/views
    3. The following post or WordPress.org

    I do see another common body class in all the event pages: .tribe-theme-sv (my main theme is called sv) – if I use that instead for styling, can you confirm it will be there on ALL event pages?

    Yes, you can use your custom class for styling (.tribe-theme-sv) but as you already pointed out, this means starting more or less from scratch. It would probably be faster to add the required body classes to your WordPress page template as a starting point.

    Let me know if that helps.

    Have a great day!

    Geoff B.

    #1065921
    Teresa
    Participant

    I think you missed what I was describing… it DOES add the correct template body class to the main plugin event pages, but NOT to the Community add-on pages. It’s inconsistent. If it’s using the same template for both, why is the body class being added for the regular event pages but not the community add-on pages? Something different is happening ONLY in the community pages.
    Thanks!

    #1065922
    Teresa
    Participant

    PS I found out that .tribe-theme-sv is added to every page in the site, not just event pages, so not useful for styling.

    #1066512
    Geoff B.
    Member

    Good morning Teresa,

    I am sorry about the misunderstanding.
    To clarify, yes it should be the same template for both which is probably why I misread what you were trying to say.

    If you do not mind what would be very helpful moving forward is:

    1. URLs to both your normal events page and your community events page so that I can investigate further.
    2. Using a tool such as Gist or Dropbox, a copy of your page template code (probably in a private reply)

    Have a great day!

    Geoff B.

    #1079850
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Page template body class not being included in Community Events pages’ is closed to new replies.