Skip to content
This repository has been archived by the owner on Mar 4, 2019. It is now read-only.
/ mak_dataviewhelpers Public archive

TYPO3 View Helpers for TYPO3 6.x and 7.x to help render stuff.

Notifications You must be signed in to change notification settings

mkalus/mak_dataviewhelpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

TYPO3 View Helpers for TYPO3 6.x and 7.x to help render stuff.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages