This snippet renders a menu where every page is hidden, which has no content
for the current user.

If on an page is only content for specific groups, the menuitem will only be
shown for an user from that group.

Code:

lib.menu =HMENUlib.menu.1=TMENUlib.menu.1.NO.stdWrap{# if numRows returns 0# the menu item will not be renderdif.isTrue.numRows{
table = tt_contentselect.languageField = sys_language_uid
# field = uid# returns the id of the page, which should# be renderd at this pointselect.pidInList.field = uid
}}

This typoscript will render a graphical multi line stdHeader headline seperated
by the | char if exist. Dividing it in a COA of images will make it possible
to set a fix height of each line and no space more after it.

With IMG_RESOURCE you can manipulate an IMAGE via TYPO3 without outputting the
whole img-Tag. IMG_RESOURCE creates an Image in typotemp (f.e.
typo3temp/pics/134e7c7dd2.jpg). So you can use it then as an background-image.

2008-36 Show address information somewhere, but edit in an address element¶

by Martin Holtz, 2008-07-20 23:35:26, old #36, typoscript

Keywords:

tt_address, RECORDS, COA, TEXT, typolink

Description:

If you want to show an address information on your site on every page, you can
easily use tt_address for that.
You define an RECORDS Object and put it into an marker.
With "source" you define the id of the address element, with
conf.tt_address how it should be rendered.

This snippet exports all TemplaVoila Template Objects and Data Structures
associated with a specific template package to a T3D file.

Code:

$packageRow=t3lib_BEfunc::getRecord("tx_wectemplateadmin_package",$this->packageID);$this->export=t3lib_div::makeInstance('tx_wectemplateadmin_impexp');$this->export->init(0,'export');$this->export->setCharset($GLOBALS['LANG']->charSet);$this->export->extensionDependencies='templavoila';$this->export->showStaticRelations=0;$this->export->includeExtFileResources=0;$this->export->relStaticTables[]="tx_templavoila_datastructure";$this->export->includeExtFileResources=0;if($packageRow['thumbnail']){$this->export->addThumbnail(PATH_site.'uploads/tx_wectemplateadmin/'.$packageRow['thumbnail']);}t3lib_div::loadTCA('tx_templavoila_tmplobj');unset($GLOBALS['TCA']['tx_templavoila_tmplobj']['columns']['fileref']['config']['softref']);$uids=explode(',',$packageRow['records']);foreach($uidsas$uid){if($uid>0){$table='tx_templavoila_tmplobj';}else{$table='tx_templavoila_datastructure';$uid=abs($uid);}$recordRow=t3lib_BEfunc::getRecord($table,$uid);$this->export->export_addRecord($table,$recordRow);$this->export->export_addFilesFromRelations();// MUST be after the DBrelations are set so that file from ALL added records are included!$templateFolder=dirname(PATH_site.$recordRow['fileref']);}$this->export->export_addDBRelations();$this->export->setHeaderBasics();// Meta data setting:$this->export->setMetaData($packageRow['title'],$packageRow['description'],'',// Notes are empty$GLOBALS['BE_USER']->user['username'],$GLOBALS['BE_USER']->user['realName'],$GLOBALS['BE_USER']->user['email']);if($packageRow['filename']){$filename='uploads/tx_wectemplateadmin/'.$packageRow['filename'];}else{$filename='uploads/tx_wectemplateadmin/templateexport_'.date('YmdHi').'t3d';}// Now the internal DAT array is ready to export:// Write export$out=$this->export->compileMemoryToFileContent('t3d');t3lib_div::writeFile(PATH_site.$filename,$out);return$filename;

This can be used if you have a Flexform field where a backend user enters
Typoscript that only pertains to that single instance of the plugin, not all
instances on the page.

Code:

$flexformTyposcript=$this->pi_getFFvalue($piFlexForm,'myTS','s_TS_View');if($flexformTyposcript){require_once(PATH_t3lib.'class.t3lib_tsparser.php');$tsparser=t3lib_div::makeInstance('t3lib_tsparser');// Copy conf into existing setup$tsparser->setup=$this->conf;// Parse the new Typoscript$tsparser->parse($flexformTyposcript);// Copy the resulting setup back into conf$this->conf=$tsparser->setup;}