On Thursday, January 9, 2020 at 11:03:51 PM UTC+3:30, J Mc wrote:
>
> *Hi Mohammad*
>
> this is another excellent example of how to use TW.
> Would it be possible to add tags and a tiddler type selection to the form?
>
>
>
Please have a look 
at https://groups.google.com/d/msg/tiddlywiki/h9WI6UCPuJM/QbYywce3CAAJ
The above code is used in Commander!

--Mohammad

 

> I added an example in the post below, that you may be interested in.
>
> https://groups.google.com/forum/#!topic/tiddlywiki/c8HZhq74JdQ
>
> Many thanks. I will have a look.


--Mohammad

 

> On Thursday, 9 January 2020 08:22:31 UTC, Mohammad wrote:
>>
>> I have created the below interface to create a tiddler with many fields!
>> The field name and value pairs are collected from variable number of 
>> input boxes
>>
>> While this work seamlessly I am looking for a simpler code!
>>
>>
>> To give a try go to tiddlywiki.com create a new tiddler and paste the 
>> below code!
>>
>>
>> \define createMyTiddler()
>> <$vars newTitle={{{ [<newtiddlerdName>get[text]] }}}>
>> <$wikify name=flt text={{{ [<datafieldsTid>indexes[]count[]] }}}> 
>> <$list filter=<<myfilter>> variable="cnt">
>> <$action-setfield $tiddler=<<newTitle>> 
>>  $field={{{ [<datafieldsTid>getindex<id_fldName>]  }}} 
>>  $value={{{ [<datafieldsTid>getindex<id_fldValue>] }}} />
>> </$list>
>> </$wikify>
>> </$vars>
>>
>> \end
>>
>>
>> \define datafieldsTid()       $:/temp/sample
>> \define newtiddlerdName()     $:/temp/tidName
>> \define myfilter()     [range[1,$(flt)$]]
>> \define id_fldName()   fldn$(cnt)$
>> \define id_fldValue()  fldv$(cnt)$
>>
>> \define create-records()
>> <$wikify name=flt text={{{ [<datafieldsTid>get[counter]]~[[1]] }}}>
>> <$list filter=<<myfilter>> variable=cnt>
>>
>> <<getInputs>>
>> </$list>
>> </$wikify>
>> \end
>>
>> \define getInputs()
>> <$edit-text tiddler=<<datafieldsTid>> index=<<id_fldName>>  tag=input  
>> default="" placeholder="field name"/>
>> <$edit-text tiddler=<<datafieldsTid>> index=<<id_fldValue>> tag=input  
>> default="" placeholder="field value"/>
>> \end
>>
>>
>> <!-- Interface -->
>>
>> <$button>add
>> <$action-setfield $tiddler=<<datafieldsTid>> 
>> counter={{{[<datafieldsTid>get[counter]add[1]]~[[2]]}}}/>
>> </$button>
>> <$button>reset
>> <$action-setfield $tiddler=<<datafieldsTid>> counter="1"/>
>> <$action-setfield $tiddler=<<datafieldsTid>> text=""/>
>> <$action-setfield $tiddler=<<newtiddlerdName>> text=""/>
>> </$button>
>>
>> Number of records: <$count filter="[<datafieldsTid>indexes[]]" /><br>
>> Counter: <$transclude tiddler=<<datafieldsTid>> field="counter"/><br>
>>
>>
>> <<create-records>>
>>
>> <$edit-text tiddler=<<newtiddlerdName>> field=text tag=input default="" 
>> placeholder="new title"/>
>>
>> <$button actions="">Create Tiddler
>> <<createMyTiddler>>
>> </$button>
>>
>>
>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b1629e2a-0ea2-4872-946c-2936bbab4af6%40googlegroups.com.

Reply via email to