This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
My page is
localhost/user/matt/
The page also has an optional category parameter
localhost/user/matt/mycategory
The URL Identifiers are
/user/:username/:category?/:page?
If I'm on a page with no category and I display records with paginate, it injects its own "default" parameter.
localhost/user/matt/default/1
How can I change "default" to another word, such as "latest", so I can specify which category I want it to default to.
Here is the code that generates the Pagination link, I believe where it says (pageParam) is "default".
{{ this.page.baseFileName|page({ (pageParam): (records.CurrentPage) }) }}
From docs: https://octobercms.com/docs/cms/pages#url-syntax
Optional parameters can have default values which are used as fallback values in case the real parameter value is not presented in the URL. Default values cannot contain any asterisks, pipe symbols or question marks. The default value is specified after the question mark.
So your URL may look like
/user/:username/:category?latest/:page?
Pavel Chernov said:
From docs: https://octobercms.com/docs/cms/pages#url-syntax
Optional parameters can have default values which are used as fallback values in case the real parameter value is not presented in the URL. Default values cannot contain any asterisks, pipe symbols or question marks. The default value is specified after the question mark.
So your URL may look like
/user/:username/:category?latest/:page?
That worked great, thanks!
1-3 of 3