ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Pulling in channel data.. newbie question.

January 26, 2011 7:06pm

Subscribe [4]
  • #1 / Jan 26, 2011 7:06pm

    BilldaCat

    6 posts

    I can’t figure out why I can’t pull in the {body} here.. it’s just blank.

    My template:

    {exp:channel:entries channel="blog" limit="10"}
    
    <h3><a href="http://{title_permalink=">{title}</a></h3>
    
    <p>{body}</p>
    
    <p><div class="date">Posted on {entry_date format="%M %d, %Y - %h:%i %A"}</div></p>
    
    <p>{exp:comment:form channel="blog" preview="channel/preview"}<br />
            <br />
        {if logged_out}<br />
            <label for="name">Name:</label> <input type="text" name="name" value="{name}" size="50" /><br > <br />
            <label for="email">Email:</label> <input type="text" name="email" value="{email}" size="50" /><br > <br />
            <label for="location">Location:</label> <input type="text" name="location" value="{location}" size="50" /><br > <br />
            <label for="url">URL:</label> <input type="text" name="url" value="{url}" size="50" /><br > <br />
        {/if}<br />
        <br />
        <label for="comment">Comment:</label><br />
     <br />
        <textarea name="comment" cols="70" rows="10">{comment}</textarea><br />
        <label><input type="checkbox" name="save_info" value="yes" {save_info} /> Remember my personal information</label><br />
     <br />
        <label><input type="checkbox" name="notify_me" value="yes" {notify_me} /> Notify me of follow-up comments?</label><br />
     <br />
        <br />
        {if captcha}<br />
            <label for="captcha">Please enter the word you see in the image below:</label><br />
     <br />
            {captcha}</p>
    
    <p>        <input type="text" name="captcha" value="{captcha_word}" maxlength="20" /></p><br />
        {/if}<br />
        <br />
        <input type="submit" name="submit" value="Submit" /><br />
        <input type="submit" name="preview" value="Preview" /><br />
        <br />
    {/exp:comment:form}</p>
    
    <p>{/exp:channel:entries}

    Title comes through, date comes through, body is not.  ???

    Basically I’m just trying to get a simple /blog/ page, that’ll show the title, body, date, number of comments.. and let the link be clickable so they can go see the comments on it.  Should be easy.. wish I hadn’t blown away the sample data, and I can’t seem to find any other sample EE blog code on the web, though I’m sure virtually everyone is doing something like I just described.

    Little help please?  Still learning my way around EE, obviously. 😊

  • #2 / Jan 27, 2011 11:17am

    Sue Crocker

    26054 posts

    Hi, BilldaCat.

    Are you including a link to an actual entry in your url?

    Something like this:

    http://example.com/index.php/blog/comments/name-of-post ?

    EE requires that there be something in the third segment.

    Does that help?

  • #3 / Jan 27, 2011 12:40pm

    BilldaCat

    6 posts

    Sadly no luck.

    Tried this:

    domain/blog—shows all blog entries, but no body text for any of them, though the {body} tag is used.
    domain/blog/post_title—shows individual post, comment box, no {body}
    domain/blog/post_title/comments—shows individual post, comment box, no {body}

    I must be doing something simple wrong.. are there some other sample blog templates floating around?

  • #4 / Jan 28, 2011 2:20am

    John Henry Donovan

    12339 posts

    BilldaCat,

    First off you should not be nesting the exp:comment:form tag inside teh channel:entries tag. Move it outside and below it.

    What version and build of EE are you using? You can find this in the footer (not the EE Info Tab)

    For your Group Assignments for the channel blog make sure you have the correct custom field group linked.

    Make sure that the custom field is actually called body.
    Can you take a screen shot of the custom fields in that group please?

    I must be doing something simple wrong.. are there some other sample blog templates floating around?

    Have a look in /themes/site_themes/agile_records/ and you can see a load of example templates. Try the news group for good examples

  • #5 / Jan 28, 2011 9:45am

    BilldaCat

    6 posts

    Thanks!  I was using the Agile Records to base stuff off on, and just realized it’s {news_body}, so changed that and good to go.

    Sadly I overwrote my agile records blog page with some other stuff I was doing, so I don’t have that back to refer to—so if anyone has that and can post/send it to me, I’d love to see it again… not sure how I’d do that short of installing a whole ‘nother copy of EE.

  • #6 / Jan 28, 2011 10:17am

    Ingmar

    29245 posts

    Glad to see that resolved the issue for you. Please post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases