Skip to content

retohugi/SitecoreExtension-TokenSet

Repository files navigation

Build status

Token Set - a Sitecore Extension

This extension provides additional standard value tokens for Sitecore Data Templates. Read John West's blog post for an introduction on Standard Value Tokens.

Well, it might be a bit exaggerated to call two extensions a "set", but I'm planning to add some more. Have an idea for a cool token? Let me know or even better send a pull request. :)

Available Tokens

Token Description
$query(sitecore query|field name)
Where sitecore query is a Sitecore query, executed relative to the position in the content tree where the new item is created. The token takes the first item in the result and replaces itself with the value of field name.

Usage Examples:
Provide some kind of dynamic default values authors can manage (nope, Authors should not edit _Standard Values templates):
$query(/sitecore/content/Website/Config//*[@@name="Default config"]|Default Title)
Or simply create dynamic defaults by copying the content from a parent items field.
$query(..|Description)
$futureDate(yy,mm,dd)
The $futureDate token was originally created by @briancaos but slightly rewritten for the module.
It adds years, months and days to the date of the item creation.
For example:
  • $futureDate(1,0,0) = Adds Now + 1 year
  • $futureDate(0,6,0) = Adds Now + 6 months
  • $futureDate(1,6,12) = Adds Now + 1 year, 6 months, 12 days

Tested on

  • Sitecore 7.0 (but should work with 6.x)

Installation

Install via NuGet Gallery

  PM> Install-Package SitecoreExtension.TokenSet

Build

See Readme.md in the /build folder.

Contribute

Have an idea for another handy standard value token? Let me know and create an issue on GitHub or even better, make a pull request.

About

A collection of Standard Values Token for Sitecore.

Resources

License

Stars

Watchers

Forks

Packages

No packages published