Advanced URLs
FirstSpirit Version 5.0 comes with a newly designed API interface allowing the creation of own "URL generators" (e.g. in the form of modules or scripts) that enable the generation of exactly customized URLs. This can for example serve to support the search engine optimization (SEO), e.g. by reliance on "expressive" URLs that are more easily understood by website visitors and may get a better ranking from search engines. In addition, URLs can now be generated in a completely multilingual fashion. The planning of the URL structure should be started as early as possible in any case: later changes in the URLs of pages which have already been indexed can have a negative impact on their ranking (at least in the short term).
FirstSpirit 5.0’s basic package includes a new URL generator, the "Advanced URL Creator". This provides merely an example for an URL creation strategy and lays NO claim to being able to map all SEO strategies in their entirety (which would be impossible anyway owing to the principles involved). Instead, it provides a basis allowing the creation of much more flexible URLs than in FirstSpirit Version 4. Java programming is required for customizing URLs to the respective requirements.
A complex URL generation strategy makes it impossible to predict possible conflicts (identical file names) arising from user activities (e.g. relocation of nodes within the tree structure). These conflicts only become detectable at a very late stage (e.g. when the file is generated or even as late as upon publication). This means that an inept implementation and/or inept selection of display names can create problems which would not arise in the standard URL creation process. These problems are detected and overcome by familiar disambiguation mechanisms (appending a consecutive number). |
Changes in the URL creator affect the downstream publication processes and live system configuration, which may need to be adapted to the modified URL creator. |
The "Advanced URL Creator" can be activated in generation schedules by way of the "PathGeneration" combobox.
While the URLs created in the standard URL generation are based on file and reference names, the URLs generated by the Advanced URL Creator are based on the display names of the FirstSpirit objects. This means that all URLs are created in UTF-8, including blanks and special characters. This can lead to problems in Windows because the file system is case-insensitive. Leading and final blanks are removed when the URLs are generated, however, and the following characters will be replaced by a minus (-):
\ / : * ? " < > | #
All URLs in a project can be realized multilingually throughout. The division into language directories and template set directories has been dropped. Any URLs/paths that are not unique are automatically rendered so in the generation process and hence differentiated from one another (by appending numbers).
This URL creator is therefore primarily suitable for projects where all the respective display names in the Site Store and Media Store are also multilingual throughout in all the languages to be generated. If no display name is provided in a language, the display name of the master language is used or, if no display name is provided in the master language either, the reference name is used.
For URLs with umlauts, Tomcat webservers used in the Advanced URLs mode should be version 6.0.29 or higher to ensure correct handling. |
Menu levels and page references
Every page reference that is earmarked for inclusion is generated including the folder path (menu levels). Menu levels without page reference are not included in the generation process as long as they do not contain any other menu levels with released page references. As the display names are relied upon by both the page references and menu levels, all URLs can be created in a completely multilingual manner.
../de/startpage/mithras_home.html
and
../en/startpage/mithras_home.html
in standard URL creation
become
../Startseite/index.html
and
../Startpage/index.html
in the Advanced mode
These pages can also be accesses by means of
../Startseite/
or
../Startpage/
If the editor has not assigned a display name to a menu level in one of the languages, the directory of the master language ("Master language fallback") and/or a directory with the reference name ("Reference name fallback") is used. If this should lead to the existence of several index.html files in a directory, a number will be appended to differentiate them ("Disambiguation fallback"), e.g.
../Startseite/index.html
../Startseite/index.1.html
This is also the case when folders in various languages have the same display name.
A script which precedes the generation process (schedule management in the project attributes) can for example ensure the creation of files that are based on the display name of the page reference, instead of the "index.*" files:
context.setProperty("#urlCreatorSettings", Collections.singletonMap("usewelcomefilenames", "false"));
Page groups
If page groups are used, the start page will be assigned the file name index.html by default. The file names of other pages in the page group will be generated from the display name of the page. If no display name is provided, the reference name will be used. The disambiguation of file names in folders follows the same procedure as for page references.
../de/pagegroup/pressemitteilung_1.html
../de/pagegroup/pressemitteilung_2.html
../de/pagegroup/pressemitteilung_3.html
and
../en/pagegroup/pressemitteilung_1.html
../en/pagegroup/pressemitteilung_2.html
../en/pagegroup/pressemitteilung_3.html
in the Standard URL mode
would hence become
../pagegroup/index.html
../pagegroup/Pressemitteilung 2.html
../pagegroup/Pressemitteilung 3.html
and
../pagegroup/index.html
../pagegroup/Press Release 2.html
../pagegroup/Press Release 3.html
in the Advanced URL mode
A script (schedule management in the project attributes) that precedes the generation process
context.setProperty("#urlCreatorSettings", Collections.singletonMap("usewelcomefilenames", "false"));
can also in this case ensure the creation of files that are based on the display name of the start page reference, instead of the "index.*" files.
Data records
If data records are output across several pages by way of a content projection ("Content" tab on menu levels), a number is added to the file name of the page reference where the content projection is output. If one data record is output per page, this will be the ID of the data record, e.g.
.../Presse/Pressemitteilungen/Pressemitteilungen Detailseite_128.html
and/or
.../Press/Press Releases/Press Releases Details_128.html
The entire folder path is also generated here. Similarly to the URL creation for page references, the page references and folder path here are also based on the display names.
If a column of the data source is selected in the "Variable for sitemap text" field in a content projection (Site Store, page reference with "Content" tab), the name will be derived from the text in this column in a language-dependent fashion. This way "expressive URLs" can also be created for multi-pages, e.g.
../Presse/Pressemitteilungen/Neuer Geschäftsführer bei Mithras Energy.html
or
../Press/Press Releases/New Director of Mithras Energy.html
If the field selected in "Variable for sitemap text" is empty in one or several languages, the URL is once again formed by appending the data record ID by default. If several data records are output on one page, consecutive numbers will be appended, e.g.
../Presse/Pressemitteilungen/Pressemitteilungen Übersicht.html
../Presse/Pressemitteilungen/Pressemitteilungen Übersicht_1.html
../Presse/Pressemitteilungen/Pressemitteilungen Übersicht_2.html
or
../en/Press/Press Releases/Press Releases Overview.html
../en/Press/Press Releases/Press Releases Overview_1.html
../en/Press/Press Releases/Press Releases Overview_2.html
Media
In contrast to the standard URL generation, no superordinated media directory is created in Advanced URL generation. The Media Store media to be included are filed hierarchically in folders, while folders and/or media from the root directory of the Media Store are filed in the top level of the generation directory. The display names are relied upon for both media and media folders, meaning that all URLs can be created multilingually throughout. As a result, Site Store files (HTML pages, PDF documents, etc.) and media might be filed in the same directory if the display names of the folders are identical in the Site Store and Media Store.
These items in standard URL generation
1) ../media/products/powerinverter/control-panel.jpg
2) ../media/products/powerinverter/control-panel_Produktteaser.jpg
3) ../media/de/products/downloaddokumente/produktuebersicht.doc
4) ../media/en/products/downloaddokumente/produktuebersicht.doc
turn into this in Advanced URL generation
1) ../Produkte/Wechselrichter/Instrumententafel.jpg
2) ../Produkte/Wechselrichter/Instrumententafel_Produktteaser.jpg
3) ../Produkte/Word Download Dokumente/Produkt Übersicht.doc
4) ../Products/Word downloads/Product overview.doc
In the case of language-dependent media (a different medium is used for every language provided in the project if the reference is the same, examples 3) and 4)), the display name in the respective language and/or the reference name will be used. In the case of language-independent media (the same medium is used for all languages, examples 1) and 2)), the display name in the master language is used. If none is assigned, the reference name will be used.
If the editor has not assigned a display name to a medium in one of the languages, the display name in the master language ("Master language fallback") and/or the reference name ("Reference name fallback") will be used. If this should lead to the creation of several identically named files in a directory, a number will be appended to differentiate them ("Disambiguation fallback"), e.g.
../logo.png
../logo.1.png
URLs can also be manually assigned to media folders by means of the API, e.g. "media" for the media root node.