[TYPO3-english] Resize images, imageLinkWrap, cursor: -moz-zoom-out;

mario m at mariochiari.net
Sat Feb 13 11:51:49 CET 2010


Hello


I would like to update you on how I solved my problem. What I need is
typolink. I have a couple of comments on TSRef too.

1. To define listView and singleView for my extension, I define the FE
html output for each field according to its TCA definition, by cases
according to the TCA type. For the case group/file/'gif,png,jpeg,jpg', I
am able to implement what I wish -- to let a user pop-up images on a new
window such that -moz-zoom-out/in works --  thanks to typolink. (I am
still unable to get what I want by imageLinkWrap)

My code is:

* output html for single item, according to $TCA typo 
*
* @param	string		$field: the field from the db
* @param	string		$mode: either listrow or singleview, 
* @param	array		$conf: The PlugIn Configuration
* @return

function makeCellContentAccordingToTCAConfig($field, $mode, $conf)	 { 
$this->conf = $conf;  
$out = '';
$table = 'tx_myPlugin';

$switch = $GLOBALS['TCA'][$table]['columns'][$field]['config']['type'];
	switch($switch) {
........
case 'group':
$internal_type =
$GLOBALS['TCA'][$table]['columns'][$field]['config']['internal_type'];
$allowed =
$GLOBALS['TCA'][$table]['columns'][$field]['config']['allowed'];
if($internal_type == 'file'){
if($allowed=='gif,png,jpeg,jpg'){
	
$imgTSConfig['coverimgObject']['file']=
$GLOBALS['TCA'][$table]['columns'][$field]['config']['uploadfolder'].'/'.$this->getFieldContent($field);

$imgTSConfig['coverimgObject']['altText'] = 'alt_text:
'.$this->getFieldContent($field);

$imgTSConfig['coverimgObject']['file.']['width'] = '125';

$imgTSConfig['coverimgObject']['stdWrap.']['typolink.']['parameter'] =
''.$GLOBALS['TCA'][$table]['columns'][$field]['config']['uploadfolder'].'/'.$this->getFieldContent($field).' 300x600:resizable=0,location=0';

$imgTSConfig['coverimgObject']['stdWrap.']['typolink.']['JSwindow_params']= 'status=1,menubar=0,scrollbars=1,directories=0,toolbar=0';

$out .=
'<span'.$this->pi_classParam($mode.'Field-typo_'.$field).'>'.$this->cObj->IMAGE($imgTSConfig['coverimgObject']).'</span>';}
break;
......
}
return $out;
}


2. On TSref. I took me a while to understand how typolink works. The
TSref description 
http://typo3.org/documentation/document-library/references/doc_core_tsref/4.4.0/view/1/5/#id2507528
seems to me somehow confusing. 

For example the following sentence is very unclear:
"Target is normally defined by the "extTarget" and "target" properties
of typolink. But you may override this target by adding the new target
after the parameter separated by a whitespace. Thus the target becomes
the second parameter."
 
The above sentence is down below into the description box for the
parameter property of typolink. Nowhere above it, it is very clear that
the parameter property may have up to four values (or better, a four
parts value: linked-resource, target, class, title), and how you need to
separate them just by whitespaces. 

------------
That's all
It is sunny day
my best wishes
mario





More information about the TYPO3-english mailing list