Return to Snippet

Revision: 64342
at July 26, 2013 03:57 by cawil


Updated Code
<?php
if (!defined('TYPO3_MODE')) {
	die ('Access denied.');
}

$tempColumns = array (
    'tx_someextension_somecolumn' => array (
        'exclude' => 0,
        'label' => 'My Link Field',
        'config' => array (
            'type'     => 'input',
            'size'     => '15',
            'max'      => '255',
            'checkbox' => '',
            'eval'     => 'trim',
            'wizards'  => array(
                '_PADDING' => 2,
                'link'     => array(
                    'type'         => 'popup',
                    'title'        => 'Link',
                    'icon'         => 'link_popup.gif',
                    'script'       => 'browse_links.php?mode=wizard',
                    'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1',
		    'params'   => array(
		        'blindLinkOptions' => 'file,mail,folder'
       		    )
                )
            )
        )
    ),
);


t3lib_div::loadTCA('pages');
t3lib_extMgm::addTCAcolumns('pages',$tempColumns,1);
t3lib_extMgm::addToAllTCAtypes('pages','tx_someextension_somecolumn;;;;1-1-1');
t3lib_extMgm::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'Mobile Counterparts');


?>

Revision: 64341
at July 26, 2013 03:57 by cawil


Updated Code
<?php
if (!defined('TYPO3_MODE')) {
	die ('Access denied.');
}

$tempColumns = array (
    'tx_someextension_somecolumn' => array (
        'exclude' => 0,
        'label' => 'My Link Field',
        'config' => array (
            'type'     => 'input',
            'size'     => '15',
            'max'      => '255',
            'checkbox' => '',
            'eval'     => 'trim',
            'wizards'  => array(
                '_PADDING' => 2,
                'link'     => array(
                    'type'         => 'popup',
                    'title'        => 'Link',
                    'icon'         => 'link_popup.gif',
                    'script'       => 'browse_links.php?mode=wizard',
                    'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1',
					'params'   => array(
						'blindLinkOptions' => 'file,mail,folder'
					)
                )
            )
        )
    ),
);


t3lib_div::loadTCA('pages');
t3lib_extMgm::addTCAcolumns('pages',$tempColumns,1);
t3lib_extMgm::addToAllTCAtypes('pages','tx_someextension_somecolumn;;;;1-1-1');
t3lib_extMgm::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'Mobile Counterparts');


?>

Revision: 64340
at July 26, 2013 03:56 by cawil


Initial Code
<?php
if (!defined('TYPO3_MODE')) {
	die ('Access denied.');
}

$tempColumns = array (
    'tx_someextension_somecolumn' => array (
        'exclude' => 0,
        'label' => 'My Link Field',
        'config' => array (
            'type'     => 'input',
            'size'     => '15',
            'max'      => '255',
            'checkbox' => '',
            'eval'     => 'trim',
            'wizards'  => array(
                '_PADDING' => 2,
                'link'     => array(
                    'type'         => 'popup',
                    'title'        => 'Link',
                    'icon'         => 'link_popup.gif',
                    'script'       => 'browse_links.php?mode=wizard',
                    'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1',
					'params'   => array(
						'blindLinkOptions' => 'file,mail,folder'
					)
                )
            )
        )
    ),
);


t3lib_div::loadTCA('pages');
t3lib_extMgm::addTCAcolumns('pages',$tempColumns,1);
t3lib_extMgm::addToAllTCAtypes('pages','tx_mobilecounterparts_mobile_counterpart;;;;1-1-1');
t3lib_extMgm::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'Mobile Counterparts');


?>

Initial URL

                                

Initial Description
This example adds a link field to every page's 'Extended' properties tab.

The example shows only the 'Page' and 'External URL' options in the link selection GUI. The contents of blindLinkOptions are the fields that will be hidden in the link wizard. Your options for that list are:

* file 
* mail 
* page
* folder 
* url

Similar to blindLinkOptions, you an set an *allowedExtensions* element in the params array, with a comma-separated list of allowed file extensions. By default, all extensions are allowed.

Initial Title
Allow only certain link types in TYPO3 link wizard

Initial Tags

                                

Initial Language
TYPO3