Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2017-10-18 05:56:56

JimR
Member
Registered: 2012-11-30
Posts: 348
Website

WordPress theme: template-identifier not being inculded

I think this is a bug.

I set the template-identifier property in the Backlight page template. That's working for the pages generated by Backlight and LightRoom.

I have another page template that's used to create my WordPress theme. I added a template-identifier to that template, but it's not being included in the WordPress theme.

For now I found I can work around this using the slug-backlight-theme class (which seems to be unique for the WordPress css and doesn't appear in the Backlight css).

Last edited by JimR (2017-10-18 05:58:19)


--Jim

Offline

#2 2017-10-18 11:37:44

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: WordPress theme: template-identifier not being inculded

An exported theme should have two identifying classes on the BODY tag.

type-theme is the same in all themes, and identifies the exported theme as a theme for CSS purposes (separating it from backlight's albums, pages, etc.)


slug-{id} is unique to the individual theme, with {id} being replaced by the theme's unique identifier, also used as the theme's folder name, and for localization purposes.


Matt

The Turning Gate, http://theturninggate.net

Offline

#3 2017-10-18 12:11:49

JimR
Member
Registered: 2012-11-30
Posts: 348
Website

Re: WordPress theme: template-identifier not being inculded

Matthew wrote:

An exported theme should have two identifying classes on the BODY tag.

That's what I would have expected. In my page template I use only within Backlight, I added the identifier "photo-page" and in the CSS I find the class <template-identifier-photo-page> for all pages associated with that template.

I have a cloned page template with minor differences I use for the Wordpress theme. This is the page template associated with the Wordpress theme add-on. It exports into Wordpress and everything seems fine, except for the missing identifier.

In that Wordpress page template I added the identifier "wordpress-page". When that gets exported into the Wordpress theme, it loses the identifier. Seems that the identifier is ignore when exporting a page template to Wordpress.

Examining the Home page the BODY tag contains only the following:

<home page-template-default page page-id-11 logged-in pangolin type-theme slug-backlight-theme>

The other pages created by Wordpress are the same, minus the "home" class.

I would have expected to find <template-identifier-wordpress-page> in the BODY of each page created by WordPress. Maybe exported page templates are not suppose to include the identifier. It seems like a bug, so I wanted to report this.

Still, I found I can use the <slug-backlight-theme> class for CSS overrides that are specific to WordPress pages.


--Jim

Offline

#4 2017-10-18 13:58:39

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: WordPress theme: template-identifier not being inculded

The Wordpress theme uses the body_class() function, documented here:
https://developer.wordpress.org/referen … ody_class/

It adds to that the two classes I have previously described, and the pangolin class, identifying the module suite used in Backlight. These three classes will appear on every Wordpress page using the exported theme from Backlight. Any other classes added to the body tag are supplied by Wordpress, via the body_class() function.

If you were expecting a fourth class, based on the page template name in Backlight, no such class is applied.

JimR wrote:

Still, I found I can use the <slug-backlight-theme> class for CSS overrides that are specific to WordPress pages.

That is the intended purpose, to allow you to apply styling to the Wordpress theme without impacting Backlight's pages, albums, or album sets.


Matt

The Turning Gate, http://theturninggate.net

Offline

Board footer

Powered by FluxBB