Parameters to snippets

Let us know what you would like to see in the next version of this software

Moderator: kfury77

Forum rules
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".
Please note that we DO READ all suggestions, even if a reply is not posted. Thanks!
Post Reply
User avatar
notuo
Posts: 258
Joined: Sat Jul 09, 2005 8:07 pm
Location: Tlalpan, Mexico City, Mexico

Parameters to snippets

Post by notuo »

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
User avatar
syrupcore
Top Contributor
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa
Contact:

Post by syrupcore »

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:

Code: Select all

<div id="foobar">

</div><!-- /end foobar -->
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:

Code: Select all

before:<%[Enter Tag]%>
after: </%[Enter Tag]%>
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
User avatar
notuo
Posts: 258
Joined: Sat Jul 09, 2005 8:07 pm
Location: Tlalpan, Mexico City, Mexico

Post by notuo »

Exactly my point.

Cheers
User avatar
syrupcore
Top Contributor
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa
Contact:

Post by syrupcore »

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:

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>
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
User avatar
notuo
Posts: 258
Joined: Sat Jul 09, 2005 8:07 pm
Location: Tlalpan, Mexico City, Mexico

Post by notuo »

Karlis.

I like to see your opinion on this.

Regards
Niels Matthijs
Posts: 1
Joined: Wed Jan 30, 2008 11:02 am

Post by Niels Matthijs »

I want to second this request.

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"]
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.
Gatis
Blumentals Software Developer
Posts: 545
Joined: Sun Mar 05, 2006 12:30 am
Location: Latvia

Post by Gatis »

Actually we have this in our to do list.
So, it is not "if" but "when" ;)
We have still some time till next major version, let us hope we manage to make some improvements here.
User avatar
notuo
Posts: 258
Joined: Sat Jul 09, 2005 8:07 pm
Location: Tlalpan, Mexico City, Mexico

Post by notuo »

Good to hear this.
Thanks
Post Reply