Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 27, 2022 09:45 pm GMT

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:

TokenUtility
$nameThe name of the item.
$idThe ID of the item.
$parentidThe ID of the parent of the item.
$parentnameThe name of the parent of the item.
$dateThe system date (yyyyMMdd).
$timeThe system time (HHmmss).
$nowThe 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.


Original Link: https://dev.to/esdanielgomez/sitecore-tokens-for-standard-values-210m

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To