DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
Administrator manual¶
Target group: Administrators
Installation¶
- Just install the extension like other extensions from the TYPO3 extension repository TER.
- 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.
- Create a page where you want to use the plugin.
- Put a new content element of the plugin locator to this page.
- 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.
- When using with TYPO3 6.2.x you perhaps have to patch mh_treeview - see Appendix.
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).
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.
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¶
The settings in template setup overrides the flexform settings!
templateFile¶
Property
templateFile
Data type
string
Description
Define the template file
Default
typo3conf/ext/locator/pi1/template.html
cssFile¶
Property
cssFile
Data type
string
Description
Define the css file
Default
typo3conf/ext/locator/pi1/layout.css
countryCodes¶
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¶
Property
radiusPresets
Data type
string
Description
The presets of the radius values
Default
20,50,100,500,1000,50000
resultPageId¶
Property
resultPageId
Data type
int
Description
The uid of the result page
Default
routePageId¶
Property
routePageId
Data type
int
Description
The uid of the of the route page
Default
newLoginBoxPageId¶
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¶
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¶
Property
resultLimit
Data type
int
Description
The number of max. results
Default
300
distanceUnit¶
Property
distanceUnit
Data type
string
Description
Switch between km and miles
Default
km
enableLogs¶
Property
enableLogs
Data type
bool
Description
If set, log entries were written to the TYPO3 log
Default
0
debug¶
Property
debug
Data type
bool
Description
If set, some debug information is show. Useful with the extension cc_debug
Default
0
storeTitle¶
Property
storeTitle
Data type
string
Description
The title of the stores
Default
store(s)
displayMode¶
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¶
Property
defaultMapType
Data type
string
Description
The default map type. TERRAIN or ROADMAP or SATELLITE or HYBRID
Default
defaultZoomLevel¶
Property
defaultZoomLevel
Data type
int
Description
The default zoom level 0 - 17
Default
routeViewTarget¶
Property
routeViewTarget
Data type
string
Description
Target of the route view
Default
_top
uidOfSingleView¶
Property
uidOfSingleView
Data type
int
Description
The uid of the store which is displayed in single view
Default
1
enableStreetView¶
Property
enableStreetView
Data type
bool
Description
If set the google streetview is enabled
Default
0
showOverviewMap¶
Property
showOverviewMap
Data type
bool
Description
If checked, an overview map is displayed after the result table
Default
0
showOverviewMap¶
Property
showOverviewMap
Data type
bool
Description
If checked, an overview map is displayed after the result table
Default
0
showTabbedInfoWindow¶
Property
showTabbedInfoWindow
Data type
bool
Description
If set, shows the tabbed infoWindow
Default
1
useFeUserData¶
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¶
Property
tt_addressStorenameField
Data type
string
Description
The field which is used for the storename when tt_address is used
Default
name
tt_addressAllowedGroups¶
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¶
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¶
Property
externalLocationTable
Data type
string
Description
Name of the external table for loctions data
Default
feUserGroup¶
Property
feUserGroup
Data type
int
Description
The group of the feusers which are selected for the locations, if feusers data is used
Default
categoryPidList¶
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¶
Property
categories
Data type
string
Description
Comma separated list of category uids (works with locator- and tt_news table).
Default
listViewOrderBy¶
Property
listViewOrderBy
Data type
string
Description
Determine the order of the listView table
Default
country,zipcode
listViewCategoryUid¶
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¶
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.¶
Property
resultTableView.image.file.
Data type
string
Description
Cobj image properties Example: resultTableView.image.file.maxW = 100
Default
singleView.image.file.¶
Property
singleView.image.file.
Data type
string
Description
Cobj image properties Example: singleView.image.file.maxW = 100
Default
googleInfoWindow.image.file.¶
Property
googleInfoWindow.image.file.
Data type
string
Description
Cobj image properties Example: googleInfoWindow.image.file.maxW = 100
Default
showVideoPlayer¶
Property
showVideoPlayer
Data type
bool
Description
To show the video of the media field in the Google infoWindow set this to 1
Default
disableLoadInBodyTag¶
Property
disableLoadInBodyTag
Data type
bool
Description
If you get a javascript error in body tag, set this to 1
Default
ttNewsSinglePid¶
Property
ttNewsSinglePid
Data type
int
Description
Page id of tt_news singleView when using tt_newsrecords as locations
Default
orderBy¶
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¶
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¶
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¶
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¶
Property
updateLatLonLimit
Data type
int
Description
integer – limits the geocoding to n locations
Default
enableNotepad¶
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¶
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¶
Property
notepadView.image.file
Data type
string
Description
Cobj image properties Example: notepadView.image.file.maxW = 100c
Default
enableMarkerMouseover¶
Property
enableMarkerMouseover
Data type
bool
Description
Only API v 3, enables openInfoWIndow on mouseover for markers
Default
enableMultipleInfoWindows¶
Property
enableMultipleInfoWindows
Data type
bool
Description
Api v 3 only, enables more than one infoWIndow at a time
Default
useTtaddressWithoutGroups¶
Property
useTtaddressWithoutGroups
Data type
bool
Description
When using tt_address data with large tables this option speeds up the search
Default
useApproximation¶
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¶
Property
enableTSFEeID
Data type
bool
Description
Used in ajaxSearchWithMap view to get the email rendered with TYPO3.
Default
enableStartpointMarker¶
Property
enableStartpointMarker
Data type
bool
Description
Used in ajaxSearchWithMap view to show the starting point
Default
enableSearchCircle¶
Property
enableSearchCircle
Data type
bool
Description
Used in ajaxSearchWithMap view to show the search circle
Default
enableMarkerClusterer¶
Property
enableMarkerClusterer
Data type
bool
Description
If set, marker clusterer I used in map View with more than 1 markers
Default
enableMarkerClusterer¶
Property
enableMarkerClusterer
Data type
bool
Description
If set, marker clusterer I used in map View with more than 1 markers
Default
categoryImagePath¶
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¶
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¶
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¶
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]
- 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
- 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
}
- If nothing is geocoded, check if curl is enabled then curl is used otherwise t3lib_div::getUrl($url) is used. Enable debug and devlog...
Appendix¶
Known problems
- 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');
- 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
- If extension sourceopt is used, make sure to set sourceopt.formatHtml = 0
- 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.
- 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.
- 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.
- If the maps are not loaded, check if config.disableDefaultJS = 0 is set in template setup
- If the maps are not loaded, check if config.removeDefaultJS = external is set in template setup
- When used with locator tables, there seems to be a problem with the extension scriptmerger and the category treeview in the frontend.
- 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.