Feature #60794
closed
New type for ext_conf_template.txt
Added by Anonymous over 10 years ago.
Updated about 9 years ago.
Description
For some configurations it'll be handy to have textareas instead of only input fields to edit them in the extension manager.
I think this can be achieved by simply adding "textarea" to this ViewHelper: typo3/sysext/extensionmanager/Classes/ViewHelpers/Form/TypoScriptConstantsViewHelper.php
I just needed the same. I helped me that way (workaround):
in ext_conf_template.txt:
# cat=basic; type=user[JWeiland\Jwparking\Configuration\TextArea->render]; label = LLL:EXT:jwparking/Resources/Private/Language/ExtConf.xlf:parkingTitles
parkingTitles =
And my new Textarea-Object:
<?php
namespace JWeiland\Jwparking\Configuration;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extensionmanager\ViewHelpers\Form\TypoScriptConstantsViewHelper;
/**
* @package jwparking
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*
*/
class TextArea {
/**
* Tag builder instance
*
* @var \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder
*/
protected $tag = NULL;
/**
* constructor of this class
*/
public function __construct() {
$this->tag = GeneralUtility::makeInstance('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder');
}
/**
* render textarea for extConf
*
* @param array $parameter
* @param TypoScriptConstantsViewHelper $parentObject
* @return string
*/
public function render(array $parameter = array(), TypoScriptConstantsViewHelper $parentObject) {
$this->tag->setTagName('textarea');
$this->tag->forceClosingTag(TRUE);
$this->tag->addAttribute('cols', 45);
$this->tag->addAttribute('rows', 7);
$this->tag->addAttribute('name', $parameter['fieldName']);
$this->tag->addAttribute('id', 'em-' . $parameter['fieldName']);
if ($parameter['fieldValue'] !== NULL) {
$this->tag->setContent(trim($parameter['fieldValue']));
}
return $this->tag->render();
}
}
Stefan
Thanks alot Stefan for sharing your solution.
The type=textarea should definately taken into the core!
- Status changed from New to Closed
a new ticket was created for this. Closed as duplicate of #69202
This patch has a patch in review.
Also available in: Atom
PDF