$triggerWords
$triggerWords :
seekPage( $page, $urlPathSegmentIndex) : integer
recursively process the current page and its children looking for the segment with index $urlPathSegmentIndex Say you have the following path : /fr/products/testPage.html 'fr' will have an $urlPathSegmentIndex of 0, 'products' will have an $urlPathSegmentIndex of 1, 'testPage' will have an $urlPathSegmentIndex of 2,
The function will return the page uid having its $page->data['url_path_segment']['value'] matching the given $urlPathSegmentIndex, so if a page with uid = 31 has $page->data['url_path_segment']['value']='products', the function will return value 31 If no page is found, false is returned
$page | page object |
|
$urlPathSegmentIndex | the index representing the position of the seeked segment in the current path |
the page uid if found a match, else false
addTrigger(string $triggerWord, string $triggerType = 'segment', integer $returnPageUid)
Trigger words can be specified to the urlRewriter using this function. When a trigger word is met, the associated page Uid is called immediately.
Thus it is recommended that trigger words are met only for the required purpose in your site and not for pages unrelated to that purpose, as the trigger word would interfere with their own url rewriting.
string | $triggerWord | the trigger word to look for (ex : 'products') |
string | $triggerType | can be "segment" or "prefix". "segment" will attempt to match the triggerWord with the whole segment (ex:'/products/') while prefix will attempt to match a segment prefix (ex: 'products-for-your-home'); |
integer | $returnPageUid | this page uid will be returned when the trigger word is met inside the current page path. |