Commit bcfdd50e authored by Marc Egger's avatar Marc Egger
Browse files

Refs #12588 Documentation: replace {{pageId:T}}

parent df04ed06
Pipeline #5483 passed with stages
in 5 minutes and 9 seconds
......@@ -60,14 +60,23 @@ Date: <date>
Notes
^^^^^
* Typo3 v9 uses url paths instead of page ids for urls. e.g. "/home" instead of "home/index.php?id=home"
* The Typo3 pages do not have the alias property anymore.
* QFQ used to generate links of the form "index.php?id=home&...". Those don't work anymore.
* QFQ now generates qfq links using the page slug. e.g. "p:/some/page?foo=bar" AS _link generates a link with url "https://mydomain.com/some/page?foo=bar".
* A page slug always starts with a slash "/" and QFQ expects that slash to be there.
pageAlias vs. slug (>= V9):
* The following applies only for Typo3 V9 and greater installations.
* Typo3 v9 uses url paths instead of page ids for urls. e.g. "/home" instead of "/index.php?id=home"
* Typo3 pages do not have the alias property anymore.
* QFQ used to generate links of the form "index.php?id=myPage&foo=bar...". Those don't work anymore.
* QFQ now generates qfq links using the page slug. E.g. "p:/home/myPage?foo=bar" AS _link generates a link with url "https://mydomain.com/home/myPage?foo=bar".
* A page slug always starts with a slash "/" and QFQ expects that slash to be there.
* Every existing QFQ link has to be adjusted to the new format using slugs instead of page id or alias.
* QFQ shows an automatic detection and migration dialog to help with fixing all broken links.
* After the migration dialog has been deactivated it can be reactivated by setting the variable FORCE_RUN_PAGE_SLUG_MIGRATION_CHECK to true in filedamin/protected/qfqProject/conf/qfq.json
* Successful migration will be marked as done:
* table Form, table comment: pageSlugMigration=done
* Easy step to offer migration dialog again: filedamin/protected/qfqProject/conf/qfq.json / "FORCE_RUN_PAGE_SLUG_MIGRATION_CHECK":"true"
* For the new links to work properly the base Url has to be configured in the QFQ Typo3 settings.
* Please follow these practices:
......@@ -80,7 +89,7 @@ Notes
* Hint: Typo3 replaces "_" with "-" when converting an alias to a slug during the Typo3 version 9 upgrade.
* Replace the "U:" token with "p:" for all sepecial columns except _paged. I.e. "U: ... &id=[alias]& ... " becomes "p:[slug]? ... ".
* Replace the "U:" token with "p:" for all special columns except _paged. I.e. "U: ... &id=[alias]& ... " becomes "p:[slug]? ... ".
Features
......@@ -88,7 +97,7 @@ Features
* {{pageSlug:T}} holds the slug of the current page. (Typo3 v9 and up)
* The "p:.." token now takes page slugs instead of alias everywhere. (Typo3 v9 and up)
* provide dialog for the developer to migrate from page alias to page slug. (Typo3 v9 and up)
* Provide dialog for the developer to migrate from page alias to page slug. (Typo3 v9 and up)
Bug Fixes
^^^^^^^^^
......
......@@ -707,7 +707,7 @@ Column: _link
+---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
|x | |Mail |m:<email> |m:info@example.com |Default link class: email |
+---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
|x | |Page |p:<pageId> |p:impressum |Prepend '?' or '?id=', no hostname qualifier (automatically set by browser) |
|x | |Page |p:<pageSlug> |p:/impressum?foo=bar |Append optional GET parameters afeter '?', no hostname qualifier (automatically set by browser) |
+---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
|x | |Download |d:[<exportFilename>] |d:complete.pdf |Link points to `.../typo3conf/ext/qfq/Api/download.php`. Additional parameter SIP encoded. 'Download' needs SIP. See :ref:`download`. |
+---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
......
......@@ -177,7 +177,7 @@ Now past in the following code into the Text field:
form={{form:SE}}
10 {
sql = SELECT CONCAT('{{pageId:T}}&form=Form&') as _Pagen, '#', 'Name', 'Title', 'Table', '' FROM (SELECT 1) AS fake WHERE '{{form:SE}}'=''
sql = SELECT CONCAT('{{pageSlug:T}}?form=Form&') as _Pagen, '#', 'Name', 'Title', 'Table', '' FROM (SELECT 1) AS fake WHERE '{{form:SE}}'=''
head = <table class="table table-hover qfq-table-50">
tail = </table>
rbeg = <thead><tr>
......@@ -186,7 +186,7 @@ Now past in the following code into the Text field:
fend = </th>
10 {
# All forms
sql = SELECT CONCAT('{{pageId:T}}&form=Form&r=', f.id) as _Pagee, f.id, f.name, f.title, f.tableName, CONCAT('form=form&r=', f.id) as _Paged FROM Form AS f ORDER BY f.name
sql = SELECT CONCAT('{{pageSlug:T}}?form=Form&r=', f.id) as _Pagee, f.id, f.name, f.title, f.tableName, CONCAT('form=form&r=', f.id) as _Paged FROM Form AS f ORDER BY f.name
rbeg = <tr>
rend = </tr>
fbeg = <td>
......@@ -451,7 +451,7 @@ Delete the whole Query and paste in the following SQL Statement: ::
form={{form}}
10 {
sql = SELECT CONCAT('{{pageId:T}}&form=Application&') as _Pagee, a.id, a.name, a.firstname, a.gender, a.dateOfBirth, a.adrStreet, a.adrZipCity FROM Application AS a, (SELECT 1) AS fake WHERE '{{form:SE}}'=''
sql = SELECT CONCAT('{{pageSlug:T}}?form=Application&') as _Pagee, a.id, a.name, a.firstname, a.gender, a.dateOfBirth, a.adrStreet, a.adrZipCity FROM Application AS a, (SELECT 1) AS fake WHERE '{{form:SE}}'=''
head = <table class='table table-hover qfq-table-50'><thead><tr><th>Form</th><th>#</th><th>name</th><th>First Name</th> <th>Gender</th><th>Date of birth</th><th>Street</th><th>Zip</th></tr><thead><tbody>
tail = </tbody></table>
rbeg = <tr>
......@@ -471,13 +471,14 @@ of the new lines of code:
Details: https://docs.typo3.org/typo3cms/drafts/github/T3DocumentationStarter/Public-Info-053/Manual.html#qfq-keywords-bodytext
- *SELECT CONCAT('{{pageId:T}}&form=Application&') as _Pagee*: This line create the button which opens up the Form.
- *SELECT CONCAT('{{pageSlug:T}}?form=Application&') as _Pagee*: This line create the button which opens up the Form.
Details: https://docs.typo3.org/typo3cms/drafts/github/T3DocumentationStarter/Public-Info-053/Manual.html#store-typo3-bodytext-t
- *{{pageId:T}}* is just a number. When you go to the Typo3 Page, and you hover over the page of Application, you will see
the Page Alias and the Page id. Here the Statement *{{pageId:T}}* goes to Typo3 and checks what the PageId of the current page is.
The reason why *{{pageId:T}}* is a part of the URL is simple. We don't want to create a new page just to open up a Form. The Form
is going to be opened on the Application page.
- *{{pageSlug:T}}* holds the url slug (i.e. the address) of the current Typo3 page. If you open a Typo3 page you will
see the url slug of that page. E.g. if the page slug is "/something/myPage" then the url will look like
https://host.com/pathToTypo3Installation/something/myPage . The slug can be changed in the settings of a page in the
Typo3 backend. The reason why we use *{{pageSlug:T}}* here is simple. We don't want to create a new page just
to open up a Form. The Form is going to be opened on the Application page.
- *&form=Application&*: This line opens up the Form Application. Whenever you want to create a link, where a specific Form is
going to be opened, you have to specify which Form you want to open up, with this notation.
......@@ -520,7 +521,7 @@ Delete your query and paste the following: ::
form={{form}}
10 {
sql = SELECT CONCAT('{{pageId:T}}&form=Application&r=',a.id) as _Pagee, a.id, a.name, a.firstname, a.gender, a.dateOfBirth, a.adrStreet, a.adrZipCity FROM Application AS a, (SELECT 1) AS fake WHERE '{{form:SE}}'=''
sql = SELECT CONCAT('{{pageSlug:T}}?form=Application&r=',a.id) as _Pagee, a.id, a.name, a.firstname, a.gender, a.dateOfBirth, a.adrStreet, a.adrZipCity FROM Application AS a, (SELECT 1) AS fake WHERE '{{form:SE}}'=''
head = <table class='table table-hover qfq-table-50'><thead><tr><th>Form</th><th>#</th><th>name</th><th>First Name</th> <th>Gender</th><th>Date of birth</th><th>Street</th><th>Zip</th></tr><thead><tbody>
tail = </tbody></table>
rbeg = <tr>
......@@ -623,14 +624,14 @@ Here a working query if yours is not working: ::
form={{form}}
10 {
sql = SELECT CONCAT('{{pageId:T}}&form=person&r=0') as _Pagen, '<br><br>' FROM (SELECT 1) AS
sql = SELECT CONCAT('{{pageSlug:T}}?form=person&r=0') as _Pagen, '<br><br>' FROM (SELECT 1) AS
fake WHERE '{{form:SE}}'=''
}
20 {
sql = SELECT p.flag AS _flag, IF(p.flag=0,'Reviewer','Admin') AS _type FROM Person AS p GROUP BY p.flag
10 {
sql = SELECT CONCAT('{{pageId:T}}&form=person&r=',p.id) as _Pagee, p.id, p.name,
sql = SELECT CONCAT('{{pageSlug:T}}?form=person&r=',p.id) as _Pagee, p.id, p.name,
p.firstname, p.gender, p.dateOfBirth, p.adrStreet, p.adrZipCity, p.email FROM Person AS p,
(SELECT 1) AS fake WHERE '{{form:SE}}'='' AND p.flag = '{{flag:R}}'
head = <table class='table table-hover' style="width: unset"><b>{{type:R0}}</b>
......@@ -820,10 +821,10 @@ You can paste the following Query into the QFQ element: ::
form={{form}}
10 {
sql = SELECT CONCAT('{{pageId:T}}&form=jobOffer&r=0') as _Pagen FROM (SELECT 1) AS fake WHERE '{{form:SE}}'=''
sql = SELECT CONCAT('{{pageSlug:T}}?form=jobOffer&r=0') as _Pagen FROM (SELECT 1) AS fake WHERE '{{form:SE}}'=''
}
20 {
sql = SELECT CONCAT('{{pageId:T}}&form=jobOffer&r=',jo.id) as _Pagee, jo.id, jo.type, jo.title, jo.start, jo.end, jo.description, jo.emailContact FROM JobOffer AS jo, (SELECT 1) AS fake WHERE '{{form:SE}}'='' AND jo.start<=NOW() AND NOW()<= jo.end
sql = SELECT CONCAT('{{pageSlug:T}}?form=jobOffer&r=',jo.id) as _Pagee, jo.id, jo.type, jo.title, jo.start, jo.end, jo.description, jo.emailContact FROM JobOffer AS jo, (SELECT 1) AS fake WHERE '{{form:SE}}'='' AND jo.start<=NOW() AND NOW()<= jo.end
head = <table class='table table-hover qfq-table-50'><thead><tr><th>Form</th><th>#</th><th>Type</th><th>Title</th> <th>Start</th><th>End</th><th>Description</th><th>Email</th></tr><thead><tbody>
tail = </tbody></table>
rbeg = <tr>
......@@ -845,7 +846,7 @@ As as always create a new Typo3 page and add a QFQ element. You can paste the fo
form={{form}}
10 {
sql = SELECT CONCAT('u:{{pageId:T}}&form=Application&r=0','|t:Apply|b:1|s:1') as _link, jo.id, jo.type, jo.title, jo.start, jo.end, jo.description, jo.emailContact FROM JobOffer AS jo, (SELECT 1) AS fake WHERE '{{form:SE}}'='' AND jo.start<=NOW() AND NOW()<= jo.end
sql = SELECT CONCAT('u:{{pageSlug:T}}?form=Application&r=0','|t:Apply|b:1|s:1') as _link, jo.id, jo.type, jo.title, jo.start, jo.end, jo.description, jo.emailContact FROM JobOffer AS jo, (SELECT 1) AS fake WHERE '{{form:SE}}'='' AND jo.start<=NOW() AND NOW()<= jo.end
head = <table class='table table-hover qfq-table-50'><thead><tr><th>Form</th><th>#</th><th>Type</th><th>Title</th> <th>Start</th><th>End</th><th>Description</th><th>Email</th></tr><thead><tbody>
tail = </tbody></table>
rbeg = <tr>
......@@ -857,14 +858,14 @@ As as always create a new Typo3 page and add a QFQ element. You can paste the fo
Here we see the following statement which might be new for you: ::
CONCAT('u:{{pageId:T}}&form=Application&r=0','|t:Apply|b:1|s:1') as _link
CONCAT('u:{{pageSlug:T}}?form=Application&r=0','|t:Apply|b:1|s:1') as _link
Until now whenever we wanted to create a button to open a form, we always worked with *_Pagen* or *Pagee*. These are most
of the time good enough. But this time we needed something more. We needed a button with the word "Apply" on it.
For that purpuse we used the button *_link* insted of *_Pagee*. One more thing you might find confunsing are the qualifier.
We well go throw all qualifiers used in this example:
u: The u qualifier is used in the first part of the link *(u:{{pageId:T}}&form=Application&r=0')*. The u qualifier just
u: The u qualifier is used in the first part of the link *(u:{{pageSlug:T}}?form=Application&r=0')*. The u qualifier just
tells QFQ that whatever comes in between u: and | is going to be the link.
t: Whatever comes in between t: and | is going to be written on the button.
......@@ -905,7 +906,7 @@ following Query: ::
form={{form}}
10 {
sql = SELECT CONCAT('u:{{pageId:T}}&form=Application&r=0&joId=',jo.id,'|t:Apply|b:1|s:1') as _link, jo.id, jo.type, jo.title, jo.start, jo.end, jo.description, jo.emailContact FROM JobOffer AS jo, (SELECT 1) AS fake WHERE '{{form:SE}}'='' AND jo.start<=NOW() AND NOW()<= jo.end
sql = SELECT CONCAT('u:{{pageSlug:T}}?form=Application&r=0&joId=',jo.id,'|t:Apply|b:1|s:1') as _link, jo.id, jo.type, jo.title, jo.start, jo.end, jo.description, jo.emailContact FROM JobOffer AS jo, (SELECT 1) AS fake WHERE '{{form:SE}}'='' AND jo.start<=NOW() AND NOW()<= jo.end
head = <table class='table table-hover qfq-table-50'><thead><tr><th>Form</th><th>#</th><th>Type</th><th>Title</th> <th>Start</th><th>End</th><th>Description</th><th>Email</th></tr><thead><tbody>
tail = </tbody></table>
rbeg = <tr>
......@@ -917,11 +918,11 @@ following Query: ::
The only difference from before to now is the following: we changed the link from : ::
CONCAT('u:{{pageId:T}}&form=Application&r=0|t:Apply|b:1|s:1') as _link
CONCAT('u:{{pageSlug:T}}?form=Application&r=0|t:Apply|b:1|s:1') as _link
to: ::
CONCAT('u:{{pageId:T}}&form=Application&r=0&joId=',jo.id,'|t:Apply|b:1|s:1') as _link
CONCAT('u:{{pageSlug:T}}?form=Application&r=0&joId=',jo.id,'|t:Apply|b:1|s:1') as _link
So now you can see that we added a new parameter to the link. The jo.id so the unique id which tells the form exactly
for which job the applicant just applied for.
......@@ -979,7 +980,7 @@ Delete your query on the page Applications and paste in the follwoing: ::
form={{form}}
10 {
sql = SELECT CONCAT('{{pageId:T}}&form=Application&r=0') as _Pagen, '<br><br>' FROM (SELECT 1) AS
sql = SELECT CONCAT('{{pageSlug:T}}?form=Application&r=0') as _Pagen, '<br><br>' FROM (SELECT 1) AS
fake WHERE '{{form:SE}}'=''
}
20 {
......@@ -987,7 +988,7 @@ Delete your query on the page Applications and paste in the follwoing: ::
jo.start <= NOW() AND NOW() <= jo.end
10 {
sql = SELECT CONCAT('{{pageId:T}}&form=Application&r=',a.id) as _Pagee, a.id, a.name,
sql = SELECT CONCAT('{{pageSlug:T}}?form=Application&r=',a.id) as _Pagee, a.id, a.name,
a.firstname, a.gender, a.dateOfBirth, a.adrStreet, a.adrZipCity FROM Application AS a,
(SELECT 1) AS fake WHERE '{{form:SE}}'='' AND a.joId = '{{joId:R}}'
head = <table class='table table-hover' style="width: unset"><b>{{joTitle:R0}}</b>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment