logic:include
AJAX
ajax:delayedload ajax:event ajax:navigation ajax:region
Data
data:calendar data:column data:eventrepeater data:postrepeater data:productbrandrepeater data:productcategoryrepeater data:productrepeater data:repeater data:table data:template data:tree
Forms
forms:address forms:captcha forms:checkbox forms:checkboxgroup forms:codeeditor forms:combobox forms:datepicker forms:dialogbox forms:editbox forms:fileupload forms:form forms:hidden forms:money forms:officeuseregion forms:option forms:password forms:paymentmethod forms:radiobutton forms:radiobuttongroup forms:row forms:searchbox forms:signature forms:slider forms:spinbox forms:submitbutton forms:submitimage forms:submitlink forms:successcontent forms:textarea forms:timepicker
Layout
layout:gallery layout:productgallery layout:rotator layout:stepper layout:stepperpanel layout:tablist layout:tablistitem
Logic
logic:dependency logic:else logic:if logic:include
ATTRIBUTES
EXAMPLES
logic:parse logic:variable
Navigation
navigation:breadcrumbs navigation:item navigation:primary navigation:secondary
Personalisation
personalisation:firstname personalisation:fullname personalisation:lastname personalisation:other
Standard
standard:audio standard:embed standard:icon standard:image standard:link standard:script standard:tooltip standard:video
Templates
templates:button templates:card templates:column templates:fancybox templates:faq templates:flexlayout templates:header templates:row templates:section templates:styles templates:teammember templates:testimonial
Regions
regions:content regions:contentadditional regions:security regions:togglable
Third Party
thirdparty:googlemap thirdparty:googlemapmarker

<logic:include />

Include the content of a page.

Often used to reduce duplicate content, where the same content needs to be shown in multiple places throughout a site.

For organisation, developers often create a new hidden page /includes/, and child pages are included in various locations through pages or in a website design.

As an example, if you needed a newsletter sign-up form shown in multiple places throughout a website, create the form on a page, and then simply include that page where needed with <logic:include page="/includes/newsletter/" />

Attributes

page
string
The page_id of the page to be included.

Examples

Include the Contents of a Page

The contents of /includes/newsletter/ will be included in place of this tag.

HTML:

<logic:include page="/includes/newsletter/" />

Query String Injection

You can pass query string parameters to the included page.

HTML:

<logic:include page="/includes/product-banner/?product_id=4" /> From within /includes/product-banner/ the value of $_GET['product'] will be set to 4.

Repeat Child Pages as Rotator Slides

Demonstrates the use of a data repeater to populate rotator slides with the content of pages.

HTML:

<div class="section-homeBanner"> <layout:rotator id="featured_rotator" startatrandom="false" movenextid="featured_rotator_next" movepreviousid="featured_rotator_previous"> <ul> <data:repeater datasource="\Components\Website\Pages::getChildren('/includes/slider/')" as="slider"> <li> <logic:include page="[? $slider['page_id'] ?]" /> </li> </data:repeater> </ul> </layout:rotator> <div class="rotator_navigation"> <span class="leftArrow"><a href="#" id="featured_rotator_previous"><standard:icon library="fontawesome" iconstyle="solid" iconname="chevron-left" size="4" style="width: 50px; height: 50px;" /></a></span> <span class="rightArrow"><a href="#" id="featured_rotator_next"><standard:icon library="fontawesome" iconstyle="solid" iconname="chevron-right" size="4" style="width: 50px; height: 50px;" /></a></span> </div> </div>

Repeat Child Pages as a Set of Tabs

Demonstrates the use of a data repeater to populate tabs with the content of pages.

HTML:

<layout:tablist> <data:repeater as="page" datasource="\Components\Website\Pages::getChildren('/includes/tabs/')"> <layout:tablistitem id="tab_[? $page['_index'] ?]" title="[? $page['page_title'] ?]"> <logic:include page="[? $page['page_id'] ?]" /> </layout:tablistitem> </data:repeater> </layout:tablist>