darnoldy
04-10-2015, 10:02 PM
Okay... so I want to put rel = next and rel=prev link tags into the head of pages that need them. "easy peasy," says I... the logic and links to those pages is already there in the pagenav template.
So, I copied out the pagenav template and, form what it contained, built this:
<if condition="$show['prev']">
<link rel="prev" href="$address$address2<if condition="$prevpage != 1">&page=$prevpage</if><if condition="$anchor">#$anchor</if>">
</if>
<if condition="$show['next']">
<link rel="next" href="$address$address2&page=$nextpage<if condition="$anchor">#$anchor</if>">
</if>
Which I then pasted into the head of the forumdisplay template.
"Done and dusted," says I, smuggly! But alas, it doesn't work.
$address
$address2
$prevpage
$nextpage
are empty!
It seems as though those values aren't fetched until $pagenav is called later in the template. Is this a job for a plugin?
--don
So, I copied out the pagenav template and, form what it contained, built this:
<if condition="$show['prev']">
<link rel="prev" href="$address$address2<if condition="$prevpage != 1">&page=$prevpage</if><if condition="$anchor">#$anchor</if>">
</if>
<if condition="$show['next']">
<link rel="next" href="$address$address2&page=$nextpage<if condition="$anchor">#$anchor</if>">
</if>
Which I then pasted into the head of the forumdisplay template.
"Done and dusted," says I, smuggly! But alas, it doesn't work.
$address
$address2
$prevpage
$nextpage
are empty!
It seems as though those values aren't fetched until $pagenav is called later in the template. Is this a job for a plugin?
--don