TiddlerAliasPlugin issue with aliases with spaces

63 views
Skip to first unread message

whatever

unread,
Feb 1, 2011, 9:20:13 AM2/1/11
to TiddlyWiki
Hi!

I've noticed an issue in Udo's TiddlerAliasPlugin (1). Namely, if you
use an alias with space in it, then fET (2) doesn't recognize it
correctly if you use [[...]]. For example:
Tiddler story1 tagged Character
Tiddler story2 tagged [[Person x]]
Tiddler Character with alias [[Person x]] contains the code: <<tiddler
fETTransclusion>>
Tiddler fETTransclusion contains the code:
<<forEachTiddler where
'tiddler.tags.contains(context.viewerTiddler.title) ||
tiddler.tags.contains(context.viewerTiddler.fields.alias)'>>

This doesn't work. However, if instead of [[Person x]] I use Person x
without [[...]] or quotes as alias, it works.

Any insights? Udo?

w


(1) http://tiddlywiki.abego-software.de/Beta.html#TiddlerAliasPlugin
(2) http://tiddlywiki.abego-software.de/#ForEachTiddlerPlugin

whatever

unread,
Feb 1, 2011, 9:26:44 AM2/1/11
to TiddlyWiki
And I noticed another thing. If the plugin is enabled, then the
DefaultTiddlers aren't shown and the Backstage vanishes as well.

w

whatever

unread,
Feb 2, 2011, 3:33:01 AM2/2/11
to TiddlyWiki
After disabling all the plugins and slowly re-enabling them, I found
out that when Udo's TiddlerAliasPlugin and PartTiddlerPlugin are both
enabled, the backstage disappears and the default tiddlers aren't
shown (not even the defailt shadow tiddler GettingStarted). I
confirmed this on the lastest vanilla TW.

w

(1) http://tiddlywiki.abego-software.de/#PartTiddlerPlugin

Tobias Beer

unread,
Feb 2, 2011, 6:57:34 PM2/2/11
to TiddlyWiki
Since the dawn of transclusion you should not be using
PartTiddlerPlugin any longer.

Use (hidden) sections instead and reference them via...

<<tiddler [[Some Tiddler##Some(Hidden)Section]]>>

Cheers, Tobias.

whatever

unread,
Feb 3, 2011, 1:55:10 AM2/3/11
to TiddlyWiki
The good thing about PartTiddlerPlugin is that the part can be visible
or hidden. Plus, how do you hide a section? With /% %/?

I tried this:
<<tiddler ".##Behind the scenes">>
/%!Behind the scenes
TEXT/%

The result was nothing.
Also PartTiddlerPlugin goes along nicely with HideWhenPlugin.

w

Eric Shulman

unread,
Feb 3, 2011, 3:45:48 AM2/3/11
to TiddlyWiki
> The good thing about PartTiddlerPlugin is that the part can be visible
> or hidden. Plus, how do you hide a section? With /% %/?
>
> I tried this:
> <<tiddler ".##Behind the scenes">>
> /%!Behind the scenes
> TEXT/%

You can write:

<<tiddler TiddlerTitle##sectionname>>/%
!sectionname
content
!end
%/

OR

<<tiddler TiddlerTitle##sectionname>>@@display:none;
!sectionname
content
!end
@@

OR

<<tiddler TiddlerTitle##sectionname>>{{hidden{
!sectionname
content
!end
}}}

The first method, using TW comment markers (/% ... %/) prevents the
hidden section content from being displayed or processed except when
transcluded.

The second method uses inline CSS (@@attr:val;...@@) to suppress the
display of the section content, but that section is still processed
when the tiddler is rendered, even if it is not being trancluded which
can result in extra processing overhead or produce unwanted side-
effects, depending upon what macros are in that section content).

The third method is like the inline CSS syntax, but uses a CSS class
wrapper ({{hidden{...}}}).

Note that the first two methods both have a syntax limitation: because
the /%...%/ and @@...@@ sequences are used to surround the hidden
secdtion, you cannot use them *within* the content itself. This limit
doesn't occur when using the third method, because CSS wrapper syntax
*can* be "nested" within itself. Also note that the classname
"hidden" is not defined by default, but can be easily defined by
adding
.hidden { display:none; }
to your StyleSheet tiddler. You can also add this set of convenient
'formatting shortcut' classnames by installing:
http://www.TiddlyTools.com/#StyleSheetShortcuts
and then add:
[[StyleSheetShortcuts]]
to your StyleSheet. This automatically *includes* the additional
class definitions from StyleSheetShortcuts, without having to copy/
paste them directly into your stylesheet.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

-------------------------
Was this answer useful? If so, please help support TiddlyTools:

TiddlyTools direct contributions: (paypal)
http://www.TiddlyTools.com/#Donate
UnaMesa tax-deductible contributions:
http://about.unamesa.org/Participate (paypal)
TiddlyWiki consulting:
http://www.TiddlyTools.com/#ELSDesignStudios
http://www.TiddlyTools.com/#Contact

whatever

unread,
Feb 3, 2011, 5:37:22 AM2/3/11
to TiddlyWiki
Thanks for the explanation, Eric. Anyway, I'm already using your
StyleSheetShortcuts :D.
w

whatever

unread,
Feb 3, 2011, 5:48:31 AM2/3/11
to TiddlyWiki
Interesting thing, however. I tried the third example:
<<tiddler [[here##sectionname]]>>{{hidden{
!sectionname
content
!end
}}}

