Using File Fields Part 2: Templating

In this video, we will create our blog templates and use our file field in our loops.

In this video, we will create our blog templates and use our file field in our loops.

What We Do

  • Create our first Template Group
  • Explore the Channel Entries tag
  • Create our first channel entry tag in our template
  • Limit a channel entry with the url_title parameter
  • Add some design

Code Snippets

Channel Entries For Blog Loop

{exp:channel:entries channel="blog" limit="3" dynamic="no" disable="categories"}
    <h1>{title}</h1>
    <h2>{featured_image}</h2>
    {blog_content}
{/exp:channel:entries}

Channel Entries Loop With Segment

{exp:channel:entries channel="blog" url_title="{segment_3}"}
    <h1>{title}</h1>
    <h2>{featured_image}</h2>
    {blog_content}
{/exp:channel:entries}

File Field Implementation

{!-- You can do it as one tag --}
<img src="{featured_image}" />

{!-- Or as a tag pair --}
{featured_image}
    <img src="{url}" alt="{title}" />
{/featured_image}

Links

  • ExpressionEngine Segment Variable: https://docs.expressionengine.com/latest/templates/globals/url-segments.html#url-segment-variables
  • ExpressionEngine Channel Entries Tag: https://docs.expressionengine.com/latest/channels/entries.html#channel-entries-tag
  • See all of the site build in action in the Learn EE git repository.

Take It For A Test Drive

Get a free scan and start your trial today!

Additional Resources

Ready to dive in?
Start your free 15 day trial today.

Sign Up For Updates

We'll keep you in the loop of new features, resources, and articles!
We keep your info private.

© 2021 tripleNERDscore. All rights reserved.