0

I have a table with the field 'map' (checkbox) and a field 'mapicon'.

  1. If the field 'map' is checked, the field 'mapicon' should automatically be filled with the string 'blueMarker.png' when saving.
  2. If the field 'map' is no longer checked, the string 'blueMarker.png' should be removed automatically when saving.

I know how to solve the problem simply with sql. But I am looking for a solution that I do not have to do manually.

update fe_users set mapicon 'pointerGreen.png' Where map='1'
update fe_users set mapicon '' Where map=''

Expanded explanation:

I'm using the extensions 'feusersmap' and 'fe_users' to show markers on a google map. For FE registration I'm using femanager. There I added the field 'map'. During registration for the internal area, users can decide whether their address should be displayed there on the google map.

I can't avoid the field 'mapicon' because content of this field is used by a viewhelper of 'feusersmap' to show the marker on the map.

Robert
  • 561
  • 3
  • 20

1 Answers1

1

I would avoid th field mapicon completely. As it seem the map checbox and map icon server the same purpose. (Display a blue marker).

I would use the checbox if its a boolean option or a dropdown/select if you have multiple Marker options.

Then i would provide the rest in frontend templating/Controller logic.

TYPO3 offers DataHandler hooks which allow you to process records before saving. (Just to answer your original question)

Wolffc
  • 1,176
  • 6
  • 9