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 f…


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Daniel Gomez Jaramillo

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.


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Daniel Gomez Jaramillo


Print Share Comment Cite Upload Translate Updates
APA

Daniel Gomez Jaramillo | Sciencx (2022-09-27T21:45:57+00:00) Sitecore Tokens for Standard Values. Retrieved from https://www.scien.cx/2022/09/27/sitecore-tokens-for-standard-values/

MLA
" » Sitecore Tokens for Standard Values." Daniel Gomez Jaramillo | Sciencx - Tuesday September 27, 2022, https://www.scien.cx/2022/09/27/sitecore-tokens-for-standard-values/
HARVARD
Daniel Gomez Jaramillo | Sciencx Tuesday September 27, 2022 » Sitecore Tokens for Standard Values., viewed ,<https://www.scien.cx/2022/09/27/sitecore-tokens-for-standard-values/>
VANCOUVER
Daniel Gomez Jaramillo | Sciencx - » Sitecore Tokens for Standard Values. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/09/27/sitecore-tokens-for-standard-values/
CHICAGO
" » Sitecore Tokens for Standard Values." Daniel Gomez Jaramillo | Sciencx - Accessed . https://www.scien.cx/2022/09/27/sitecore-tokens-for-standard-values/
IEEE
" » Sitecore Tokens for Standard Values." Daniel Gomez Jaramillo | Sciencx [Online]. Available: https://www.scien.cx/2022/09/27/sitecore-tokens-for-standard-values/. [Accessed: ]
rf:citation
» Sitecore Tokens for Standard Values | Daniel Gomez Jaramillo | Sciencx | https://www.scien.cx/2022/09/27/sitecore-tokens-for-standard-values/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.