[template] Page metadata not rendered even if $meta_ref is set to true #172

Open
opened 2026-10-04 23:45:50 +02:00 by adam · 2 comments
Owner

Reported by chrisaga on 18 Sep 2011 07:32

Version: 2.2.5

No meta name="author", meta name="keywords", meta name="description" in the header of the html page rendered by picture.php

Plus <meta name="robots" content="noindex,nofollow"> is set.

Steps to reproduce: Just go to a picture page and display its html source in your browser.

Do not test the special album "random images" since it looks like the meta are always like this.

Additional information: I started to track this nasty little guy in include/page_header.php

Because of the way it is coded, it's not obvious if :

  1. "noindex,nofollow" is set because we don't want metadata ($conf['meta_ref'] set to false ?) or

  2. we don't assign 'meta_ref' in the template because $page['meta_robots']['noindex'] have previously been set.

I did some testing (force meta_ref and commaent some code) and it's definitively the second option.
By the way don't forget to clean the compiled template (tricky, it took me some time to figure out).

Then I went to picture.php and found this code (line 660):
if ( $metadata_showable and pwg_get_session_var('show_metadata') )
{
$page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
}

I commented it out and found that the meta are computed now as I expected.

This code is not so new so I suspect that the issue is somewhere else, unless this bug is there for some time and nobody figured out yet.

Piwigo Bugtracker #2442

**Reported by chrisaga on 18 Sep 2011 07:32** **Version:** 2.2.5 No meta name=&quot;author&quot;, meta name=&quot;keywords&quot;, meta name=&quot;description&quot; in the header of the html page rendered by picture.php Plus &lt;meta name=&quot;robots&quot; content=&quot;noindex,nofollow&quot;&gt; is set. **Steps to reproduce:** Just go to a picture page and display its html source in your browser. Do not test the special album &quot;random images&quot; since it looks like the meta are always like this. **Additional information:** I started to track this nasty little guy in include/page_header.php Because of the way it is coded, it&#039;s not obvious if : 1) &quot;noindex,nofollow&quot; is set because we don&#039;t want metadata ($conf[&#039;meta_ref&#039;] set to false ?) or 2) we don&#039;t assign &#039;meta_ref&#039; in the template because $page[&#039;meta_robots&#039;][&#039;noindex&#039;] have previously been set. I did some testing (force meta_ref and commaent some code) and it&#039;s definitively the second option. By the way don&#039;t forget to clean the compiled template (tricky, it took me some time to figure out). Then I went to picture.php and found this code (line 660): if ( $metadata_showable and pwg_get_session_var(&#039;show_metadata&#039;) ) { $page[&#039;meta_robots&#039;]=array(&#039;noindex&#039;=&gt;1, &#039;nofollow&#039;=&gt;1); } I commented it out and found that the meta are computed now as I expected. This code is not so new so I suspect that the issue is somewhere else, unless this bug is there for some time and nobody figured out yet. [Piwigo Bugtracker #2442](http://piwigo.org/bugs/view.php?id=2442) <!-- github-sync-id:97226318 -->
Author
Owner

Comment posted by chrisaga on 18 Sep 2011 07:47

As it might be relevant for this kind of bug, I would add that I use the theme "Stripped" but I redid the tests with the default theme "Sylvia" and its the same.

**Comment posted by chrisaga on 18 Sep 2011 07:47** As it might be relevant for this kind of bug, I would add that I use the theme &quot;Stripped&quot; but I redid the tests with the default theme &quot;Sylvia&quot; and its the same. <!-- github-comment-id:124892388 -->
Author
Owner

Comment posted by chrisaga on 18 Sep 2011 14:30

It turns out to be an issue with the stripped theme rather than a template bug.

See forum (in French) http://fr.piwigo.org/forum/viewtopic.php?id=20925

Might be solved either by template or by stripped.

**Comment posted by chrisaga on 18 Sep 2011 14:30** It turns out to be an issue with the stripped theme rather than a template bug. See forum (in French) http://fr.piwigo.org/forum/viewtopic.php?id=20925 Might be solved either by template or by stripped. <!-- github-comment-id:124892404 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#172