It displayed the content okay, but since I'm using the
DcTableOfContentsPlugin, both "sectionname" and "end" get listed in
the table of content. If I remove !end, then }}} is shown as part of
the section text.
w

Tobias Beer

unread,
Feb 3, 2011, 6:23:58 PM2/3/11
to TiddlyWiki
That might be a worthy addition to DcTableOfContentsPlugin, the
ability to exclude certain strings from being section titles in a ToC.

Eric Shulman

unread,
Feb 3, 2011, 10:13:27 PM2/3/11
to TiddlyWiki
> Interesting thing, however. I tried the third example:
> <<tiddler [[here##sectionname]]>>{{hidden{
...
> }}}
>
> It displayed the content okay, but since I'm using the
> DcTableOfContentsPlugin, both "sectionname" and "end" get listed in
> the table of content. If I remove !end, then }}} is shown as part of
> the section text.

Try this plugin:
http://www.TiddlyTools.com/#SectionLinksPlugin

<<sectionTOC classname>>
automatically generates an 'outline' style table of contents, based on
the **rendered** sections within a displayed tiddler. To trigger the
macro, you add it to the very *end* of a tiddler, so that it is
processed *after* all the content is rendered. To position the macro
output 'target', you embed a CSS classwrapper, "{{sectionTOC{}}}" in
your tiddler content. You can also embed the macro and classwrapper
'target' directly in the ViewTemplate so that *all* tiddlers will
automatically display a table of contents.

SectionLinksPlugin also extends the TW core handling for section
references in several areas:

* TiddlyLinks to *sections* of tiddlers, using:
[[TiddlerName##section]] or
[[##section]] or
[[here##section]]
Note: The TW core treats these as links to non-existing tiddler titles

* Use HTML 'anchors' as alternative for "!section" to define non-
visible
target for [[TiddlerName##section]] links:
<html><a name="section" /></html>
Note: The TW core doesn't do anything with HTML anchors

* Transclusion from the *current* tiddler, using:
<<tiddler ##section>> or
<<tiddler here##section>>
Note: The TW core *does* transclude sections, but requires the fully-
specified "TiddlerName##section" syntax, or an evaluated parameter to
'manually' construct a reference to a section in the current tiddler,
by using: {{tiddler.title+"##secction"}}

whatever

unread,
Feb 4, 2011, 4:06:25 AM2/4/11
to TiddlyWiki
I'm familiar with SectionLinksPlugin, I was considering using it, but
I chose DcTableOfContentsPlugin because it adds a link to top. Anyway,
I tried SectionLinksPlugin on a random tiddler on your wiki, but with
the same result. I also tried an empty tiddler with the following
code:
<<tiddler ##test1>>
<<tiddler ##test2>>
{{hidden{
!test1
test1text
!end}}}
{{hidden{
!test2
test2text
}}}
<<sectionTOC>>

The result in tiddler:
test1text
test2text
}}}

The result in ToC:
Table of Contents:

1. test1
2. end}}}
3. test2

w

Eric Shulman

unread,
Feb 4, 2011, 7:53:38 AM2/4/11
to TiddlyWiki
> <<tiddler ##test1>>
> <<tiddler ##test2>>
> {{hidden{
> !test1
> test1text
> !end}}}
> {{hidden{
> !test2
> test2text}}}
> <<sectionTOC>>

!end}}}

is *incorrect*. Heading syntax cannot have trailing content following
the heading text. This should work:

<<tiddler ##test1>>
<<tiddler ##test2>>{{hidden{

!test1
test1text
!end

!test2
test2text
!end

}}}<<sectionTOC>>

Note that only *one* CSS class wrapper is needed to surround all the
hidden sections. Also note that the CSS wrapper begins immediately
following the 2nd <<tiddler>> macro (without a prededing newline), and
that the <<sectionTOC>> macro immediately follows the ending of the
CSS wrapper. This ensures that there are no extra newlines displayed
in the content.

enjoy,
-e

whatever

unread,
Feb 4, 2011, 9:36:08 AM2/4/11
to TiddlyWiki
Thaks for the explanation, Eric, I missed the importance of newlines.
Unfortunately, both !end section titles still get displayed in the
ToC, which is what I'm trying to avoid. :)
w

Eric Shulman

unread,
Feb 4, 2011, 11:11:39 AM2/4/11
to TiddlyWiki
> Unfortunately, both !end section titles still get displayed in the
> ToC, which is what I'm trying to avoid. :)
> w

Ah! You should use the /% ... %/ method of hiding the sections. That
will prevent them from actually being rendered, so they won't be
considered part of the table of contents.

<<tiddler ##section>>/%

!section
content
!end

%/

The only limitation of this method is that you can't use comments
*within* the hidden content since the /% ... %/ syntax doesn't nest.

You *can*, however, put text outside the section, but inside the
surrounding comment, like this:

<<tiddler ##section>>/%
This is a comment that is ignored, and can be used to describe the
section that follows...
!section
content
!end
This is also a comment, because it's still inside the comment markers.
%/

enjoy,
-e

whatever

unread,
Feb 4, 2011, 11:22:37 AM2/4/11
to TiddlyWiki
Lol! Thanks, Eric, you rock! :D It does indeed work now.
w
Reply all
Reply to author
Forward
0 new messages