Editing
Web Template
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Fields== ===DataModel=== The DataModel field is a name of an entity type, such as Equipment or Employee, which specifies the specific data to load for the page template. For example, if you are writing a page which lists employees, it is useful to preload the data necessary - this is done by setting DataModel to "Employee". This field is optional. ===Slug === The Slug field denotes the name of the page itself, intended to be a short text field which describes the function of the page. Note that it cannot contain any slashes ('/', '\'), and should use only characters which are URL-safe; when in doubt, stick to just numbers and letters. The DataModel and slug fields combine to form a path to the page, with the form ''www.domain.com/v1/DataModel/Slug?id=XXXXXXXX-XXXX-XXXX-XXXXXXXX''. If the DataModel field is empty, then the URL is simply ''www.domain.com/v1/Slug''. This allows you to create pages which do not have to be tied to a specific entity. If a page has a DataModel and the id query does not match any page, then a 404 Not Found is returned to the user. === Description === The Description field is a non-functional field which allows you to add a description to the template - this is not necessary, but can be useful as a reference. === Template === The source code for the template, which is in the Razor syntax - a mix of C# and HTML. ===Visible=== The Visible field denotes whether the page is accessibly via a URL - if it is not visible, then a 404 Not Found is returned when trying to access it - it is as if it didn't exist. Use this if you want to disable a page or if the template is only relevant in the context of other templates - see [[#Partial%20Templates|Partial Templates]] === Root URL === This field is default to false. It defines whether the URL of the page is a root URL, or whether it is prefixed by "v1/" (The default is the prefix). We have the prefix so that we can add our own endpoints to the Web Engine, such as the "/login" endpoint, without clashing with any endpoints that you have created. However, if you do want to remove the prefix, untick this box. In order to allow you to choose a URL which is guaranteed to never clash with our own endpoints, you can start your [[#Slug|slug]] with a capital letter - we reserve all lowercase letter slugs that are not prefixed with "v1/". Tick this box at your own risk, since if we add an endpoint in future that has the same name as a page you have added, your page will effectively become inaccessible.
Summary:
Please note that all contributions to PRS may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
PRS:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Refresh
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information