Parameters to snippets
Moderator: kfury77
Forum rules
Please follow these guidelines when posting feature requests. This will help to increase the value of your contribution.
Please follow these guidelines when posting feature requests. This will help to increase the value of your contribution.
- Do not create new topics for already requested features. Add your comments to the existing feature request topics instead;
- Create separate topic for each feature suggestion. Do NOT post a number of non-related feature suggestions in a single topic;
- Give your topic a meaningful title. Do NOT create topics with meaningless titles, such as "My Suggestion" or "My Problem".
Parameters to snippets
I made some snippets, for example: one that add a div with a class. The snippet ask for the class name and works very fine. In this example I like to (without typing twice the class name) produce the following code:
<div>
</div> <namefortheclass>
Actually I can produce just this (without typing twice the class name)
<div>
</div> <!-- -->
So, I am asking for some of the "old DOS" parameter passing like %0, %1 in the definition of the snippet.
Do I made myself clear?
Regards
<div>
</div> <namefortheclass>
Actually I can produce just this (without typing twice the class name)
<div>
</div> <!-- -->
So, I am asking for some of the "old DOS" parameter passing like %0, %1 in the definition of the snippet.
Do I made myself clear?
Regards
- syrupcore
- Top Contributor
- Posts: 917
- Joined: Thu Jul 21, 2005 12:58 am
- Location: Portland, Oregon, usa
- Contact:
I've wished for something similar a few times. There are many times when you want what the snippet has asked for in two places. I think the second situation Nutuo is asking about is one that I run into a lot - adding a wrapping div and wanting to add a comment to the end, saying it's closed like:
To do this now, you've got to enter "foobar" twice. Certainly not a big deal but if the software could do it for you, I wouldn't mind. 
Another common situation for me is wrapping something in tags. I have a shortcut with this in it:
So I type "blockquote" or "abbr" twice. If the second variable could be auto populated with the data from the first, it would a be a little faster and, more importantly, it would reduce the chance for typos.
The snippets library is so great. It makes my workmates jealous.
Will
Code: Select all
<div id="foobar">
</div><!-- /end foobar -->

Another common situation for me is wrapping something in tags. I have a shortcut with this in it:
Code: Select all
before:<%[Enter Tag]%>
after: </%[Enter Tag]%>
The snippets library is so great. It makes my workmates jealous.

Will
- syrupcore
- Top Contributor
- Posts: 917
- Joined: Thu Jul 21, 2005 12:58 am
- Location: Portland, Oregon, usa
- Contact:
had another situation this evening where auto repeated variables in snippets would have made my life a little better. I was doing massive select lists and spent an hour typing stuff like:
Webuilder not having this feature is not a big deal to me at all. Just sharing an example of where it would be useful in my work.
Will
Code: Select all
<option value="foo">Foo</option>
<option value="bar">Bar</option>
<option value="another">Another</option>
<option value="andanother">Andanother</option>
<option value="andandanother">Andandanother</option>
<option value="andandandanother">Andandandanother</option>
Will
-
- Posts: 1
- Joined: Wed Jan 30, 2008 11:02 am
I want to second this request.
Especially when working with forms this feature would be extremely useful. Check the following code:
That's a lot of ids, and a lot of room for typos. It would be incredibly handy to have to type the id only once. The snippets are great already, but this would make them extremely powerful.
Especially when working with forms this feature would be extremely useful. Check the following code:
Code: Select all
[label for="id"][input type="text" id="id" name="id"]