Hi Mark,
I’m trying to link directly to the preview (which will have the anchor ‘preview’) once a preview has been requested. Let me try and clarify a bit more as maybe I’m missing something obvious here.
I have a blog template that displays single entries, comments and a comment form. The form looks something like this:
{exp:comment:form channel="blog" preview="blog/{segment_2}/#preview"}
<h2>Add your comment</h2>
<p><ul> <br />
<li><br />
<label for="name">Name:</label><br />
<input type="text" name="name" id="name" value="{name}" required /><br />
</li><br />
<li><br />
<label for="email">Email:</label><br />
<input type="email" name="email" id="email" value="{email}" required /><br />
</li> <br />
<li><br />
<label for="comment">Your comment:</label><br />
<textarea name="comment" id="comment" rows="6" required>{comment}</textarea><br />
</li> <br />
<li><br />
<input type="submit" name="preview" value="Preview" /><br />
</li><br />
<li><br />
<input type="submit" name="submit" value="Submit" /><br />
</li> <br />
</ul><br />
{/exp:comment:form}
The template also has a comment preview tag pair to display previews, something like this:
{exp:comment:preview}
<h1 id="preview">Your comment preview</h1>
<article>
<h1>{url_as_author}, {comment_date format="%j%S %M %Y"}</h1>
{comment}
</article>
{/exp:comment:preview}
So, when someone fills out the comment form and clicks ‘Preview’, I’d expect that form to send me to this template and the h1 (in this case) with the id of ‘preview’, as that’s what I’ve set as the preview parameter.
That doesn’t happen. What am I missing?