-
Notifications
You must be signed in to change notification settings - Fork 9
Page Naming
The page file name defines both the format of the page as the rendering engine used to render and process the page, for example mypage.html, the html defines the format, and mypage.html.php, defines the php template engine to pre-process the page.
A page file without a rendering engine is a static page and is not pre-processed. Pages support two types of rendering engines the default PHP Engine and the Markdown engine.
Joomlatools Pages allows to render a page in multiple formats. For example, /blog could be a HTML page with a listing of the posts, and /blog.rss the RSS feed of the posts.
As is typical with most web platforms, the default format is HTML. This means that when a user requests a page in their browser, for example: /blog/new-product-launched, because there is no file extension Pages assumes an HTML page is being requested.
Pages will look for a file that matches the format, in case of /blog/new-product-launched it will look for
/pages
└──blog
└── new-product-launched.html
If the user requested the format explicitly via /blog/new-product-launched.html, Pages would still look for that same file.
Pages is a flexible platform however, and can actually serve up any format you could wish for (html, xml, rss, json, etc.), you just have to provide a way to render it appropriately.
If you were to request a page with a .rss extension, for example: /blog.rss, instead of using the regular blog.html file to render it, Pages would look for a file called blog.rss.
Pages offers support for the following formats with their corresponding mime types:
- html => text/html
- txt => text/plain,
- csv => text/csv,
- js => application/javascript
- css => text/css
- json => application/json
- xml => text/xml
- rdf => application/rdf+xml
- atom => application/atom+xml
- rss => application/xml
See also: URL's and Linking > Pages
An optional second suffix defines the rendering engine that Pages should use to render the page. Out of the box Pages offers support for two rendering engines:
- PHP Engine:
mypage.html.php - Markdown:
mypage.html.md
Without a rendering engine the page content will be returned as is and will not be pre-processed.
See also: Templates
Got a question or need help? We have a forum on Github Discussions where you can get in touch with us.