Passing Parameters into a Snippet

Hi @AndyPage

It's an interesting idea and one that comes up once a while (usually from users with previous programming experience :slightly_smiling_face:). Also see a similar post from a while ago: RegEx Shortcuts

What you are suggesting can be done using command packs. Command packs are groups of commands, and each command can accept positional and/or named properties (just as you described). Right now, users cannot create their own command packs, but we may enable this in the future.

With command packs, you will still need to create separate /radio, /bbc, /abc snippets. It will not work like the way you asked for (/link?radio). So, let's drill down on your quote above. I am curious to understand what is the primary issue you face in the current user experience with having one snippet with one dropdown? Is it organization, speed, muscle memory, etc.? Once I have a clearer idea then maybe I can provide a good temporary workaround.


This was my old answer. This may NOT work for you but I am keeping it for posterity.

You can use imported snippets like so:

/master snippet: you can add more conditional logic here but I just have a simple example

https://{=name}.com

/bbc snippet:

{import: /master}{name="bbc"}

/fox snippet:

{import: /master}{name="fox"}

This will NOT work correctly in case you have multiple imports in the same snippet. For example,

{import: /master}{name="bbc"},{import: /master}{name="fox"}

will result in https://fox.com,https://fox.com