Hi all,
I’ve recently started using Expression Engine having come from a Wordpress-as-CMS background. Loving it so far, the flexibility and the way it keeps out of your way in terms of front end is fantastic - I’ve made the switch for good.
Now, I’ve got a couple of issues which I’ve tried hard to find solutions to by searching, but haven’t worked it out. I’m building a site which has a blog, and the blog entries have a single entry template with comments. Ordinary stuff.
This is all working fine but for a few things where I assume I’ve made a basic error.
The content etc is fine, and it’s pulling the right comments for that entry.
First issue: comment email addresses are echoing as the admin email. Here’s my code:
<section>
{exp:channel:entries channel="blog" limit="1"}
<article>
<hgroup><h1>{title}</h1></hgroup>
{edit_this}
<span class="articleMeta">{entry_date format="%d %M %Y"} / in {categories backspace="2"}<a href="http://{path=">{category_name}</a>, {/categories}</span>
{blogContent}
{social}
</article>
<article>
{comment_list}
{comment_form}
</article>
{/exp:channel:entries}
</section>The comment form and list snippets are pretty standard. I won’t show the form, but here’s the code for rendering:
{exp:comment:entries}
{exp:ce_gravatar:single email=
<span class="rightFloat articleMeta">{comment_date format="%d %M %Y at %g:%i%a"}</span>
<h3>{name} said:</h3>
<p> {comment}<br />
{email}<br />
<hr ><br />
{/exp:comment:entries}as you can see i’m using the gravatar plugin. The final {email} tag is there so I can see what’s being output - in each comment, it’s the admin/global email.
Not sure what’s wrong here, any help appreciated.
The second issue is I am having a hard time understanding why I can’t get a list of posts to display in a sidebar. I’m calling them like this (below the above code in the template):
<section>
{exp:channel:entries channel="blog" limit="4"}
<li>
<article>
<hgroup>
<h4><a href="http://{url_title_path=blog}">{title}</a></h4>
<p> </hgroup><br />
{exp:word_limit total="22"}<br />
{blogContent}<br />
{/exp:word_limit}<br />
{comment_total} Comments / <a href="http://{url_title_path=blog}">Read more</a><br />
</article><br />
</li><br />
{/exp:channel:entries}<br />
</section>
I’m assuming I’ve got a fundamental way of working with templates mixed up here. I have to this point got on just fine with calling channel entries like so, but this doesn’t seem to work in these single entry templates, so I’d like to find out why before I go to far with the rest of my integration and find out I’ve gone astray!
Much of the rest of the site is quite simple, but there are some more tricky things like a store and an ajax product browser, so I’d like to be put straight before I get to those.
Cheers for any help, much appreciated.
Dan