DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

Change and editing templates

EXT:int_blog is using fluid as template engine. If you are used to fluid already, you might skip this section.

This documentation won't bring you all information about fluid but only the most important things you need for using it. You can get more information in books like the one of Jochen Rau und Sebastian Kurfürst or online, e.g. at http://wiki.tpyo3.org/Fluid or many other sites.

Change the templates using TypoScript constants

You can use the settings from extension manager to change the paths

plugin.tx_intblog {
    settings {
        # cat=plugin.tx_intblog//80; type=text; label=Template folder
        templatesFolder = /Templates

        # cat=plugin.tx_intblog//90; type=text; label=Partial folder
        partialFolder = /Partials

        # cat=plugin.tx_intblog//100; type=text; label=Layout folder
        layoutFolder = /Layouts

        # cat=plugin.tx_intblog//110; type=text; label=Themes folder
        themesFolder = Themes/

        # cat=plugin.tx_intblog//120; type=text; label=Default Theme
        defaultTheme = Events
    }
}

Thems, Layouts, Templates & Partials

If using fluid, the templates are structured by using Layouts, Templates and Partials.

Theme

Themes are used to structure the output in many ways. You can add themes to have a different output in frontend.

Some examples for themes: Events Theme for different type of event (conference, wedding, etc), Recipe Theme , Technical Theme, etc

Layouts

Layouts are used to structure the output of a plugin. A simple example is to wrap every output with the same <div> element. Therefore it is not needed to repeat this code and write it only once.

A layout can look this:

<div class="tx-int-blog">
 <f:render section="main"/>
</div>

This means that the output of the section main will be rendered inside a div with the id tx-int-blog.

Templates

Every action needs its own template which can be found at Templates/<Model>/<ActionName>.html.

If Layouts are used, it is required to define the name of the Layout (which is identical to the file name of the Layout file).

<f:layout name="Default" />

<f:section name="main">
 This will be rendered
</f:section>

Partials

Partials are used within templates to be able to reuse code snippets.

Sections

Sections are very similar to partials. The difference is that sections are defined in the same file as the template.

ViewHelpers

Ever fluid viewhelper starts with <f: . and you can always check out the code at typo3/sysext/fluid/Classes/ViewHelpers/. As an example the viewhelper <f:link.page can be found at typo3/sysext/fluid/Classes/ViewHelpers/Link/PageViewHelper.php.

Any other viewhelpers from other extensions can be used by using a namespace declaration like

{namespace wh=In2itive\IntBlog\ViewHelpers}

Then viewHelpers of EXT:int_blog (which can be found in int_blog/Classes/ViewHelpers) can be used with the prefix wh: .