<<editSections>> in ViewTemplate by default?

70 views
Skip to first unread message

G.J.Robert

unread,
Aug 9, 2012, 8:02:26 PM8/9/12
to tiddl...@googlegroups.com
It seems that <<editSections>> macro of EditSectionPlugin must be added manually to each tiddler. Is there already a way to incorporate it in the ViewTemplate so that every tiddler get the edit buttons for their sections by default? Thanks!

Eric Shulman

unread,
Aug 10, 2012, 1:00:27 PM8/10/12
to TiddlyWiki
You can invoke macros from within the ViewTemplate using this syntax:

<span macro="..."></span>

just put the normal macroname and params within the "...", but leave
off the enclosing angle brackets (i.e., << and >>), like this:

<span macro="editSections edit 'edit this section'"></span>

Note one limitation: because the surrounding template syntax uses the
double-quote (") to enclose the macro syntax, you cannot use double-
quote *within* the macro. Use single-quotes ('...') or doubled-square
brackets ([[...]]) to enclose macro parameters that contain spaces.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
http://www.TiddlyTools.com/#Donations

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
http://www.TiddlyTools.com/#Contact

G.J.Robert

unread,
Aug 15, 2012, 5:16:46 AM8/15/12
to tiddl...@googlegroups.com
Whoa-ho! Your magic works! Thanks Tutor Eric.

I have tried to use something like <div macro='editSections XXX YYY'></div> (or something more buggy) but did not get the desired result, so I thought maybe this macro was an exception to the ViewTemplate syntax. I should have study TW macros more thoroughly...

Cheers
G.J.Robert

Eric Shulman於 2012年8月11日星期六UTC+8上午1時00分27秒寫道:
Eric Shulman於 2012年8月11日星期六UTC+8上午1時00分27秒寫道:
Reply all
Reply to author
Forward
0 new messages