Automatically Updating Transcluding Tiddler when using Wikify Plugin and EditSectionPlugin?

70 views
Skip to first unread message

Stephan Hradek

unread,
Apr 12, 2013, 10:47:14 AM4/12/13
to tiddl...@googlegroups.com
I have 2 tiddlers:

Tiddler: transcluded
--------------------------
Me is transcluded!
{{hidden{
!Section
test
!end
}}}
--------------------------


Tiddler: transcluding
--------------------------
me is transcluding this:
<<<
<<tiddler [[transcluded]]>>
<<<
<<editSection "transcluded##Section">>
<<wikify "%0"  {{
    var t=store.getTiddlerText( "transcluded##Section");
    t == null ? '' : "{{{\n"+t+"\n}\}\}";
}}>>
--------------------------

The idea behind this:
The "transcluded" tiddler usually is not shown, just the "transcluding" one. This one contains many transcluded tiddlers. This is just one example.

The "Edit Section" allows the user to enter some data which should then be displayed as a code-blocke so not to be wikified in any way.

But when I edit the section, the changes are not displayed in the wikified part. Is there any way i can make that part update too?

Stephan Hradek

unread,
Apr 12, 2013, 12:31:29 PM4/12/13
to tiddl...@googlegroups.com
I'm not sure, but I THINK I found and fixed a bug.

I imported the CoreTweaks and changed in the tweak to ticket 1147

This line:
        if(force != null || changeList == null || changeList.indexOf(title) != -1) {

to this line
        if(force != null || changeList == null || changeList.indexOf(title.replace(/##.*/,'')) != -1) {

This will remove the "##Section" part from the tiddler name and thus make a transcluded section refresh. This, of course, only works for sections transcluded using <<tiddler>> not those transcluded <<wikify>>

PMario

unread,
Apr 13, 2013, 9:18:39 AM4/13/13
to tiddl...@googlegroups.com
the <<tiddler>> macro has a refresh handling, that is triggered by the core if any tiddler is saved. Your code need to trigger the refresh, since wikify doesn't do it.

you can try to add "story.refreshAllTiddlers(force)". Where force can be true or false. Or "refreshAll()", if the first one doesn't work.

hope this helps.
-mario

   
Reply all
Reply to author
Forward
0 new messages