I saw in Expression Engine I can use {embed:title} and {site_name} variables, but now I need a variable to pull an excerpt or description of the article itself. Is there such a variable/tag?
Asked
Active
Viewed 885 times
2 Answers
2
ExpressionEngine tags are based solely on custom fields which you yourself have defined. So in the field group for your "articles" channel, you'll have some fields, maybe {article_summary}
, {article_body}
, {article_image}
, etc. To display your summary, just use {article_summary}
in your template.
I'm assuming that you're coming from something like WordPress maybe, where every piece of content has the_content()
and the_excerpt()
... aside from a handful of global variables, and some fields which are universal to all entries (like {title}
, {entry_date}
, etc), ExpressionEngine isn't like that. You define what fields you use for each channel - you have complete control.

Derek Hogue
- 4,589
- 1
- 15
- 27
-
Thank you for answering. Yes, I am coming from WordPress and have been dropped into EE with no life raft, so to say. :) What you're describing sounds like it would be an additional field an editor would have to fill in order to get an excerpt of an article. Seems to be there should be another way to automatically pull this from the article itself. There's nothing like this in EE? – Yazmin Apr 26 '12 at 01:22
-
It all depends on what fields exist. If all you have available to you is an "article" field which contains the full text of your content, then you could use one of the many excerpt-type plugins available on devot:ee. I'd suggest [Hacksaw](http://devot-ee.com/add-ons/hacksaw). – Derek Hogue Apr 26 '12 at 03:59
0
Here is the actual code you have to include in your EE template.
{exp:channel:entries channel="article" limit="5" dynamic="no"}
<div class="home_thumb">
<h1><a href="{title_permalink="post/articles"}">{title}</a></h1>
<div class="home_thumb_img">
<a href="{title_permalink="post/articles"}"><img src="{article_image}"></a>
{if article_content}
<p>{article_content}</p>
{/if}
</div>
</div>
{/exp:channel:entries}

Abbas
- 552
- 5
- 8