[TYPO3-calendar] Extending tx_cal_event with selectbox by kickstarter

Mario Matzulla mario at matzullas.de
Thu Sep 8 21:43:30 CEST 2011


Hi Christian,

Am 08.09.11 11:39, schrieb Christian Spiegel:
> Hallo,
>
> first: sorry for my bad English ;-)
>
> I try to extend the table tx_cal_event with a selectbox to choose
> different districts. Therefor i used the kickstarter and made my own
> extensions. In the backend everything works fine, I can make my
> selection. But in the frontend the marker in the event_model.tmpl is
> only replaced with the ID of the district not the name. What do I have
> to do to get the name/label?

The label is not stored inside the event table, only the index of your 
selected element. To show the according value, you have to create a CASE 
statement like this:

###TX_CALEXTENDED_CAL_DISTRICT###

plugin.tx_cal_controller.view.event.event.tx_calextended_cal_district = CASE
view.event.event.tx_calextended_cal_district {
     key.field = tx_calextended_cal_district
     1 = TEXT
     1.value = Bezirk 1
     1.lang.en = District 1
     2 = TEXT
     2.value = Bezirk 2
     2.lang.en = District 2
     3 = TEXT
     3.value = Bezirk 3
     3.lang.en = District 3
     4 = TEXT
     4.value = Bezirk 4
     4.lang.en = District 4
     5 = TEXT
     5.value = Bezirk 5
     5.lang.en = District 5
}

Another option could be to define a label marker "###DISCTRICT_LABEL###" 
and fill it through some TS logic:

plugin.tx_cal_controller._LOCAL_LANG.default.l_event_district = Bezirk
plugin.tx_cal_controller._LOCAL_LANG.en.l_event_district = District


> Next problem is to make the field editable for frontend-editing. I dont
> have any idea how to manage it.

Please have a look at the TS of 
plugin.tx_cal_controller.view.create_event edit_event confirm_event.
There are many fields you could take as an example.

And please add your field to rights.create.event.additionalFields =
else it wont get saved ;)

Regards,
Mario
>
> Thanx in advance
> Christian
>



More information about the TYPO3-project-calendar mailing list