Reputation: 21
Help me i want to add link wizard in the backend module in front of the textfield without using TCA in typo3-7.6.9.
Upvotes: 1
Views: 685
Reputation: 7939
This could be possible as there has been a lot of changes regarding the JS and the form.
I quickly copied some code together which could be perfect for a base
<form name="editform">
<div class="form-wizards-element"><input type="text"
data-formengine-input-name="data[tx_news_domain_model_news][111][internalurl]"
value="" maxlength="255"
class="form-control t3js-clearable hasDefaultValue"/>
</div>
<div class="form-wizards-items">
<div class="btn-group"><a class="btn btn-default" href="#"
onclick="this.blur();vHWin=window.open('\/typo3\/index.php?route=%2Fwizard%2Flink%2Fbrowse\u0026token=970f35a8dc4409162cbcc22cbc0e6594074ac0b2\u0026P[params]=\u0026P[exampleImg]=\u0026P[table]=tx_news_domain_model_news\u0026P[uid]=111\u0026P[pid]=33\u0026P[field]=internalurl\u0026P[flexFormPath]=\u0026P[md5ID]=ID800c13a372\u0026P[returnUrl]=%2Ftypo3%2Findex.php%3Froute%3D%252Frecord%252Fedit%26token%3Db3d049b7b8bf49a7c89304b8ca24341be71120b1%26edit%5Btx_news_domain_model_news%5D%5B111%5D%3Dedit%26returnUrl%3D%252Ftypo3%252Findex.php%253FM%253Dweb_list%2526moduleToken%253D3dae7050436434ec90fe6376b230d7e43ded20c0%2526id%253D33%2526imagemode%253D1\u0026P[formName]=editform\u0026P[itemName]=data%5Btx_news_domain_model_news%5D%5B111%5D%5Binternalurl%5D\u0026P[hmac]=f1f3ba419c5ecf1bedce9656d521511cc0217a0a\u0026P[fieldChangeFunc][TBE_EDITOR_fieldChanged]=TBE_EDITOR.fieldChanged%28%27tx_news_domain_model_news%27%2C%27111%27%2C%27internalurl%27%2C%27data%5Btx_news_domain_model_news%5D%5B111%5D%5Binternalurl%5D%27%29%3B\u0026P[fieldChangeFunc][alert]=\u0026P[fieldChangeFuncHash]=c6a39ad17bdeac70cb33a3a0bccd0faa99e645c9'+'&P[currentValue]='+'&P[currentSelectedValues]=','popUpID800c13a372','height=600,width=800,status=0,menubar=0,scrollbars=1');vHWin.focus();return false;"><img
src="/typo3/sysext/backend/Resources/Public/Images/FormFieldWizard/wizard_link.gif" alt="Link"
title="Link"/></a></div>
</div>
</form>
The popup opens and the value is written back as well to the form. However some more work needs to be done:
Regarding the token, you can take a look at my news extension which uses e.g. that code
$token = FormProtectionFactory::get()->generateToken('moduleCall', 'web_NewsTxNewsM2');
I hope that helps
Upvotes: 3