Doubled tiddler display?

19 views
Skip to first unread message

wolfgang

unread,
Jun 26, 2009, 6:29:41 AM6/26/09
to TiddlyWiki
Hi everyone,

with inventions of Fred and Ocat I tried to create a dynamically
widening MainMenu with various menus:

http://menuflex.tiddlyspot.com/

The complexity and incompatibility with IE made me think, that the
same could be much easier possible with a doubled tiddlerDisplay:

http://double.tiddlyspot.com/
(find switch for sidebars in the SiteSubtitle)

Now what I would have to do, to open a tiddler in the new left
tiddlerDisplay area?

regards..

FND

unread,
Jun 26, 2009, 6:55:11 AM6/26/09
to Tiddl...@googlegroups.com
> the same could be much easier possible with a doubled tiddlerDisplay
> [...]

> Now what I would have to do, to open a tiddler in the new left
> tiddlerDisplay area?

So you basically want two independent stories*?
That's currently not supported. There has been talk of this in the past,
but AFAICT nobody has made an effort to implement a prototype so far.


-- F.


* http://tiddlywiki.org/wiki/Story

wolfgang

unread,
Jun 26, 2009, 5:40:25 PM6/26/09
to TiddlyWiki
> So you basically want two independent stories*?
> That's currently not supported. ..
>


Though this would be one route to go - opening many other
possibilities - really only few features of a tiddler story would be
needed. Basically merely to display only one tiddler - without toolbar
or tagging abilities - but a basic way to display a number of defined
tiddlers inside this tiddler from links.

(Just as MenuFlex does from the top menu, but without the
disadvantages of having to write complex definitions in PageTemplate,
StyleSheet, Menu tiddler and thereby including defined menu tiddlers
all at once - while hiding all but one - and the possible performance
lag which comes with this. As well as avoiding the overflow style
inability of IE.)
.

The simplest html script visualizing this with ease, I could come up
with, is this modification of Eric's MultiSelectSampleScript with the
preview ability of FaqViewer script added. See it in action in the
MainMenu area by clicking 'more' > 'Browse', at the left side of the
top menu:

http://menuflex.tiddlyspot.com/#Viewer

If there would be a way to do this without the MultiSelect list box
(or a one line dropdown) - but with links placed outside this tiddler
- that would already perfectly fit the bill!

FND

unread,
Jun 29, 2009, 5:24:53 AM6/29/09
to Tiddl...@googlegroups.com
> display only one tiddler - without toolbar
> or tagging abilities - but a basic way to display a number of defined
> tiddlers inside this tiddler from links

You might use transclusion* for this, updating the transcluded tiddler
with the desired contents (make sure the container has the
refresh="content" attribute, like for example the main menu).


-- F.


* http://tiddlywiki.org/wiki/Transclusion

wolfgang

unread,
Jun 29, 2009, 6:40:28 AM6/29/09
to TiddlyWiki
> http://menuflex.tiddlyspot.com/#Viewer
>
> If there would be a way to do this without the MultiSelect list box
> (or a one line dropdown) - but with links placed outside this tiddler
> - that would already perfectly fit the bill!

>
> You might use transclusion* for this, updating the transcluded tiddler
> with the desired contents (make sure the container has the
> refresh="content" attribute, like for example the main menu).
>
> -- F.
>
> *http://tiddlywiki.org/wiki/Transclusion

But how one can transclude a number of tiddlers in one tiddler - while
only displaying one particular - simultaneously removing the others by
clicking a link??
- Without using the display:none/:block attribute, which only hides
but still updates transcluded tiddlers (if they refer to tiddlers/
tags, during edit actions)?

I could imagine it possible by separating above [[Viewer]] html script
in two sections in the displayed tiddler, and transcluding the listbox
section to the outside place to switch it. Beside still not being a
simple tiddlyLink, this would come closest. However, with all my
experimenting with it, I haven't got it there.

Any suggestions?

FND

unread,
Jun 29, 2009, 2:21:36 PM6/29/09
to Tiddl...@googlegroups.com
> But how one can transclude a number of tiddlers in one tiddler - while
> only displaying one particular - simultaneously removing the others by
> clicking a link??

