Partner Map
- CType
-
academicpartners_map - Plugin
-
Academic, pluginPartners Map, actionPartnerController:: map Action () - Set
-
fgtclb/, which the aggregate setacademic- partners- map fgtclb/includes, see What the sets containacademic- partners
The Partner Map draws the partners of a site on a map, with the tiles of OpenStreetMap by default. Every partner is a marker, nearby markers are merged into clusters while the map is zoomed out, and a marker opens a popup with the name of the partner, linked to its page. The map fits itself around the partners it draws. Above the map the same form as in the Partner List lets the visitor filter the partners by category. The form works under the Content Security Policy of TYPO3 as the one of the list does, see Content Security Policy, and the map allows the host of its tiles in that policy itself, see Content Security Policy.
The Partner Map with a marker per partner it can draw.
It is the element for a page that shows where the partners of a university are, all of them or those of one programme or kind of cooperation. It finds its partners exactly as the list does, so a page can show the list and the map of the same selection.
The element is not cached, and a selection of the visitor is part of the URL, as in the list. It loads the map script and the stylesheets of the map libraries on the page that carries it, see Load the script or bring your own.
Which partners the map draws
The map draws the partners the filter matches that have coordinates and whose page has Show on map switched on, the switch next to the coordinates of the partner page. The switch is on for a new partner. It is about the map only: the partner list lists a partner hidden from the map.
The map reads the switch of the partner page in the language it is rendered in. The switch of a translation follows its default record, as the coordinates do, so switching a partner off in the default language takes it off the map in every language. An editor who detaches the switch of a translation sets it for that language on its own.
A map with no partner to draw renders a message instead of the map: "No partners found." while a category filter is active, and "No partner with a location to show on the map." otherwise.
Related chapters:
- The partner map describes the site settings of the map: its centre, its zoom, the tile server and the attribution, and the map on other pages.
- Styling the map is required reading: the map element needs a height from the stylesheet of the site, or it shows no map at all.
- The partner map describes the markup.
- The category filters and Active filters, reset link and result count apply to the form of the map as well.
Content Security Policy
The map loads its tiles as images from the host of its tile URL,
plugin. in
The partner map. The frontend policy of TYPO3 does not allow that host
in img-, so a browser would block every tile once a site enforces the
policy, and the markers would stay on an empty map. The element therefore
extends img- of the policy of its page by the host of the tile URL the
site configures, and only that page gets it:
| Tile URL | Added to img- |
|---|---|
https://, the default | https://*. |
https:// | https:// |
// | *. |
/tiles/ | nothing, 'self' covers it |
A label of the host with a placeholder becomes the wildcard *., because a
policy cannot name a placeholder, and the path of the URL does not matter. A
placeholder in a lower label widens the wildcard to the labels to the right of
it. A tile URL whose host the extension cannot read, a placeholder in the
scheme or the port, a port outside 1 to 65535, a scheme other than http and
https, or a wildcard that would cover a whole top level domain adds nothing,
and the site adds the source in its csp. instead:
mutations:
- mode: extend
directive: 'img-src'
sources:
- 'https://*.tiles.example.org'
The source is added while TYPO3 renders the page and is kept with the page in
its cache, so it applies to a cached page as well. It applies on top of the
policy of the site, also on a site whose csp. sets
inherit. The content element registers it through a data
processor of its rendering definition, which extends the one of
lib.. A site that renders the element without the
data processors of
lib. gets the source only on
pages that come from the page cache, and adds it to its csp..
Not covered:
- A page template that renders the partial
Partner/itself, on a partner page for example, adds the host of its tiles to theMap. html csp.of the site.yaml - A policy that the web server or a proxy sends needs the source itself.
The stylesheets, the scripts and the marker images of the map are files of the extension. Leaflet positions its tiles and markers with styles it sets from its script, which a policy does not restrict, so the map needs no other source.
Changed in version 2.4
The map allows the host of its tiles in img-.
Settings
The tab Configuration of the content element holds the options of the map, on two tabs of their own, Filter and Layout, and below them the field Startingpoint. The map has no Pagination tab: it always draws every partner the filter matches.
-
- Type
- page
- Default
- empty
The pages or storage folders the partner pages sit in, as for the list, see Startingpoint. Only direct subpages of the chosen pages are found, and an empty value draws every partner page of the installation, those of every other site included.
Filter
The tab carries the same fields as the one of the list, and they work the same way. What is different on a map is noted below.
-
- Type
- checkbox
- Default
- off
On, the form shows no category selects, and neither active filter tags nor a reset link. The map always draws the partners of Default categories, also when the visitor changes the sorting, and categories in the URL of a link only narrow it further. See Hide category filtering.
-
- Type
- checkbox
- Default
- off
On, the form shows no sorting selects. A map has no visible order, the sorting only orders the hidden list the map script reads its partners from. Switch it on for a map unless a script of the site renders that list.
-
- Type
- select
- Default
- Title A-Z
The order of the partners in the hidden list of the map, with the items of Default sorting. It does not change what the map draws. A value that is not a field and a direction is ignored, as in the list.
-
- Type
- records
- Default
- empty
Categories the map is filtered by until the visitor selects something in the form. A partner is drawn only when its page carries every chosen category, and subcategories are not added, as in Default categories of the list. With the filter hidden, the map keeps them whatever the visitor submits or a link carries.
Layout
-
- Type
- select
- Default
- Content width
How wide the map renders.
Item Renders Content width, the default <div class="academic-partners- map"> Full width <div class="academic-partners- map layout- full Width"> The extension ships no style for the class. What full width means depends on the page layout of the site, so the theme of the site styles it. A content element saved before the field existed renders at content width.
The Partner Map with the map width Full width, as the stylesheet of the development instance styles it.