DEV Community

Daniel Gomez
Daniel Gomez

Posted on

Sitecore Tokens for Standard Values

As Sitecore developers, when we're creating templates, a good practice is to add Standard Values so that fields can have default values, or sample values.

For this purpose, we can use Sitecore Tokens, this will allow us to dynamically add values to fields, according to the item that is being created by the Content Author.

Tokens:

These are the tokens that we can use:

Token Utility
$name The name of the item.
$id The ID of the item.
$parentid The ID of the parent of the item.
$parentname The name of the parent of the item.
$date The system date (yyyyMMdd).
$time The system time (HHmmss).
$now The system date and time (yyyyMMddTHHmmss).

Example:

Below we can see an example with the $name token. In this example, we have a field with the name Heading, and at the time of creating a new item, this field will take the name of the item.

Thanks for reading!

Now you know how to dynamically add values to your Standard Values and the different tokens you can use in a general way.

If you have any questions or ideas in mind, it will be a pleasure to be able to be in communication with you, and together exchange knowledge with each other.

See you on Twitter / esDanielGomez.com.

Top comments (0)