Hi Danielo
On Thursday, May 29, 2014 2:22:19 PM UTC+2, Danielo Rodríguez wrote:
> Hello Matabelle
>
> I'm still not understanding the need of complicating things. If you want
> to specify the target tiddler you have an specific parameter called
> tiddler. Why would you need two things for the same purpose? In TW the !!
> notation is used for variable substitution. When I read your examples I
> expect the field name to be substituted for some variable called field1.
> Maybe you understand it and find it logical but for me is confusing.
>
I wished to maintain a consistent behaviour for 'set=' and setTo='
attributes -- this behaviour is borrowed from the <$button> and
<$linkcatcher> widgets.
For example, if I write: <$button set="field-one" setTo="one">Set</$button>
-- I create a new tiddler titled 'field-one' with a value of 'one' in the
text field. The correct syntax in this instance is: <$button
set="!!field-one" setTo="one">Set</$button>
In addition, this allows the <$setfield> widget to be used with this
syntax: <$setfield set="Target!!field" setTo="value"> -- which targets a
tiddler other than the default without changing the title of the tiddler
passed in the parameter attribute.
> Also having the option of construct a stack is nice but make it the only
> way is a pain. Do you remember the let and set widgets? Which one do you
> prefer to use? ;-) Would you consider to accept a list of fields and a list
> of values? Maybe for a different widget?
>
In the case of the <$let> widget, I read somewhere that the widget did not
interpret the values for the variable to adopt in the same way as the
<$set> widget - if I remember there were problems with values such as:
{{!!reference-field}} or perhaps <<someMacro>>. I never tried this, which
explains my poor memory :-(
The idea of using attributes carrying a list is a good one -- but beyond my
meagre javascript skills. I am afraid I am restricted pretty much to copy
and paste of existing code fragments.
I would enjoy a syntax something like: <$setfield
fields="[field-one:"value1",field-two:"value2",...]">, but I think there
would be problems when it came round to something like this: <$setfield
fields="[field-one:"value1",field-two:{{!!some-field}},field-three:<<someMacro>>...]">
If this is possible, then the syntax should be changed, else perhaps, this
functionality belongs in another widget -- just as the <$set> and <$let>
widgets each have their appropriate context of use, there would be a case
here for two widgets.
An alternative is to modify the <$setfield> widget to understand a
shorthand syntax for simple cases -- whilst keeping the functionality of
the existing attributes. Something along the lines of:
<$setfield set="field-one" setTo={{!!reference-field}}
fields="[field-two:"string-two",field-three:"string-three",...]">
I think, perhaps, this unnecessarily confuses things with little saving in
effort - two separate widgets is probably the way to go.
regards
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.