Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
teraßyte Posted March 11, 2022 Posted March 11, 2022 (edited) Using the Form helper there's an option (the 4th one) to pass additional attributes as an array. Passing a single attribute is okay, but if you pass multiple ones the attributes are all attached with no space separating them. The fix is to edit the template "\applications\core\dev\html\admin\forms\template.phtml" on line 2: <form accept-charset='utf-8' data-formId="{$id}" action="{$action}" method="post" {{if $uploadField}}enctype="multipart/form-data"{{endif}} data-ipsForm class="{$formClass}" {{foreach $attributes as $k => $v}}{$k}="{$v}"{{endforeach}} {{if \count($tabArray) > 1}}novalidate="true"{{endif}}> You need to add a space inside the $attributes foreach (adding one before {{endforeach}} is enough): {{foreach $attributes as $k => $v}}{$k}="{$v}" {{endforeach}} === EDIT: Well, right after posting I decided to try a mass search with a partial text and it seems that are a lot more locations that aren't adding a proper space when there are multiple attributes provided: {{foreach $attributes as $k Some use $k / $v, some other templates use $key / $value, etc. My search returned 47 results in 45 different files. 😋 Edited March 11, 2022 by teraßyte
teraßyte Posted December 17, 2023 Author Posted December 17, 2023 I figured I'd bump this one as a reminder for v5. 😛 I use attributes in several custom applications, and I always have to remember to add spaces for them to work. 🙄 Afrodude and SeNioR- 1 1
Recommended Posts