.. ================================================== .. FOR YOUR INFORMATION .. -------------------------------------------------- .. -*- coding: utf-8 -*- with BOM. .. include:: ../Includes.txt .. _admin-manual: Administrator manual ==================== Target group: **Administrators** Installation ^^^^^^^^^^^^ 1. Just install the extension like other extensions from the TYPO3 extension repository TER. 2. To get the country select field work correct, you have to install for example for germany the extension static_info_tables_de. In the table “static_countries” you have to insert a value for the field 'cn_short_de' (for example 'Deutschland in uid=54). See also the FAQ in this manual. The extension determines the names of the countries depending on the config.language setting in page template setup. 3. Create a page where you want to use the plugin. 4. Put a new content element of the plugin locator to this page. 5. Now you have to insert one or more store categories and stores. For this, change to the list module and insert data records for categories and stores. The coordinates of the stores are fetched automatically from geocoders by the plugin. 6. When using with TYPO3 6.2.x you perhaps have to patch mh_treeview - see :ref:`Known problems`. .. figure:: ../Images/AdministratorManual/Category.png :width: 600px :alt: Category object .. figure:: ../Images/AdministratorManual/Store1.png :width: 600px :alt: Store object .. figure:: ../Images/AdministratorManual/Store2.png :width: 600px :alt: Store object Ajax search with map ^^^^^^^^^^^^^^^^^^^^ This view is a fast implementation of the store search. It works with tx_locator_locations, tt_address and fe_users table. If you have already included jQuery on your webpage just comment the jquery parts in the template file. Using external locations table ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You can use the location data from an external table. For this there should be some fields like zip, name, street, city and country. You have to add some fields to the external table too: tx_locator_lat varchar(255) DEFAULT '', tx_locator_lon varchar(255) DEFAULT '', tx_locator_geocode tinyint(4) default '1', tx_locator_categoryuid tinytext, image BLOB NOT NULL, link varchar(255) In flexform setup of the extension loactor choose “use external table” and give the external table name (here is shown tx_cal_location). .. figure:: ../Images/AdministratorManual/ExternalLocationTable.png :width: 600px :alt: External location table Make sure to have the correct categories in the field tx_locator_categoryuid (this should be a comma separated list of category uids). The locator will automatically update the latitude and longitude values in the table tx_cal_location if the tx_locator_geocode flag is set to 1. Using zipcode areaview ^^^^^^^^^^^^^^^^^^^^^^ To get the areaview working you need shapefiles with the coordinate information. They are available from the German POST AG. The extension needs the .dbf and .shp file. The path to the files are set in the flexform setup of the extension. Make sure to place both files in one directory and set the flexform shapefile to the *.shp file. Then you have to insert at least one store to the database which is located in a zipcode area. To get the data from the shapefile to TYPO3 db use the view “zipcodeAreaView”. For all areas you want to view you need a store locacted in that area (same zipcode)! You can use your own coordinates to show an area too. To show your own areas you have to delete the flexform entry “shapefile” of the locator, insert stores with zipcodes and you have to insert coordinate data which corresponds to the zipcode of the stores. You can add more than one area for a zipcode with different area-numbers. .. figure:: ../Images/AdministratorManual/ZipcodeArea.png :width: 600px :alt: Zipcode area Using tt_news ^^^^^^^^^^^^^ You can use tt_news records as locations. For this, the tt_news table is extended with the required fields. The locator provide a hook function to replace the following markers in tt_news single view. ###LOCATOR_LAT### ###LOCATOR_LON### ###LOCATOR_ADDRESS### ###LOCATOR_ZIPCODE### ###LOCATOR_CITY### ###LOCATOR_STATE### ###LOCATOR_COUNTRY### ###LOCATOR_EMAIL### ###LOCATOR_PHONE### ###LOCATOR_HOURS### ###LOCATOR_URL### ###LOCATOR_NOTES### ###LOCATOR_IMAGEURL### ###LOCATOR_ICON### ###LOCATOR_STORENAME### ###LOCATOR_MAP### When you use you own template for tt_news, you have to to edit the template and insert the desired markers for the fields you want display and then you have to unload and load the modified template in tt_news. Typoscript for tt_news plugin.tt_news { displaySingle { mapWidth = 550 mapHeight = 300 panoWidth = 550 panoHeight = 300 enableStreetView = 1 templateFile = fileadmin/includes/ext/locator/template.html displayMode = singleView disableLoadInBodyTag = 0 } } To display the google map in single view of tt_news add the marker ###LOCATOR_MAP### to your news template. Using simple search ^^^^^^^^^^^^^^^^^^^ ith the simple search and cookie option, it is possible to display a form with city and/or zipcode. When you have selected a store in the result table the cookie will be set. Then the simple search show only storename and city with zipcode. In the singleView you get a link to search again – this link will clear the cookies. In the locator/pi1 folder you find simpleTemplate.html and simpleLayout.css for the simple search. # id 22 is the page where we want to show the simpleSearch form [globalVar = TSFE:id=22] plugin.tx_locator_pi1 { useCookie = 1 displayMode = simpleView simpleView = 1 useFeUserData = 0 googleApiVersion = 3.1 templateFile = EXT:locator/pi1/simpleTemplate.html cssFile = EXT:locator/pi1/simpleLayout.css radiusPresets = 20 pid_list = 9 countryCodes = DE resultPageId = 9 } lib.locator = COA lib.locator { 10 < plugin.tx_locator_pi1 } [global] # id 9 is the page where singleView is shown # here we use the settings from flexform setup of the extension. [globalVar = TSFE:id=9] plugin.tx_locator_pi1 { useCookie = displayMode = useFeUserData = googleApiVersion = templateFile = cssFile = radiusPresets = pid_list = countryCodes = resultPageId = } lib.locator > [global] And when you are using markers add something like this to your page template setup. marks.SIMPLESEARCH < lib.locator Using realURL and page title in single view ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ When using locator with fe_users table, you can set the useFeUserPageTitle in flexform setup to get a link to single view in the resulttable which is decoded with realURL. To get this you have to configure realURL with a configuration file which is modified in the postVarSets section: ... 'locator' => array ( '0' => array ( 'GETvar' => 'tx_locator_pi1[storeUid]', 'lookUpTable' => array ( 'table' => 'fe_users', 'id_field' => 'uid', 'alias_field' => 'name', 'addWhereClause' => ' AND NOT deleted', 'useUniqueCache' => '1', 'useUniqueCache_conf' => array ( 'strtolower' => '1', 'spaceCharacter' => '-', ), ), ), ... Using countryCitySelector view ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This view works only with tx_locator table and the fe_users table. To get it working it is recommended to insert the country in the german language and make sure you have in static_countries the cn_short_de field filled accordingly. If everything is correct you will see a list of countries of your loactions. You can click a country and the you will get a list of the cities of this country of your locations. The displayed country names are translated to the language the website is shown. Therefor make sure to insert the translations into locallang.xml. When you click a city, you will get the normal resultTable of the extension with the locations in this city. Note: You can use the plugin twice on a page, one with normal map view and the other plugin with the countryCitySelector. Each plugin have to be configured with an own resultPage where the plugin is installed too with the correct view. Reference ^^^^^^^^^ .. _plugin-tx-locator-pi1: plugin.tx\_locator\_pi1 ^^^^^^^^^^^^^^^^^^^^^^^ The settings in template setup overrides the flexform settings! .. _templateFile: templateFile """""""""""" .. container:: table-row Property templateFile Data type string Description Define the template file Default typo3conf/ext/locator/pi1/template.html .. _cssFile: cssFile """""""""""" .. container:: table-row Property cssFile Data type string Description Define the css file Default typo3conf/ext/locator/pi1/layout.css .. _countryCodes: countryCodes """""""""""" .. container:: table-row Property countryCodes Data type string Description The allowed country codes Default de,at,ch,fr,be,nl,li,us,gb,ca,it,es,gr,li,dk,pl,ru,hu .. _radiusPresets: radiusPresets """"""""""""" .. container:: table-row Property radiusPresets Data type string Description The presets of the radius values Default 20,50,100,500,1000,50000 .. _resultPageId: resultPageId """""""""""" .. container:: table-row Property resultPageId Data type int Description The uid of the result page Default .. _routePageId: routePageId """""""""""" .. container:: table-row Property routePageId Data type int Description The uid of the of the route page Default .. _newLoginBoxPageId: newLoginBoxPageId """"""""""""""""" .. container:: table-row Property newLoginBoxPageId Data type int Description The page uid where the newloginbox userlist is installed, when set and feusers data is used, the storenames are linked to this page Default .. _showStoreImage: showStoreImage """""""""""""" .. container:: table-row Property showStoreImage Data type bool Description If set, the images of the stores are displayed in the resilt table and info windows Default 1 .. _resultLimit: resultLimit """"""""""" .. container:: table-row Property resultLimit Data type int Description The number of max. results Default 300 .. _distanceUnit: distanceUnit """""""""""" .. container:: table-row Property distanceUnit Data type string Description Switch between km and miles Default km .. _enableLogs: enableLogs """""""""" .. container:: table-row Property enableLogs Data type bool Description If set, log entries were written to the TYPO3 log Default 0 .. _debug: debug """"" .. container:: table-row Property debug Data type bool Description If set, some debug information is show. Useful with the extension cc_debug Default 0 .. _storeTitle: storeTitle """""""""" .. container:: table-row Property storeTitle Data type string Description The title of the stores Default store(s) .. _displayMode: displayMode """"""""""" .. container:: table-row Property displayMode Data type string Description This mode selects the kind of map to display, possible values are: mapView, mapAllView, routeView, singelView, automatedMailView , countryCitySelector example: plugin.tx_locator_pi1.displayMode = singleView Default mapView .. _defaultMapType: defaultMapType """""""""""""" .. container:: table-row Property defaultMapType Data type string Description The default map type. TERRAIN or ROADMAP or SATELLITE or HYBRID Default .. _defaultZoomLevel: defaultZoomLevel """""""""""""""" .. container:: table-row Property defaultZoomLevel Data type int Description The default zoom level 0 - 17 Default .. _routeViewTarget: routeViewTarget """"""""""""""" .. container:: table-row Property routeViewTarget Data type string Description Target of the route view Default _top .. _uidOfSingleView: uidOfSingleView """"""""""""""" .. container:: table-row Property uidOfSingleView Data type int Description The uid of the store which is displayed in single view Default 1 .. _enableStreetView: enableStreetView """""""""""""""" .. container:: table-row Property enableStreetView Data type bool Description If set the google streetview is enabled Default 0 .. _showOverviewMap: showOverviewMap """"""""""""""" .. container:: table-row Property showOverviewMap Data type bool Description If checked, an overview map is displayed after the result table Default 0 .. _showOverviewMap: showOverviewMap """"""""""""""" .. container:: table-row Property showOverviewMap Data type bool Description If checked, an overview map is displayed after the result table Default 0 .. _showTabbedInfoWindow: showTabbedInfoWindow """""""""""""""""""" .. container:: table-row Property showTabbedInfoWindow Data type bool Description If set, shows the tabbed infoWindow Default 1 .. _useFeUserData: useFeUserData """"""""""""" .. container:: table-row Property useFeUserData Data type int Description Selects the source from where the locations are taken: 0 = locator locations, 1 = feuser locations, 2 = external data table, 3 = tt_news, 4 = tt_address Default 0 .. _tt_addressStorenameField: tt_addressStorenameField """""""""""""""""""""""" .. container:: table-row Property tt_addressStorenameField Data type string Description The field which is used for the storename when tt_address is used Default name .. _tt_addressAllowedGroups: tt_addressAllowedGroups """"""""""""""""""""""" .. container:: table-row Property tt_addressAllowedGroups Data type string Description Only for use with tt_address – insert here a comma separated list of group uids Default .. _tt_addressNotAllowedGroups: tt_addressNotAllowedGroups """"""""""""""""""""""" .. container:: table-row Property tt_addressNotAllowedGroups Data type string Description Only for use with tt_address – insert here a comma separated list of group uids which are not allowed Default .. _externalLocationTable: externalLocationTable """"""""""""""""""""" .. container:: table-row Property externalLocationTable Data type string Description Name of the external table for loctions data Default .. _feUserGroup: feUserGroup """"""""""" .. container:: table-row Property feUserGroup Data type int Description The group of the feusers which are selected for the locations, if feusers data is used Default .. _categoryPidList: categoryPidList """"""""""""""" .. container:: table-row Property categoryPidList Data type string Description Useful for local and global categories in the sysfolder where the stores are located Example: In the template setup of the sysfolder insertplugin.tx_locator_pi1.categoryPidList = 8,9 This will only show storecategories of the sysfolder/pages 8 and 9 Default .. _categories: categories """""""""" .. container:: table-row Property categories Data type string Description Comma separated list of category uids (works with locator- and tt_news table). Default .. _listViewOrderBy: listViewOrderBy """"""""""""""" .. container:: table-row Property listViewOrderBy Data type string Description Determine the order of the listView table Default country,zipcode .. _listViewCategoryUid: listViewCategoryUid """"""""""""""""""" .. container:: table-row Property listViewCategoryUid Data type string Description Uids of category to show, works with locator- and tt_news tables listViewCategoryUid = 2,3 no spaces! Default country,zipcode .. _useFeUserPageTitle: useFeUserPageTitle """""""""""""""""" .. container:: table-row Property useFeUserPageTitle Data type bool Description With this option you can set the page title to fe_user title, first_name and last_name. When using this option make sure not to set the title via Typoscrip Default .. _resultTableView.image.file.: resultTableView.image.file. """"""""""""""""""""""""""" .. container:: table-row Property resultTableView.image.file. Data type string Description Cobj image properties Example: resultTableView.image.file.maxW = 100 Default .. _singleView.image.file.: singleView.image.file. """""""""""""""""""""" .. container:: table-row Property singleView.image.file. Data type string Description Cobj image properties Example: singleView.image.file.maxW = 100 Default .. _googleInfoWindow.image.file.: googleInfoWindow.image.file. """""""""""""""""""""""""""" .. container:: table-row Property googleInfoWindow.image.file. Data type string Description Cobj image properties Example: googleInfoWindow.image.file.maxW = 100 Default .. _showVideoPlayer: showVideoPlayer """"""""""""""" .. container:: table-row Property showVideoPlayer Data type bool Description To show the video of the media field in the Google infoWindow set this to 1 Default .. _singleView.showRelatedStores: singleView.showRelatedStores """""""""""""""""""""""""""" .. container:: table-row Property singleView.showRelatedStores Data type bool Description Set this to 1 if you want to show related stores in singleView. Related stores are not shown in resultTable! Default .. _disableLoadInBodyTag: disableLoadInBodyTag """""""""""""""""""" .. container:: table-row Property disableLoadInBodyTag Data type bool Description If you get a javascript error in body tag, set this to 1 Default .. _ttNewsSinglePid: ttNewsSinglePid """"""""""""""" .. container:: table-row Property ttNewsSinglePid Data type int Description Page id of tt_news singleView when using tt_newsrecords as locations Default .. _orderBy: orderBy """"""" .. container:: table-row Property orderBy Data type string Description Use this to set manually an order option when stores are searched Example: plugin.tx_locator.ordrBy = city, address Default .. _mapAllNoFormView.rand: mapAllNoFormView.rand """"""""""""""""""""" .. container:: table-row Property mapAllNoFormView.rand Data type int Description With this option you can show n random stores in mapAllNoFormView and mapAllView Example: mapAllNoFormView.rand = 3 Default .. _maxGoogleMapsApiCalls: maxGoogleMapsApiCalls """"""""""""""""""""" .. container:: table-row Property maxGoogleMapsApiCalls Data type int Description Define the maximum calls per day to the google maps api. If the calls exceed this number no api calls are made to prevent invoices from Google. Default .. _apiV3Layers: apiV3Layers """"""""""" .. container:: table-row Property apiV3Layers Data type string Description Shows additonal layers in api v3 maps. Use for example traffic,weather,bicycling, panoramio. Options can be set in flexform. Weather overlay is only displayed for larger zoom-levels. Default .. _updateLatLonLimit: updateLatLonLimit """"""""""""""""" .. container:: table-row Property updateLatLonLimit Data type int Description integer – limits the geocoding to n locations Default .. _enableNotepad: enableNotepad """"""""""""" .. container:: table-row Property enableNotepad Data type bool Description Use this with mapAll views.User can add/remove the stores to notepad (cookies) and a list of the stores is show right of the map. Default .. _notepadId: notepadId """"""""" .. container:: table-row Property notepadId Data type int Description Page id where the plugin is inserted with mapAllNoFormView to show the users notepad and map. Make sure you have set the correct “Record storage page”. Default .. _notepadView.image.file: notepadView.image.file """""""""""""""""""""" .. container:: table-row Property notepadView.image.file Data type string Description Cobj image properties Example: notepadView.image.file.maxW = 100c Default .. _enableMarkerMouseover: enableMarkerMouseover """"""""""""""""""""" .. container:: table-row Property enableMarkerMouseover Data type bool Description Only API v 3, enables openInfoWIndow on mouseover for markers Default .. _enableMultipleInfoWindows: enableMultipleInfoWindows """"""""""""""""""""""""" .. container:: table-row Property enableMultipleInfoWindows Data type bool Description Api v 3 only, enables more than one infoWIndow at a time Default .. _useTtaddressWithoutGroups: useTtaddressWithoutGroups """"""""""""""""""""""""" .. container:: table-row Property useTtaddressWithoutGroups Data type bool Description When using tt_address data with large tables this option speeds up the search Default .. _useApproximation: useApproximation """""""""""""""" .. container:: table-row Property useApproximation Data type bool Description Used in ajaxSearchWithMap for tt_address data to speed up search (for table with more than 1000 records) Default .. _enableTSFEeID: enableTSFEeID """"""""""""" .. container:: table-row Property enableTSFEeID Data type bool Description Used in ajaxSearchWithMap view to get the email rendered with TYPO3. Default .. _enableStartpointMarker: enableStartpointMarker """""""""""""""""""""" .. container:: table-row Property enableStartpointMarker Data type bool Description Used in ajaxSearchWithMap view to show the starting point Default .. _enableSearchCircle: enableSearchCircle """""""""""""""""" .. container:: table-row Property enableSearchCircle Data type bool Description Used in ajaxSearchWithMap view to show the search circle Default .. _enableMarkerClusterer: enableMarkerClusterer """"""""""""""""""""" .. container:: table-row Property enableMarkerClusterer Data type bool Description If set, marker clusterer I used in map View with more than 1 markers Default .. _enableMarkerClusterer: enableMarkerClusterer """"""""""""""""""""" .. container:: table-row Property enableMarkerClusterer Data type bool Description If set, marker clusterer I used in map View with more than 1 markers Default .. _categoryImagePath: categoryImagePath """"""""""""""""" .. container:: table-row Property categoryImagePath Data type string Description Used in ajaxSearchWithMap view to show category images (trailing slash)! Example: categoryImagePath = fileadmin/includes/images/ image files should be named categoryName.gif Default .. _limitResultToCountry: limitResultToCountry """""""""""""""""""" .. container:: table-row Property limitResultToCountry Data type string Description Used with locator tables and normal search. The country in tx_locator_location table have to be cn_short_en (static countries). Default .. _enable2LevelCategoryFilter: enable2LevelCategoryFilter """""""""""""""""""""""""" .. container:: table-row Property enable2LevelCategoryFilter Data type bool Description Used with locator tables and ajaxSearchWithMap view. All stores are shown in map with a category filter with 3 Main categories. Default .. _singleViewPid: singleViewPid """"""""""""" .. container:: table-row Property singleViewPid Data type int Description Use this with enableTSFEeID = 1 Page uid of the singleView. It is used in the infoWiindows marker ###SINGLEVIEWLINKV### Default Hooks ^^^^^ There are two hooks in the bookingFormView implemented. BookingFormHeaderHook and bookingFormDataHook. These hooks can be called from your extension like this: in your localconf.php // hook for booking $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['booking']['bookingFormHeaderHook'][] = 'EXT:bookinghooks/pi1/class.tx_bookinghooks_pi1.php:tx_bookinghooks_pi1'; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['booking']['bookingFormDataHook'][] = 'EXT:bookinghooks/pi1/class.tx_bookinghooks_pi1.php:tx_bookinghooks_pi1'; And the functions function bookingFormDataHook(&$marks, $row, $conf, $obj) { ... } And function bookingFormHeaderHook(&$marks, $row, $conf, $obj) { $marks['###DELETE###']= 'xxx'; } FAQ ^^^ 1) I got the JS error T3_onloadWrapper() not defined. You have to enable JS code in the header by config.removeDefaultJS = 0 or config.removeDefaultJS = external 2) I got no selectable countries in the starting point form. The selectable countries are taken from the table static_countries. For correct working you need a correct configuration of the languages. For example, you should have this code in page template setup: ### Languages ### # SprachVariable L initialisieren config.linkVars = L # Standardsprache UID 0 -> Deutsch [globalVar = GP:L = 0] config.sys_language_uid = 0 config.language = de config.locale_all = de_DE [global] # English, sys_language.uid = 1 [globalVar = GP:L = 1] config.sys_language_uid = 1 config.language = en config.locale_all = english [global] 3) For german default language, make sure that you have at least one countryshortname in the table 'static_countries' and the 'field cn_short_de' (countrynames short de). If not, you can insert some with the extension phpmyadmin. See installation 4) If you get errors form storenames, etc. you probably have not configured the correct language in the template setup. Here are the configurations for utf-8 and the commented ISO8859-1 settings. page = PAGE page { config.metaCharset = utf-8 config.additionalHeaders = Content-Type:text/html;charset=utf-8 config.locale_all = de_DE.utf8 config.renderCharset = UTF-8 } 5) If nothing is geocoded, check if curl is enabled then curl is used otherwise t3lib_div::getUrl($url) is used. Enable debug and devlog... .. _Known problems: Appendix ^^^^^^^^ **Known problems** 1. When using with TYPO3 6.2.x and until mh_treeview is not patched for TYPO3 6.2: Patch line 25 of class.tx_mhtreeview.php with if (!class_exists('tslib_pibase')) require_once(PATH_tslib . 'class.tslib_pibase.php'); 2. Up to TYPO3 4.5 the config.xhtml_cleaning=all did not work correctly and breaks the link in the infoWindow. For this use config.xhtml_cleaning = cached on the pages with the locator plugin .When using API 3.x IE Browsers won't show the POI marker, just switch to API 3.1 3. If extension sourceopt is used, make sure to set sourceopt.formatHtml = 0 4. If email address in the google infoWindow is not working with spam protection, disable config.xhtml_cleaning or set it to config.xhtml_cleaning=cached. 5. If you get Fatal error: Class t3lib_beuserauth: Cannot inherit from undefined class t3lib_userauthgroup, then deactivate the logs in flexform setup of the extension. 6. If you use the data of fe_users, then make sure you have also installed sr_feuserregister, because this extension adds the comments-field to the fe_users table. Thx for reporting this issue to Mr. Kleisli. 7. If the maps are not loaded, check if config.disableDefaultJS = 0 is set in template setup 8. If the maps are not loaded, check if config.removeDefaultJS = external is set in template setup 9. When used with locator tables, there seems to be a problem with the extension scriptmerger and the category treeview in the frontend. 10. When used with gmenulayer there seems to be an issue with the body tag. Just use disableLoadInBodyTag=1 and call the javascript function load(); at the end of the page.