1
Vote

Feature Request - Parameters in templates

description

Hi,
 
First, thanks a lot for this great plugin, it really saves me time :)
 
About the feature request :
I insert code snipets very often in my posts. As I use WordPress with a syntax highlighter plugin, I do not want to use WLW plugins for this.
So I made the following snipet :
 
<pre>[sourcecode language='csharp'] private string foo = "bar";   public void Foo() { // Do something nice } [/sourcecode]</pre>  
Which works nicely. The <pre> elements ensure that WLW does not mess up with my code layout.
The problem is that even with this template, I still have to switch to HTML view to ensure my code is pasted without WLW reformating it. Once pasted like this, returning to normal and modifying anything around the code does not modify my layout. But, really, moving to the HTML view each time is frustrating :)
 
So, what would be really nice is templates accepting parameters. Maybe something very simple such as:
 
<pre>[sourcecode language='csharp'] <% Content %> [/sourcecode]</pre>  
And when inserting this template, a simple TextBox which do not format anything could accept the Content to pass in.
 
Well, I'm aware it may not be so trivial but I think that would be a really nice addition.
 
Cheers,
 
Gildas

comments

gduncan411 wrote Apr 30, 2008 at 3:04 PM

I like the idea of runtime parameters, i.e. having a template that prompts you to enter something when you insert it.

That would make it easier to reuse templates and not have to have a bunch of templates that are "all most" the same. I like it...

There is another dynamic/template based WLW plugin you might want to take a look at. It's [url:http://www.joecheng.com/code/DynamicTemplate/] and seems like it might do what you're looking for already (instead of having to wait for me to code it up ;)

wrote Apr 30, 2008 at 3:04 PM

wrote Feb 12, 2013 at 8:25 PM