Fields "image" and "author.image" should not have the same value (in "comment")

24 days ago by Twissell to c/general-discussion

Hello! There is schema.org markup duplication error reported by Google Search Console for Harmony theme. The issue exists for specific topics

The root case might live here and here

Check this out, it'd to be fixed :-)

baris 2 points 18 days ago path: 0 26027231, hotness: undefined, score: 2, children: 0
baris 2 points 21 days ago path: 0 25980175, hotness: undefined, score: 2, children: 0
twissell 1 point 22 days ago

Any thoughts?

path: 0 25962670, hotness: undefined, score: 1, children: 0
baris 1 point 22 days ago path: 0 25964548, hotness: undefined, score: 1, children: 1
twissell 2 points 21 days ago

@baris sure thing!

See it here

Review from Claude.AI

Look at these two lines in your post.tpl:

Line 14:  {{buildAvatar(posts.user, "48px", true, "", "user/picture")}}
          — rendered BEFORE the author scope opens (still inside the outer
            <li> from data/topic.tpl)

Line 19:  <div>

Line 27:  {{buildAvatar(posts.user, "20px", true, "", "user/picture")}}
          — rendered INSIDE that author/Person scope (it's the mobile-only
            duplicate avatar, class "d-sm-none")

Both calls render the exact same thing — posts.user's picture. NodeBB's avatar markup has historically stamped itemprop="image" directly onto the <img /> it generates (you can see this explicitly in older NodeBB themes, e.g. <img src="{posts.user.picture}" />), and buildAvatar() almost certainly carries that forward. That means:

Line 14's avatar sits outside the Person scope → its itemprop="image" attaches to the enclosing Comment scope → becomes comment.image
Line 27's avatar sits inside the Person scope → its itemprop="image" attaches there → becomes author.image

Same picture, same URL, two scopes → exactly the "should not have the same value" complaint.
```</div></li>
path: 0 25964548 25970874, hotness: undefined, score: 2, children: 0
twissell 1 point 18 days ago

Any updates?

path: 0 26025941, hotness: undefined, score: 1, children: 0
twissell 1 point 17 days ago

Thank you!

path: 0 26036766, hotness: undefined, score: 1, children: 0
general-discussion
general-discussion

@community.nodebb.org

login for more options
0
121
16

A place to talk about whatever you want

go to feed...