[TYPO3-english] Typoscript: override for multiple checkboxes if these are checked: SOLVED!
Bert Hiddink [BENDOO e-work solutions]
hiddink at bendoo.nl
Fri Oct 14 18:17:45 CEST 2016
Hello,
I resolved this by adding giving a unique name to every checkbox
(name="tx_news_pi1[overwriteDemand][categories][{field:uid}]) and then
added cObject to ..."value.data":
value.data.cObject = TEXT
value.data.cObject {
value =
GP:tx_news_pi1|overwriteDemand|categories|
wrap = |{field:uid}
insertData=1
}
So now the snippet looks like this which works!
...
renderObj=TEXT
renderObj {
field=title
wrap = <div class="filter"><input
name="tx_news_pi1[overwriteDemand][categories][{field:uid}]"
value="{field:uid}" id="chb{field:uid}" class="chbFilters"
type="checkbox"> |</div>
wrap {
insertData=1
override = <div class="filter"><input
name="tx_news_pi1[overwriteDemand][categories][{field:uid}]"
value="{field:uid}" id="chb{field:uid}" class="chbFilters"
type="checkbox" checked> <i>|</i></div>
override {
if {
isInList.field = uid
# value.data = GP:tx_news_pi1|overwriteDemand|categories
value.data.cObject = TEXT
value.data.cObject {
value =
GP:tx_news_pi1|overwriteDemand|categories|
wrap = |{field:uid}
insertData=1
}
}
}
}
}
...
On 13/10/2016 09:49, Bert Hiddink [BENDOO e-work solutions] wrote:
> Hello,
>
> I am with TYPO3 6.2 and tx_news. I have the following snippet:
>
> ...
> renderObj=TEXT
> renderObj {
> field=title
> wrap = <div class="filter"><input
> name="tx_news_pi1[overwriteDemand][categories]" value="{field:uid}"
> id="chb{field:uid}" class="chbFilters" type="checkbox"> |</div>
> wrap {
> insertData=1
> override = <div class="filter"><input
> name="tx_news_pi1[overwriteDemand][categories]" value="{field:uid}"
> id="chb{field:uid}" class="chbFilters" type="checkbox"
> checked> <i>|</i></div>
> override {
> if {
> isInList.field = uid
> value.data = GP:tx_news_pi1|overwriteDemand|categories
> }
> }
> }
> }
> ...
>
> This works, that is, but only for the last checkbox checked from
> GP:tx_news_pi1[overwriteDemand][categories]
>
> So I thought adding an uid to each var like this:
> ...
> renderObj=TEXT
> renderObj {
> field=title
> wrap = <div class="filter"><input
> name="tx_news_pi1[overwriteDemand][categories][{field:uid}]"
> value="{field:uid}" id="chb{field:uid}" class="chbFilters"
> type="checkbox"> |</div>
> wrap {
> insertData=1
> override = <div class="filter"><input
> name="tx_news_pi1[overwriteDemand][categories][{field:uid}]"
> value="{field:uid}" id="chb{field:uid}" class="chbFilters"
> type="checkbox" checked> <i>|</i></div>
> override {
> if {
> isInList.field = uid
> value.data =
> GP:tx_news_pi1|overwriteDemand|categories|field:uid
> # value=3051,3057
> }
> }
> }
> }
>
> However, GP:tx_news_pi1|overwriteDemand|categories|field:uid does not
> work. How could I check for each variable in the override if I want to use:
> tx_news_pi1[overwriteDemand][categories][{field:uid}]
>
> ???
>
> Any ideas? Thanks in advance!
>
> Regards,
> Bert
>
>
>
>
>
>
>
More information about the TYPO3-english
mailing list