LaubPlusCo.Helix.VsTemplates icon indicating copy to clipboard operation
LaubPlusCo.Helix.VsTemplates copied to clipboard

Ability to run custom code for token values.

Open GreyGhostStudio opened this issue 4 years ago • 0 comments

Example 1: <token key="$mediaLibraryGuid$" displayName="Media Library Guid" valueType="YourName.Namespace.Tokens.CustomTokens, YourName.Namespace.HelixTemplating" type="guid" input="Text" hidden="true" />

Use Case: Have the template seed a handful of Sitecore items by writing out .yml when the project is created. The .yml need GUID's created for the Sitecore items. VS templates allow for up to 10 GUIDs ($guid1-10$) OOTB but that might be limiting in the future. https://docs.microsoft.com/en-us/visualstudio/ide/template-parameters?view=vs-2019

Example 2: <token key="$unicornSecret$" displayName="Unicorn Secret" valueType="YourName.Namespace.Tokens.CustomTokens, YourName.Namespace.HelixTemplating" type="hex" length="40" input="Text" hidden="true" />

Use Case: At the solution level, we would like to set these values during creation. Passing in a type of "hex" and a length would solve this. The custom class would return the generated value.

Bonus: Ability to hide tokens from the screen with a hidden attribute, but still include in the token array would make the UI much cleaner.

GreyGhostStudio avatar Apr 16 '20 22:04 GreyGhostStudio