@@ -1,55 +1,88 @@
{!-- Segment_2 isn't blank, so show a blog post's details --}
{if segment_2 != ""}
{exp:channel:entries channel="blog" limit="10 "}
{exp:channel:entries channel="blog" url_title="{segment_2} "}
<h2 class="postTitle"><a href="{path='blog/detail'}">{title}</a></h2>
<p>Posted {entry_date format='%m/%d'} by {screen_name} </p>
{!-- If no results,
then segment_2 isn't a URL title for any existing blog post (typo? broken link?),
so redirect to the landing page --}
{if no_results}
{redirect="blog/index"}
{/if}
{sumary }
{!-- Otherwise display the blog post, with whatever markup you want -- }
{post_body}
<div class="post">
{exp:comment:form channel="about" preview="channel/preview"}
<h2 class="postTitle"><a href="{path='blog/detail'}">{title}</a></h2>
{if logged_out}
<label for="name">Name:</label> <input type="text" name="name" value="{name}" size="50" /><br />
<label for="email">Email:</label> <input type="text" name="email" value="{email}" size="50" /><br />
<label for="location">Location:</label> <input type="text" name="location" value="{location}" size="50" /><br />
<label for="url">URL:</label> <input type="text" name="url" value="{url}" size="50" /><br />
{/if}
<p>Posted {entry_date format='%m/%d'} by {screen_name}</p>
<label for="comment">Comment:</label><br />
<textarea name="comment" cols="70" rows="10">{comment}</textarea>
<label><input type="checkbox" name="save_info" value="yes" {save_info} /> Remember my personal information</label><br />
<label><input type="checkbox" name="notify_me" value="yes" {notify_me} /> Notify me of follow-up comments?</label><br />
{summary}
{if captcha}
<label for="captcha">Please enter the word you see in the image below:</label><br />
<p>{captcha}<br />
<input type="text" name="captcha" value="{captcha_word}" maxlength="20" /></p>
{/if}
{post_body}
<input type="submit" name="submit" value="Submit" />
<input type="submit" name="preview" value="Preview" />
</div> <!-- end post -->
{/exp:comment:form }
{/exp:channel:entries }
{/exp:channel:entries}
{!-- Comment form should usually be outside exp:channel:entries, as it's a call to a separate module --}
{exp:comment:form channel="blog" preview="channel/preview"}
{if logged_out}
<label for="name">Name:</label> <input type="text" name="name" value="{name}" size="50" /><br />
<h3>Comments</h3>
<label for="email">Email:</label> <input type="text" name="email" value="{email}" size="50" /><br />
{exp:comment:entries sort="asc" limit="20"}
<label for="location">Location:</label> <input type="text" name="location" value="{location}" size="50" /><br />
<div class="comment">
<label for="url">URL:</label> <input type="text" name="url" value="{url}" size="50" /><br />
{comment }
{/if }
<label for="comment">Comment:</label><br />
<textarea name="comment" cols="70" rows="10">{comment}</textarea>
<p>By {name} on {comment_date format="%Y %m %d"}</p>
<label><input type="checkbox" name="save_info" value="yes" {save_info} /> Remember my personal information</label><br />
<label><input type="checkbox" name="notify_me" value="yes" {notify_me} /> Notify me of follow-up comments?</label><br />
</div><!-- end comment -->
{/exp:comment:entries}
{if captcha}
<label for="captcha">Please enter the word you see in the image below:</label><br />
<p>{captcha}<br />
<input type="text" name="captcha" value="{captcha_word}" maxlength="20" /></p>
{/if}
<input type="submit" name="submit" value="Submit" />
<input type="submit" name="preview" value="Preview" />
{/exp:comment:form}
<h3>Comments</h3>
{exp:comment:entries sort="asc" limit="20"}
<div class="comment">
{comment}
<p>By {name} on {comment_date format="%Y %m %d"}</p>
</div><!-- end comment -->
{/exp:comment:entries}
{!-- Segment_2 is blank, so get us out of here - redirect to the index template --}
{if:else}
{redirect="blog/index"}
{/if}