Problem/Motivation

When the page is composed from anything but a node (which became a different beast in 9 than it was in 7) and there's no nid to query, the class reads

page-node-

Steps to reproduce

Open f.e. a taxonomy page and look up <body class="

Proposed resolution

Query the nid and check if empty before adding a class to the body tag.

Hope this helps,

Norbert

Comments

nofue created an issue. See original summary.

omkar-pd’s picture

Status: Active » Needs review
StatusFileSize
new827 bytes

In else part checked if the current page is taxonomy or not. If yes then added classes like page-taxonomy-ID and page-taxonomy-type-

omkar-pd’s picture

StatusFileSize
new31.24 KB

Here is the result.

libbna’s picture

StatusFileSize
new53.69 KB

Reviewed #2 patch and class = "page-taxonomy- page-taxonomy-type-" is added successfully.

libbna’s picture

Status: Needs review » Reviewed & tested by the community
omkar-pd’s picture

klidifia’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new479 bytes

The patch in #2 isn't appropriate because:

  • The module is meant to add the node ID class to the body, not the taxonomy
  • This still will present issues as this only extends it to cover taxonomy also, there are various other types of pages other than nodes and taxonomy pages.

Therefore I think the appropriate action is in this patch which simply:

  • Removes the else statement, if it's a node we're working with, we add the class with the ID, if not... nothing!
  • Removing double newline at EOF
tamerzg’s picture

Status: Needs review » Reviewed & tested by the community

I pushed a slightly different fix that fixes this.

tamerzg’s picture

Status: Reviewed & tested by the community » Fixed

Released in 2.0.0

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.