Skip to content
This repository has been archived by the owner. It is now read-only.
TYPO3 View Helpers for TYPO3 6.x and 7.x to help render stuff.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Classes/ViewHelpers
.gitignore
README.md
ext_emconf.php
ext_icon.gif
ext_localconf.php

README.md

mak_dataviewhelpers

Extension for TYPO3 with my own view helpers. Description below.

Using the View Helpers

Namespace:

{namespace dv=AUXNET\MakDataviewhelpers\ViewHelpers}

CachedViewHelper

Example:

<dv:cached key="show_stuff_123" lifetime="120">Stuff</dv:cached>

Parameters:

  • key unique cache key
  • lifetime cache lifetime in seconds (0 = default as per page)
  • tags optional cache tags
  • noCache if value is set in this parameter, do not cache entry

Put content into TYPO3 cache with a certain key and lifetime. Great to speed up rendering complex elements. Type of cache can be set by (re-)defining following TYPO3 config variable:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['mak_dataviewhelpers']
// example: turn on Redis cache for my cached view parts
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['mak_dataviewhelpers']['backend']
    = 'TYPO3\\CMS\\Core\\Cache\\Backend\\RedisBackend';

CategoriesViewHelper

Example:

<dv:categories categories="12" firstOnly="true" titleOnly="true" />

Parameters:

  • categories single uid or array of uids
  • pid single page uid containing categories
  • firstOnly true/false, only return first element (instead of array of elements)
  • titleOnly true/false, return title only (either string or array of strings)
  • as set variable name to set variable instead of returning elements

Returns either array of elements, single entry, string or output. If nothing is found, null is returned.

CompactViewHelper

Example:

<dv:compact>blah</dv:compact>

Strips extra whitespace from content to compact output in order to save bandwidth.

LoadEntitiesViewHelper

Example:

<dv:loadEntities repository="AUXNET\MakDataviewhelpers\Domain\Repository\XYZRepository" pid="38" />

Parameters:

  • repository full repository name, e.g. AUXNET\MakDataviewhelpers\Domain\Repository\XYZRepository
  • uid single entity uid (will return single entry if found)
  • pid single page uid containing entities
  • orderByField order by this field
  • asc true/false, order ascending (or descending?)
  • limit limit to entities
  • as set variable name to set variable instead of returning elements

Load entities from any repository by specifying repository name and a few parameters.

You can’t perform that action at this time.