You probably won't get around writing some custom JavaScript code for
this, programmatically modifying either the contents of the transcluded
tiddler - or simply the source parameter for the transclusion.

Let's assume your MainMenu contains the following string:
{{PseudoStory{<<tiddler [[Foo]]>>}}}

Then you could use the following code to change the displayed tiddler
from Foo to Bar:
---------------
var updatePseudoStory = function(container, source) {
var t = store.getTiddler(container);
// change transclusion source
var pattern = /({{PseudoStory{<<tiddler \[\[)(.+?)(]]>>}}})/;
var text = t.text.replace(pattern, "$1" + source + "$3");

store.saveTiddler(t.title, t.title, text, t.modifier, t.modified,
t.tags, t.fields, false, t.created);
};

updatePseudoStory("MainMenu", "Bar");
---------------

This might be simplified by reading the transclusion source from a
dedicated tiddler (or even just a variable) and applying that value
using evaluated parameters on the tiddler macro call. The respective
control would then refresh the containing the macro call.


-- F.

wolfgang

unread,
Jun 29, 2009, 9:11:50 PM6/29/09
to TiddlyWiki
You made my day Fred!

This seems a very well working alternative, as far as I can tell till
now:

http://double.tiddlyspot.com/

> You probably won't get around writing some custom JavaScript code for
> this, programmatically modifying either the contents of the transcluded
> tiddler - or simply the source parameter for the transclusion.
>

Indeed, this problem for the first time made me read some js articles.
However, it's daunting, as this would take me months for coming up
with something usable myself.

> This might be simplified by reading the transclusion source from a
> dedicated tiddler (or even just a variable) and applying that value
> using evaluated parameters on the tiddler macro call. The respective
> control would then refresh the containing the macro call.
>

Had to read this sentence trice to understand half of what you meant -
did I got it right?

http://double.tiddlyspot.com/#SiteSubtitle%20flex

