Replacement Tokens - Multiple replacement

Post anything about TopStyle here. NOTE: TopStyle has been discontinued.

Moderator: TopStyle Support

Post Reply
KBeng
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 9
Joined: Tue May 29, 2012 4:42 am

Replacement Tokens - Multiple replacement

Post by KBeng » Tue May 29, 2012 4:59 am

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]" />

KBeng
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 9
Joined: Tue May 29, 2012 4:42 am

Re: Replacement Tokens - Multiple replacement

Post by KBeng » Wed Aug 22, 2012 1:22 pm

Same goes for the new Auto-Replace feature.

User avatar
TopStyle Support
Rank VI - Professional
Rank VI - Professional
Posts: 507
Joined: Sat Jun 13, 2009 12:38 pm
Contact:

Re: Replacement Tokens - Multiple replacement

Post by TopStyle Support » Fri Aug 24, 2012 3:21 am

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.

KBeng
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 9
Joined: Tue May 29, 2012 4:42 am

Re: Replacement Tokens - Multiple replacement

Post by KBeng » Wed Aug 29, 2012 9:20 am

Perfect. Thank you! :)

Post Reply