user1569800
user1569800

Reputation: 61

What is the difference between include tags and embed tags in expressionengine?

The discussion forum module for expression engine uses {include:file} tags in its templates like in forum_themes/developer/forum_index/main_forum_list.html:

{include:table_heading}
{include:table_rows}
{include:table_footer}

I've searched for the include tag documentation but I can't find it anywhere? What is the include tag and when/where should it be used? Is it specific to the discussion forum module?

Upvotes: 6

Views: 354

Answers (5)

markjohn
markjohn

Reputation: 1

In addition to embedding templates within each other, you can also create shared layouts for your templates. A layout can be thought of as a wrapping template or a reverse embed. To use a template you use the {layout=""} tag at the top of your template:

{layout="template_group/template"}

Upvotes: 0

Anna_MediaGirl
Anna_MediaGirl

Reputation: 1120

There is no documentation on the {include:XXX} tag as it is only used in the Forum templates.

You will never use this tag in normal EE templates. In EE templates you will use an {embed="group/template"} tag or a Snippet depending on your needs.

Upvotes: 4

CreateSean
CreateSean

Reputation: 1386

Forums are quite difficult to customize and there is very little documentation but the include for forums essentially acts as an embed.

For customizing your forums I would recommend looking at using at the Scaffold Theme on Devot:ee

Upvotes: 8

A Herrera
A Herrera

Reputation: 612

It should also be noted that {include:file} only work in the forum template code and most standard EE tags (such as the {embed} tag) don't work in the forum templates. Why? I don't know, but dems da rules. :)

Upvotes: 7

Allan Kukral
Allan Kukral

Reputation: 101

I cannot speak to the scope of the {include:file} tag but for most purposes the {embed} tag is what you will be using in ExpressionEngine to include/embed other bits of code.

Other alternatives, depending on the information you would like to include in your page, are the Snippets, Global Variables, or for more complex information LowVariables

Upvotes: 9

Related Questions