content tag

   Purpose

This is where the content for your page will be displayed. It's inserted into the template and changed based on the current page being displayed.

   How to use?

Just insert the tag into your template like:

{content}

The default block {content} is required to work correctly (so without the block-parameter). To give the block a specific label, use the label-parameter. Additional blocks can be added by using the block-parameter.

   Available parameters

  • block - Allows you to have more than one content block per page. When multiple content tags are put on a template, that number of edit boxes will be displayed when the page is edited.
    Example: {content block='second_content_block' label='Second Content Block'}
    Now, when you edit a page there will a textarea called "Second Content Block".
  • wysiwyg (true/false) - If set to false, then a wysiwyg will never be used while editing this block. If true, then it acts as normal. Only works when block parameter is used.
  • oneline (true/false) - If set to true, then only one edit line will be shown while editing this block. If false, then it acts as normal. Only works when block parameter is used.
  • size - Applicable only when the oneline option is used this optional parameter allows you to specify the size of the edit field. The default value is 50.
  • maxlength - Applicable only when the oneline option is used this optional parameter allows you to specify the maximum length of input for the edit field. The default value is 255.
  • default - Allows you to specify default content for this content block (additional content blocks only). You can't use a smarty string here!
    So {content block='third_content_block' default=$foo} is NOT valid
  • label - Allows specifying a label for display in the edit content page.
  • priority - Allows specifying an integer priority for the block within the tab.
  • tab - The desired tab to display this field on in the edit form.
  • assign - Assigns the content to a smarty parameter, which you can then use in other areas of the page, or use to test whether content exists in it or not.

    Example of passing page content to a User Defined Tag as a parameter:
    {content assign='pagecontent'} {table_of_contents thepagecontent=$pagecontent}

   Syntax examples

{$foo="{content}" scope=global}
{$foo} <!-- Show content block -->
{content block='second_block' label='My own name'}
{content block='third_block' label='My own name' wysiwyg='false' default='<p>Default content</p>'}
{$foo = "{content block='fourth_block' label='My own name' wysiwyg='false'}" scope=global}
{$foo} <!-- Show content block -->
{$bar = "{content block='fifth_block' label='My own name' wysiwyg='false'}"}

<!-- Only show content block when it has some content -->
{if !empty($bar)}
  {$bar}
{/if}