b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Back-office Reference
  3. Collections
  4. Contents
  5. Short Tags Reference
  6. [include:] Short Tag

[include:] Short Tag

Built-in Feature / Renderer Plugin

This "short tag" allows displaying a Content Block within the content of any Item/Post or even another Content Block.

It has an alias [cblock:] Short Tag.

IMPORTANT: [include:] is actually processed by the Include Content Block Plugin (and the built-in short tag exists only as a fallback TODO to be removed at some point) because using a renderer plugin allows to include content before other renderer execute, for example the Table of Contents Plugin.

Note: [include:content-block-slug] includes content from another Item, which may contain one or more block elements (<div>...</div> or <p>...</p>). The whole content block also gets wrapped into a wrapping <div>. Therefore this tag cannot appear inside a paragraph. (b2evolution will automatically move it out of the paragraph).

Syntax Breakdown

[include: Item ID or slug [ : template_code ] [ :. Class Name(s) ] ]

  • Item ID or slug: ID or slug of the Item to include. It must have content Type "Content Block".
  • Template code : Optional Code name of Quick Template to use to format the display of the Content Block. Default template cblock_clearfix is used if this option is not provided.
  • Class Name(s) : Optional CSS class name(s). The class name must start with a dot. Multiple class names can be specified, separated by a dot. See CSS Classes
    • The CSS classes will be injected into a wrapping <div>. See $cb_class$ in the technical info below.
    • The class .* will be replaced with item slug automatically.

Examples

  • [include:123]
    Display a content block Item with ID #123
  • [include:content-block-slug]
    Display a content block Item with slug content-block-slug. The content block will be wrapped with the default "clearfix" template.
  • [include:content-block-slug:cblock_noclearfix]
    Display a content block Item with slug content-block-slug by using a different wrapper template, in this case to avoid "clearfix".
  • [include:content-block-slug:.*.alert.alert-warning]
    Display the content block in an orange warning box (using default Bootstrap CSS styles)
  • [include:content-block-slug:.class1.*.class3]
    Display a content block Item with slug content-block-slug in wrapper similar to:
    <div class="class1 content-block-slug class3">Item content block text</div>

Technical info

The contents of the content block will be wrapped using these Container Params:

'content_block_start'         => '<div class="evo_content_block $cb_class$">',
'content_block_end'           => '</div>',
'content_block_before_images' => '<div class="evo_content_block_images">',
'content_block_after_images'  => '</div>',
'content_block_before_text'   => '<div class="evo_content_block_text">',
'content_block_after_text'    => '</div>',

Which mean we get something like this:

<div class="evo_content_block $cb_class$">',
  <div class="evo_content_block_images">
  ...the teaser image(s) of the content block...
  </div>
  <div class="evo_content_block_text">
  ...the text/paragraphs of the content block... 
  </div>
</div>

Restrictions

  • The referenced Item must exist
  • The referenced Item must be of Item Usage content block
  • The Visibility status of the content block Item cannot be higher than status of the current/parent Item,
    See below the ordered list of visibility statuses by weight:
    • Redirected
    • Public
    • Community
    • Deprecated
    • Protected
    • Private
    • Draft
    • Review
      For example, if content block Item has a status "Public" but current/parent Item has a status "Community",
      then such content block Item cannot be included into the current/parent Item.
  • At least one of the following permissions must be true:
    • The Content block has the same owner as the parent Item
    • The Content block has the same owner as the parent Item’s Collection
    • The Content block Item is in the same collection as the parent Item
    • The Content block Item is in the shared content blocks collection.
Tags: 7.1.0
Created by yurabakhtin • Last edit by fplanque on 2020-04-08 01:05 • •

No feedback yet

On this page

  • Built-in Feature / Renderer Plugin
  • Syntax Breakdown
  • Examples
  • Technical info
  • Restrictions

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
    • Site
    • Collections
      • Collection Dashboard
      • Contents
        • Post Browsing Screens
        • Post Edit Screen
        • Short Tags Reference
          • Helper CSS Classes
          • Custom Fields Short Tags
          • [audio:]
          • [cblock:]
          • [div:]
          • [emailcapture:]
          • [file:]
          • [image:]
          • [include:]
          • [inline:]
          • [pagebreak]
          • [poll:]
          • [subscribe:]
          • [switcher:]
          • [teaserbreak]
          • [thumbnail:]
          • [video:]
        • Post Concepts
        • Mass Edit
        • Mass Post Contents
        • Other post actions
        • Renderers Reference
      • Comments
      • Categories
      • Features
      • Skins
      • Widgets
      • Settings
      • Creating a new collection
    • Files
    • Analytics
    • Users
    • Messages
    • Emails
    • System
    • Working with Results Tables
  • Developer Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
  • Archives
Social CMS

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque