> if I use the tiddler macro for transclusion of a non existing tiddler,
> like:
> <<tiddler nonExistingTiddler>>
> nothing is visualized.
>
> I would like to have some kind of highlight or error message or
> placeholder:
> this could be useful to detect mispelling errors, and also as a memo
> for
> contents not included yet.

One way to achieve this is the override the transclusion method so
that instead of displaying nothing it displays a msg of your choice.
I have written a short plugin that achieves this.

(function(){

        var macro = config.macros.tiddler;

        var _transclude = macro.transclude;
        macro.transclude = function(wrapper, tiddlerName, args){
                // check to see if empty
                var text = store.getTiddlerText(tiddlerName);
                if(!text){
                        config.macros.tiddler.renderText(wrapper,tiddlerName+" 
does not
exist",tiddlerName,params);
                } else {
                        // call original
                        _transclude(wrapper, tiddlerName, args);
                }

        };
})();

You can change 'tiddlerName+" does not exist"' to any msg you want to
display.

Hope that is what you were looking for...

Colm

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to