stack maketid

93 views
Skip to first unread message

andrew levy

unread,
Feb 26, 2016, 9:26:40 AM2/26/16
to TiddlyWiki
I am trying to make 2 new tiddlers with this add button but I am only getting 1. Can someone advise where I am going wrong?

thanks

andrew


\define newPublication_button2(publication_title,publication_authors,publication_journal,publication_volume,publication_year,publication_doi,publication_url,publication_abstract,edit:"show",tags,label,class,color)

<$setfield set="!!publication_title" setTo="$publication_title$">
<$setfield set="$:/temp/publication!!publication_title" setTo="">

<$setfield set="!!publication_authors" setTo="$publication_authors$">
<$setfield set="$:/temp/publication!!publication_authors" setTo="">

<$setfield set="!!publication_journal" setTo="$publication_journal$">
<$setfield set="$:/temp/publication!!publication_journal" setTo="">

<$setfield set="!!publication_volume" setTo="$publication_volume$">
<$setfield set="$:/temp/publication!!publication_volume" setTo="">

<$setfield set="!!publication_year" setTo="$publication_year$">
<$setfield set="$:/temp/publication!!publication_year" setTo="">

<$setfield set="!!publication_doi" setTo="$publication_doi$">
<$setfield set="$:/temp/publication!!publication_doi" setTo="">

<$setfield set="!!publication_url" setTo="$publication_url$">
<$setfield set="$:/temp/publication!!publication_url" setTo="">

<$setfield set="!!publication_abstract" setTo="$publication_abstract$">
<$setfield set="$:/temp/publication!!publication_abstract" setTo="">

   
<$maketid  title="$publication_title$" tags="$:/_type/publication $tags$" edit="$edit$" message="tw-set-field">
</$maketid>

   <$maketid title="$publication_authors$" tags="$:/
_type/author $tags$" edit="$edit$" message="tw-set-field">        
<$button message="
tw-new-tiddler" class="$class$"> $label$</$button>
    </$maketid>

</$setfield>
</$setfield>
</$setfield>
</$setfield>
</$setfield>
</$setfield>
</$setfield>
</$setfield>
</$setfield>
</$setfield>
</$setfield>
</$setfield>
</$setfield>
</$setfield>
</$setfield>
</$setfield>
\end

\define newPublication_button(label:add "
class:"",color:"#ff8389")
<$macrocall $name="newPublication_button2"
publication_title
={{$:/temp/publication!!publication_title}}
publication_authors
={{$:/temp/publication!!publication_authors}}
publication_journal
={{$:/temp/publication!!publication_journal}}
publication_volume
={{$:/temp/publication!!publication_volume}}
publication_year
={{$:/temp/publication!!publication_year}}
publication_doi
={{$:/temp/publication!!publication_doi}}
publication_url
={{$:/temp/publication!!publication_url}}
publication_abstract
={{$:/temp/publication!!publication_abstract}}
edit
={{$:/temp/publication!!edit}}
tags
={{$:/temp/publication!!tags}}
label
="$label$"
class="$class$"
color
="$color$"/>
\end

<<newPublication_button>>




 

BJ

unread,
Feb 26, 2016, 11:10:38 AM2/26/16
to TiddlyWiki
messages travel down the widget tree, so you need to rap both maketids around the button:

    <$maketid  title="$publication_title$" tags="$:/_type/publication $tags$" edit="$edit$" message="tw-set-field">
   <$maketid title="$publication_authors$" tags="$:/_type/author $tags$" edit="$edit$" message="tw-set-field">        
<$button message="
tw-new-tiddler" class="$class$"> $label$</$button>
    </$maketid>
</$maketid>

Give this a try. I have not used the maketid widget - it may consume the widgit message, on which case this wont work.

all the best

BJ

Matabele

unread,
Mar 6, 2016, 7:06:47 AM3/6/16
to TiddlyWiki
Hi Andrew

OK -- back on a decent internet connection.

I posted a new version of the $action-maketid widget here. This version may be used in conjunction with the maketid[] filter to create a number of new tiddlers with various options for the titles.

regards
Reply all
Reply to author
Forward
0 new messages