Skip to content

Commit

Permalink
Add and update notes about URL generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kajetan Dvoracek authored and beatrycze-volk committed Jan 20, 2023
1 parent 5695328 commit 12f215c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Classes/Controller/DocumentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public function mainAction()
*
* * `PAGE_NO` (for value of `tx_dlf[page]`)
* * `DOUBLE_PAGE` (for value of `tx_dlf[double]`)
* * `PAGE_GRID` (for value of `tx_dlf[pagegrid]`)
*
* @return string
*/
Expand Down Expand Up @@ -155,8 +156,8 @@ protected function getUrlTemplate()
return $result;
};

// Generate two URLs that differ only in tx_dlf[page] and tx_dlf[double].
// We don't know the order of page and double parameters, so use the values for matching.
// Generate two URLs that differ in tx_dlf[page], tx_dlf[double] and tx_dlf[highlight].
// We don't know the order of these parameters, so use the values for matching.
$a = $make(2, 1, 0);
$b = $make(3, 0, 1);

Expand Down
9 changes: 9 additions & 0 deletions Documentation/Developers/ClientSide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ To dynamically show the metadata sections of the current page:

Rootline configuration is considered.

URLs and Slugs
==============

For dynamic link generation on the client, a URL template is generated in ``DocumentController::getUrlTemplate()``.
The template contains placeholders for the relevant parameters, which are then replaced by the current values in ``Controller::makePageUrl()``.
The generated URL does not include a ``cHash``.

This solution is intended to avoid generating all possible URL variants on the backend while still supporting slugs.

Various
=======

Expand Down

0 comments on commit 12f215c

Please sign in to comment.