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.
Urd Fluidhelper¶
Created: | 2014-05-09T11:11:32 |
---|---|
Changed: | 2014-05-12T13:20:33.620000000 |
Classification: | urd |
Keywords: | urd, viewhelper, render content, language menu, menu tree, menu breadcrumb, rootline, image, linktype, typolink, set variables, trim, page infos, string replace |
Author: | Stephan Langenegger |
Email: | admin@stibo.ch |
language: | en |
Urd Fluidhelper¶
Extension Key: urd
Language:
Version: 1.0.5
Keywords: urd, viewhelper, render content, language menu, menu tree, menu breadcrumb, rootline, image, linktype, typolink, set variables, trim, page infos, string replace
Copyright 2013, Stephan Langenegger, <admin@stibo.ch>
This document is published under the Open Content License
available from http://www.opencontent.org/opl.shtml
The content of this document is related to TYPO3
- a GNU/GPL CMS/Framework available from www.typo3.org
Table of Contents¶
`Urd Fluidhelper 1 <#__RefHeading__1027_1696583212>`_
`Introduction 3 <#__RefHeading__5710_1738894311>`_
`Namespace 4 <#__RefHeading__3150_1854705220>`_
`ViewHelpers 5 <#__RefHeading__467_413120346>`_
`ChangeLog 12 <#__RefHeading__31623_818911409>`_
Introduction¶
What does it do?¶
Urd Fluidhelper offers a few useful ViewHelpers for Fluid:
- Render a content element by uid
- Get a language menu as array
- Get the current language
- Get a breadcrumb menu as array
- Get a recursive menu tree as array
- Check if a page is in another pages rootline
- Images without fixed dimensions
- Get the type of a link (page, extern, email etc.)
- Create a dynamic link according to its type (extern = _blank etc.)
- Trims a string and remove multiple whitespaces
- Sets variables within a fluid template
- Get page-infos from a single page
- Replace strings
Namespace¶
The following namespace must be defined on top of every fluid template in which you use an urd viewhelper:
{namespace urd=Tx_Urd_ViewHelpers}
ViewHelpers¶
content.render¶
Render a content element from tt_content by its uid .
Example¶
<urd:content.render uid=”123” />
Returns¶
The complete HTML code of the content element.
image¶
Creates an image. Identically to the default image fluidhelper, except for one argument (showSizeAttr = false), which makes the image fluid.
OnlySrc allows you to output only the image-url, without the a tag. Useful for custom tags or background images.
Example¶
<urd:image src=”{image}” showSizeAttr=”false” />
Arguments¶
showSizeAttr¶
Property
showSizeAttr
Data type
boolean
Description
Add width and height attribute to the img-tag if true.
Default
true
onlySrc¶
Property
onlySrc
Data type
boolean
Description
If true, only the image url will be returned, without a-tag
Default
false
Returns¶
The HTML code (onlySrc = false) or the image url (onlySrc = true).
language.current¶
Gets the current page language as array. If you define a field, then only the value from this field will be returned.
Example¶
<urd:language.current defaultLanguage=”Deutsch” />
Arguments¶
defaultLanguage¶
Property
defaultLanguage
Data type
string
Description
The Name of the default language
Default
required
useCacheHash¶
Property
useCacheHash
Data type
boolean
Description
Use typolink chash
Default
true
field¶
Property
field
Data type
string
Description
The name of a single field
Default
„“
Returns¶
The language as array (field = „“) or the defined single field.
language.list¶
Gets a language list array containing all the available languages for the current page.
Example¶
<urd:language.list defaultLanguage=”Deutsch” />
Arguments¶
defaultLanguage¶
Property
defaultLanguage
Data type
string
Description
The Name of the default language
Default
required
useCacheHash¶
Property
useCacheHash
Data type
boolean
Description
Use typolink chash
Default
true
showOnlyTranslated¶
Property
showOnlyTranslated
Data type
boolean
Description
Show only translated language
Default
true
showActive¶
Property
showActive
Data type
boolean
Description
Show the active language
Default
true
sorting¶
Property
sorting
Data type
string
Description
Sorted list of language ids
Default
null
Returns¶
The active languages as one-dimensional array.
page.info¶
Gets informations from a single page. If the field argument is defined, only this field will be returned. If not, you will receive an array containing all the available page-infos.
Example (all infos)¶
<urd:page.info pageUid=”24” />
Example (single info)¶
<urd:page.info pageUid=”24” field=”title” />
Arguments¶
pageUid¶
Property
pageUid
Data type
integer
Description
The page uid. Default is the current page id.
Default
$GLOBALS["TSFE"]->id
field¶
Property
field
Data type
mixed
Description
Name of a single field, if you only need one single page-info
Default
Returns¶
An array containing all page-infos if field is not defined, else an mixed value depending on which field you define.
set¶
Sets any variable within a fluid template. The variable can be invoked like normal fluid variables, just after the assignation.
Example (string)¶
<urd:set var=”stringvar” value=”var value” />
Example (array)¶
<urd:set var=”arrayvar” value=”{key:'value'}” />
Arguments¶
var¶
Property
var
Data type
string
Description
Name of the variable
Default
required
value¶
Property
value
Data type
mixed
Description
Value which should be assigned to the var.
Default
required
overwrite¶
Property
overwrite
Data type
boolean
Description
If false, already existing variables won't be overwritten
Default
true
Returns¶
Nothing.
typolink.type¶
Gets the type of a typelink (page, email, file, folder, extern)
Example¶
<urd:typolink.type link=”{link}” />
Returns¶
A string with the link type.
typolink.link¶
Creates an <a> tag by typolink. You can define individual tag- attributes for each of the following link types: page, email, file and external . You can also define a fallback-tag if the argument link is not a valid link.
Example¶
<urd:typolink.link link=”{link}” attributes=”{class:'link'}” />
Arguments¶
link¶
Property
link
Data type
string
Description
The typolink
Default
required
attributes¶
Property
attributes
Data type
array
Description
Additional attributes which will be addet to the <a> tag
Default
[]
noLinkTag¶
Property
noLinkTag
Data type
string
Description
The html tag-name (without < and >) which should be used if the link is empty or not defined
Default
attributesPageLink¶
Property
attributesPageLink
Data type
array
Description
Like the “attributes”-Argument, but this attributes will only be assigned, if the link is an internal page link
Default
[]
attributesEmailLink¶
Property
attributesEmailLink
Data type
array
Description
Like the “attributes”-Argument, but this attributes will only be assigned, if the link is an email link
Default
[]
attributesFileLink¶
Property
attributesFileLink
Data type
array
Description
Like the “attributes”-Argument, but this attributes will only be assigned, if the link is a file link
Default
[]
attributesExternalLink¶
Property
attributesExternalLink
Data type
array
Description
Like the “attributes”-Argument, but this attributes will only be assigned, if the link is an external link
Default
[]
Returns¶
The <a> tag as HTML code if the link is valid. Else the <a> tag will be replaced by the defined noLinkTag (if defined).
trim¶
Trims a string and removes multiple whitespaces.
Example¶
<urd:trim string=”{string}” all=”true” />
Arguments¶
string¶
Property
string
Data type
string
Description
The string which should be trimmed
Default
required
all¶
Property
all
Data type
boolean
Description
If true ALL multiple whitespaces will be removed from the string
Default
true
Returns¶
The trimmed string.
replace¶
Replaces a string inside a string with another string.
Example¶
<urd:replace subject=”i am a banana” search=”banana” replace=“tomatoe“ />
Arguments¶
search¶
Property
search
Data type
string
Description
The value being searched for
Default
required
replace¶
Property
replace
Data type
string
Description
The replacement value
Default
required
subject¶
Property
subject
Data type
string
Description
The string being searched and replaced on
Default
„“
Returns¶
The new replaced string.
ChangeLog¶
1.0.4¶
Version
1.0.4
Changes
Updated all ViewHelpers for TYPO3 6.2+
New argument overwrite added to the set -Viewhelper
New ViewhHelper replace
New ViewHelper language.current
New ViewHelper language.list
Fixed the typolink.type detection Function
1.0.3¶
Version
1.0.3
Changes
New ViewHelper trim New ViewHelper set New ViewHelper page.info New argument hideDoktypes added to the menu.tree -ViewhelperNew argument reverse, startLevel and showLast added to the menu.breadcrumb -ViewhelperNew argument onlySrc added to the image -ViewhelperNew arguments noLinkTag, attributesPageLink, attributesEmailLink, attributesFileLink and attributesExternalLink added to the typolink.link -Viewhelper
1.0.2¶
Version
1.0.2
Changes
Manual fixed and new extension icon added
1.0.1¶
Version
1.0.1
Changes
First stable release.