Download the PHP package traw/vhs-col without Composer
On this page you can find all versions of the php package traw/vhs-col. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package vhs-col
Short Description A collection of more or less useful ViewHelpers and Utilities
License GPL-3.0-or-later
Informations about the package vhs-col
vhscol
A collection of more or less useful ViewHelpers
Usage
Namespace is registered globally as vcol
URI Phone number
example with Address phone number
SVG
Render SVG Content
render a svg filereference as inline svg html
Svg VH
render SVG from given name, has typoscript config
Text
Pipe to BR
If you don't allow
e.g. in the header, you can use |
symbols. This vh replaces the | with
tag
Misc
Exension loaded
Condition if any extension key is loaded
TCA Options Map ItemsProcFunction
The field must have this itemsProcFunc registered:
\TRAW\VhsCol\Configuration\TcaOptionsMap::class . '->addOptions'
You can register multiple condtions per field, e.g. "add option A if condition A is met and option B if condition B is met"
Usage
For the table define the option map
For the field define one or more conditon/option array:
If you omit the condition array, the options will always be added
Condition Types
fields: the field matches one of the values
notFields: the field matches none of the values
functions: the function returns true
functions can either be parentPageProperties
or parentContainerProperties
Usage in tt_content
(e.g. Configuration/TCA/Overrides/tt_content.php)
Add the option if all of the following conditions are met
- Ctype=textmedia,
- colPos=0 or 1,
- parent page has doktype 100
- parent container (b13/container) has the CType "row-100" or "row-tabs"
Usage in pages
(e.g. Configuration/TCA/Overrides/pages.php)
Add the option 1 and 2 if the following conditions are met
- doktype is 1 (Standard page)
- the parent site is a root page
Add the option 3 and 4 if the following conditions are met:
- doktype is 1, 10 or 100
-
the parent page is not a root page
//Add itemsProcFunc to pages field $GLOBALS['TCA']['pages']['columns']['layout']['config']['itemsProcFunc'] = \TRAW\VhsCol\Configuration\TcaOptionsMap::class . '->addOptions'; $GLOBALS['TCA']['pages']['tx_vhscol_option_map'] = [ 'layout' => [ [ 'conditions' => [ 'fields' => [ 'doktype' => [1], ], 'functions' => [ 'parentPageProperties' => [ 'is_siteroot' => [1] ], ], ], 'options' => [ ['label1', 'dbvalue1'], ['label2', 'dbvalue2'], ], ], // Add the options if it's doktype 1 but the parent is not a root page [ 'conditions' => [ 'fields' => [ 'doktype' => [1,10,100], ], 'functions' => [ 'parentPageProperties' => [ 'is_siteroot' => [0] ], ], ], 'options' => [ ['label3', 'dbvalue3'], ['label4', 'dbvalue3'], ], ] ], ]; ``
Also works with other tables (news, address, etc.)
TODO:
- Documentation
All versions of vhs-col with dependencies
typo3/cms-core Version ^12 || ^13
typo3/cms-extbase Version ^12 || ^13
typo3/cms-fluid-styled-content Version ^12 || ^13
giggsey/libphonenumber-for-php Version ^8.12