scrollbox - is new feature possible?

80 views
Skip to first unread message

Wim

unread,
Apr 2, 2012, 3:39:44 AM4/2/12
to TiddlyWiki
Hello,

I recently found the scrollbox plugin to display another tiddler
within a given "rectangle".
In the current version, there's a "scroll for more" at the bottom.

Is it possible to change this "scroll for more" to a link of a
tiddler, maybe as a parameter :

<<tiddler scrollbox with: tiddler1 15em [[Click here|tiddler2]]>>

With this example, the content of tiddler1 is displayed in the
scrollbox, but after clicking on "Click here", tiddler2 (=another
tiddler) is opened.

Wim

Tobias Beer

unread,
Apr 2, 2012, 4:25:16 PM4/2/12
to tiddl...@googlegroups.com
Hi Wim,

Please provide a link to the actual plugin source.

Thanks, Tobias.

Wim

unread,
Apr 3, 2012, 2:10:50 AM4/3/12
to TiddlyWiki

Tobias Beer

unread,
Apr 3, 2012, 3:13:02 AM4/3/12
to tiddl...@googlegroups.com
Have a look at the source of the tiddler scroolbox. It's called a "transclusion", not a plugin... because it runs on the fly whenever you change it's code, by calling it via the tiddler macro using parameters, like so....

<<tiddler SomeTransclusion with: Param1 Param2 Param3>>

If you take a look at the source of the tiddler scrollbox, you will find this somewhere...

^^scroll for more^^

Knowing that your first parameter is the tiddler being displayed in the scrollbox, simply replace this with

[[$1]]

If you now look at your scrollbox you will find a link below the scrollbox that links to the tiddler displayed inside of it. If you also want to allow for sections, you will need SectionsLinksPlugin (also form TiddlyTools).

Tobias.

Eric Shulman

unread,
Apr 3, 2012, 7:19:03 AM4/3/12
to TiddlyWiki
> Knowing that your first parameter is the tiddler being displayed in the
> scrollbox, simply replace this with
> [[$1]]
> If you now look at your scrollbox you will find a link below the scrollbox
> that links to the tiddler displayed inside of it.

Your suggestion will work as described. However, the request wasn't
for a link to the tiddler being displayed. Rather, Wim wants to
render a PrettyLink to a *different* tiddler, passed as an
*additional* parameter.

The output from ScrollBox is defined in the ScrollBox##show section,
as follows:

@@display:block;height:$2;overflow:auto;<<tiddler $1
with: [[$3]] [[$4]] [[$5]] [[$6]] [[$7]] [[$8]] [[$9]]
>>@@@@display:block;text-align:right;^^scroll for more^^@@

where
$1 is the tiddler whose content should be displayed,
$2 is the desired height of the scrollbox
$3-$9 are optional transclusion parameters for the tiddler being
displayed

Thus, in order to add another parameter to ScrollBox, Wim needs to re-
purpose [[$3]] so it is used to render a PrettyLink rather than being
passed as a transclusion param, like this:

@@display:block;height:$2;overflow:auto;<<tiddler $1
with: [[$4]] [[$5]] [[$6]] [[$7]] [[$8]] [[$9]]
>>@@@@display:block;text-align:right;^^[[$3]]^^@@

Next, to differentiate the modified ScrollBox from the original,
official distribution version, it MUST BE RENAMED (see TiddlyTools'
Terms of Service). I suggest calling it ScrollBoxWithLink. You would
invoke it using:

<<tiddler ScrollBoxWithLink with: TiddlerName height [[text|
OtherTiddlerName]]>>

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

----
WAS THIS ANSWER HELPFUL? IF SO, PLEASE MAKE A DONATION
http://www.TiddlyTools.com/#Donations
note: donations are directly used to pay for food, rent,
gas, net connection, etc., so please give generously and often!

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

Tobias Beer

unread,
Apr 3, 2012, 8:56:45 AM4/3/12
to tiddl...@googlegroups.com
Hi Wim,

You could also just use:

@@display:block;height:150px;overflow:auto;<<tiddler [[some tiddler]]>>@@

and then be able to...
* place anything inside the scrollbox, not necessarily a tiddler macro call
* place any links you want around it


To be more generic, you could define css classes in your StyleSheet like so:

.scroll150 {
  display:block;height:150px;overflow:auto;
}

and then use:

{{scroll150{<<tiddler [[some tiddler]]>>}}}

From a usability perspective, reusing a grid is better than to be able to define any arbitrary height.


So, you could eventually even do this in your StyleSheet:

/*SLICES
SCROLL:display:block;overflow:auto;height:
*/
.scrollS {[[StyleSheet::SCROLL]]100px;}
.scrollM {[[StyleSheet::SCROLL]]200px;}
.scrollL {[[StyleSheet::SCROLL]]300px;}
.scrollXL {[[StyleSheet::SCROLL]]400px;}

Cheers, Tobias.

Wim

unread,
Apr 5, 2012, 5:33:37 AM4/5/12
to TiddlyWiki
Eric,

thanks for your solution. It works perfectly but it took me a while
to figure out that I had to change EVERY "ScrollBox" tot
"ScrollBoxWithLink" (and not only the tiddlertitle...)

Wim
Reply all
Reply to author
Forward
0 new messages