1

Is it possible to access the id of a Templavoilà Data Structure / FCE for a CASE ?

I tried this which didn't work :

10 = CASE
10 {
 key.field = tx_templavoilaplus_datastructure
 100 = TEXT
 …
 default = TEXT
 …
}

Thank you ! =)

CCR
  • 154
  • 4
  • 18

1 Answers1

1

The field for the Data Structure in tt_content for TemplaVoila is tx_templavoila_ds. If you're using TemplaVoila Plus it's tx_templavoilaplus_ds.

Also, only the fields in the data structure are available directly. However, TemplaVoila loads the parent record data in the register. You can access it using key.data = register:tx_templavoila_pi1.parentRec.tx_templavoila_ds. For TemplaVoila Plus it's key.data = register:tx_templavoilaplus_pi1.parentRec.tx_templavoilaplus_ds

Rudy Gnodde
  • 4,286
  • 2
  • 12
  • 34
  • Thank you, that's one first step, I had that wrong. But it still doesn't work… What I want to do is display a link only if it is in the right FCE. – CCR Aug 23 '18 at 11:51
  • I tried `5 = TEXT` `5.value.field = tx_templavoilaplus_ds`, which didn't return anything… – CCR Aug 23 '18 at 12:34
  • But… even a `page:title` doesn't give me anything… – CCR Aug 23 '18 at 12:43
  • It's been a while since I've used TemplaVoila, but if I remember correctly you had to save the TO mapping again after changing the DS. – Rudy Gnodde Aug 23 '18 at 12:50
  • I don't understand, everything is saved properly. In the FCE, I link a particular field to a Typoscript Object Path. In `lib.particularfield` in my TS template, `5.value = some text` works, but not `5.value.field = [anything]` – CCR Aug 23 '18 at 13:03
  • Does `5.field = tx_templavoilaplus_ds` work (so without `value`)? – Rudy Gnodde Aug 23 '18 at 13:17
  • No it doesn't either – CCR Aug 23 '18 at 13:20
  • And `5.field = uid`? – Rudy Gnodde Aug 23 '18 at 13:33
  • Not either, I tried several combinations already, none worked with `.field` – CCR Aug 23 '18 at 13:36
  • Strange. That should work. Though I've never worked with TemplaVoila Plus. It could work different than vanilla TemplaVoila. – Rudy Gnodde Aug 23 '18 at 13:52
  • I think I know why it doesn't work. I just can't use title, bodytext, etc… since I'm in a FCE. I can only use the fields which are set up in the FCE with TV. – CCR Aug 23 '18 at 14:34
  • 1
    Right, sorry, I remember now. It's been too long :) TemplaVoila loads the parent record data in the register. You can access it using `5.data = register:tx_templavoila_pi1.parentRec.uid`. If TemplaVoila Plus does something similar it's probably `5.data = register:tx_templavoilaplus_pi1.parentRec.uid`. – Rudy Gnodde Aug 23 '18 at 14:49
  • It works ! Thank you @Rudy for your help. I've used `key.data = register:tx_templavoilaplus_pi1.parentRec.tx_templavoilaplus_ds`. If you'd be so kind to write an answer, I will mark it as the right one =) – CCR Aug 27 '18 at 10:26