Page 1 of 1

Replacement Tokens - Multiple replacement

Posted: Tue May 29, 2012 4:59 am
by KBeng
It would be useful if all appearances of a variable with the same name could be replaced while entering the value only once.

Example for the attributes name and id beeing identical:

Code: Select all

<input type="text" name="%r[id]" id="%r[id]" />

Re: Replacement Tokens - Multiple replacement

Posted: Wed Aug 22, 2012 1:22 pm
by KBeng
Same goes for the new Auto-Replace feature.

Re: Replacement Tokens - Multiple replacement

Posted: Fri Aug 24, 2012 3:21 am
by TopStyle Support
The new Auto-Replace features does support this. Please take a look at this snippet:

Code: Select all

<input type="text" name="${1:hello}" id="$1" />
In this example, TopStyle 5 will prompt for a variable named "hello" only once, and then replace all appearances of it in your snippet.

Re: Replacement Tokens - Multiple replacement

Posted: Wed Aug 29, 2012 9:20 am
by KBeng
Perfect. Thank you! :)