October 3, 2022 10:05 by
Peter
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 add automatic generation of field 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.
European best, cheap and reliable ASP.NET hosting with instant activation. HostForLIFE.eu is #1 Recommended Windows and ASP.NET hosting in European Continent. With 99.99% Uptime Guaranteed of Relibility, Stability and Performace. HostForLIFE.eu security team is constantly monitoring the entire network for unusual behaviour. We deliver hosting solution including Shared hosting, Cloud hosting, Reseller hosting, Dedicated Servers, and IT as Service for companies of all size.