You already used $1 and $3 within the script, so for the tiddler name
and title to transclude only $2 and $4 are left - this isn't
changeable and made me use the following for the switching link (using
"" for the reserved placeholders wouldn't work):
<<tiddler flex with: "$1" MainMenu "$3" "show menu">>

Or is there still a simpler way? (anyway, this is really a minor
disfigurement, compared to the complexity of MenuMore's method it
avoids)


Now, only Opera chokes and gives the following error message (by which
you may get an idea of what's wrong):
___________________________________

<double.tiddlyspot.com>

[Error:
name: SyntaxError
message: Statement on line 67: Syntax error in call to eval: line 5 :
var pattern = /({{PseudoStory{<<tiddler \[\[)(.+?)(]]>>}}})
----------------^
Backtrace:
Line 67 of eval script
alert(e.description || e.toString());
return false;
At unknown location
[statement source code not available]

]
___________________________________


So much thanks again!

FND

unread,
Jul 5, 2009, 6:23:56 AM7/5/09
to Tiddl...@googlegroups.com
> This seems a very well working alternative [...]
> http://double.tiddlyspot.com/

Hah, I didn't expect to see the Cookie Monster there - that actually
made me smile.

> Indeed, this problem for the first time made me read some js articles.
> However, it's daunting, as this would take me months for coming up
> with something usable myself.

I hope the sample code I provided helped getting you a sense of how to
get started.

>> This might be simplified by reading the transclusion source from a
>> dedicated tiddler (or even just a variable) and applying that value
>> using evaluated parameters on the tiddler macro call. The respective
>> control would then refresh the containing the macro call.
>
> Had to read this sentence trice to understand half of what you meant -
> did I got it right?
> http://double.tiddlyspot.com/#SiteSubtitle%20flex

I'm not sure but it doesn't seem like what I had in mind (also see
below).

> You already used $1 and $3 within the script, so for the tiddler name
> and title to transclude only $2 and $4 are left

Well, this doesn't actually have anything to do with Tiddlywiki
transclusion; those are backreferences* from the RegEx search & replace.

> Now, only Opera chokes and gives the following error message

> [...]


> Statement on line 67: Syntax error in call to eval: line 5 :
> var pattern = /({{PseudoStory{<<tiddler \[\[)(.+?)(]]>>}}})

Looks like that might be a copy & paste error - or perhaps some weird
interaction due to the misunderstanding above?

> So much thanks again!

Your sample made me remember, wasn't there a navigation menu doing
something very similar, using tabs? It might have been Morris's work.


-- F.


* http://www.regular-expressions.info/javascript.html

wolfgang

unread,
Jul 6, 2009, 5:12:28 PM7/6/09
to TiddlyWiki
> > Indeed, this problem for the first time made me read some js articles.
> > However, it's daunting, as this would take me months for coming up
> > with something usable myself.
>
> I hope the sample code I provided helped getting you a sense of how to
> get started.
>

It didn't change the sense I've got before, that I would have to spend
a few months exclusively learning javascript till I would be able
write anything humble myself. This would defeat the beauty of
TiddlyWiki to me, of learning a little specific html and css as one
goes along to adapt TW to ones need. I don't want to write plugins for
TW - but adapt, __use__ and share - if I consider anything worthy.
Developing javascript plugins is a completely different approach,
which I don't have the ambition, nor would want to earn my daily bread
for. Everyone has to make priorities.

> >> This might be simplified by reading the transclusion source from a
> >> dedicated tiddler (or even just a variable) and applying that value
> >> using evaluated parameters on the tiddler macro call. The respective
> >> control would then refresh the containing the macro call.
>
> > Had to read this sentence trice to understand half of what you meant -
> > did I got it right?
> >
> > http://double.tiddlyspot.com/#SiteSubtitle
>
> I'm not sure but it doesn't seem like what I had in mind (also see
> below).
>

Well - as a user - neither did I know what to do now, with what I read
below. Other than to study javascript to be able to write plugins
myself. But where would it come to, if every user would be converted
to a developer? I think each role has its place, and where developers
might really be at an advantage to share, there are other areas with
real importance. Priorities again.

> Well, this doesn't actually have anything to do with Tiddlywiki
> transclusion; those are backreferences* from the RegEx search & replace.
>
> > Now, only Opera chokes and gives the following error message ...
>
> Looks like that might be a copy & paste error - or perhaps some weird
> interaction due to the misunderstanding above?
>

From a (Firefox) TW users standpoint - it now works even better this
way than MenuMore, and I'm sufficiency satisfied :-)

> Your sample made me remember, wasn't there a navigation menu doing
> something very similar, using tabs? It might have been Morris's work.
>

Well, the original - and in my eyes most beautiful - would be this:

http://yann.perrin.googlepages.com/twkd.html

but would introduce its own specific limitations.

Regards..

FND

unread,
Jul 7, 2009, 3:00:45 AM7/7/09
to Tiddl...@googlegroups.com
> I would have to spend a few months exclusively learning javascript [...]
> This would defeat the beauty of TiddlyWiki [...]

> where would it come to, if every user would be converted to a developer

I understand that. However, you have very specific demands there, and -
well, if you absolutely need a particular shape, but no such Lego brick
exists yet, someone's gonna have to mold it first.


-- F.

wolfgang

unread,
Jul 8, 2009, 5:05:30 AM7/8/09
to TiddlyWiki
On the other side I understand your perspective. It would be really
nice if there would be more regular developers here at Google Groups.

> well, if you absolutely need a particular shape, but no such Lego brick
> exists yet, someone's gonna have to mold it first.

I see this process of asking and receiving a little bid differently.
For me it doesn't matter on which level a question is asked, be it to
find a particular function, changing templates or writing javascript -
those who know an answer will put forward a particular amount of
effort given to the questioner freely. For example, I'm always amazed
when it takes me much effort to answer a question only partially and
find that, just for example Eric, has already answered the same answer
more than what was asked for in half of the time - maybe with some
never before seen scripts - really ready for print in a TW manual!
Nevertheless, a major determining factor of how much was given remains
the effort on the givers site. The giver can't really control how much
is received.

And if one puts forward effort to give, it becomes much more likely to
be given in return. Nothing mystical about that :-) However, if this
strategy failed one time to get answers, in the overall strategy to
increase happiness it never will.

Of course, care has to be taken that no one ever gets a pure giver and
wouldn't know how to ask something for himself. I consider burnout in
such a case a serious threat. So it's also good not to give sometimes.

Best wishes..
Reply all
Reply to author
Forward
0 new messages