Hello everyone.
I’m trying to adapt a macro I found on a wiki to suit my needs but I can’t get it to work. It is a button that creates a tiddler with some predefined fields.
The button code is:
<$button actions={{$:/xp/ui/Actions/new-people}} tooltip="Create a new people" aria-label="new people" class="tc-btn-invisible tc-btn-mini">
<span class="tc-btn-icon">{{$:/core/images/new-button}}</span> new people
</$button> <small class="tc-sidebar-header">(<i><$count filter='[tag<aggregationTag>!has[draft.of]]'/> tiddlers</i>)</small> <$button to="$:/people-help" tooltip="PEOPLE Help" class="tc-btn-invisible tc-btn-mini">
<span class="tc-btn-icon">{{$:/core/images/help}}</span>
</$button>
</div>
The content of the tiddler $:/xp/ui/Actions/new-people that I replace with mine is as follows:
What I have done so far is change $:/xp/ui/Actions/new-people to $:/model/person-2, I have also tried to remove some parameters from the macro but it hasn’t worked…
Yes, when copying the button code I missed the </div>.
The code that I use and that does not work for me is this:
<$button actions={{$:/model/person-2}} tooltip="Create a new people" aria-label="new people" class="tc-btn-invisible tc-btn-mini">
<span class="tc-btn-icon">{{$:/core/images/new-button}}</span> new people
</$button> <small class="tc-sidebar-header">(<i><$count filter='[tag<aggregationTag>!has[draft.of]]'/> tiddlers</i>)</small> <$button to="$:/people-help" tooltip="PEOPLE Help" class="tc-btn-invisible tc-btn-mini">
<span class="tc-btn-icon">{{$:/core/images/help}}</span>
</$button>
I’ve tried it on another wiki and it doesn’t work for me either. However if I change $:/model/person-2 to $:/xp/ui/Actions/new-people it works and I don’t know why.
Hello Juan,
I think in $:/model/person-2 you merely define two macros, but nowhere call the createNewItem macro. You could just call the $action-sendmessage directly without wrapping it in a macro. Your $:/model/person-2 then would look like this:
or adding a macro call <<createNewItem>> at the end of your version of $:/model/person-2 should also suffice to launch the action.
You could also make the macros global by adding the $:/tags/Macro tag to $:/model/person-2 and change the button actions to actions="<<createNewItem>>".
With what you have told me everything has worked wonderfully. The problem was that I was using a model to generate a new tiddler using the Mehregam mechanism and with this other system it didn’t work for me.
It’s given me quite a few ideas for what I’m doing, but I can’t get to the implementation level used on that page, so I’ll use what I can and understand.
I’m trying to translate the different plugins into English since it has quite a few comments and annotations in Chinese, if I manage to finish the translation I’ll upload it here. There is a link on TiddlyWiki XP where you can download all the plugins the author has created and the ones he uses on his wiki.
Another page that I also liked is — Read the Word,Read the World., although the latter although I can download it to my computer, then I am not able to open it locally…