Which window am I in?

65 views
Skip to first unread message

Mat

unread,
Jul 20, 2020, 10:17:20 AM7/20/20
to TiddlyWiki
I split out a tiddler into a new window. I want style its contents depending on if it is split out or not. Is there a direct way to tell?

I was thinking of the InfoMechanism but it doesn't seem to do anything with the windows, it's mainly url stuff and a little more.

Specifically, I'm styling something in it to be position:fixed and width:100% but while this works as desired in the window content, since a split out tiddler remains in the tiddler river, it messes up things there.

<:-)


Eric Shulman

unread,
Jul 20, 2020, 10:46:40 AM7/20/20
to TiddlyWiki
On Monday, July 20, 2020 at 7:17:20 AM UTC-7, Mat wrote:
I split out a tiddler into a new window. I want style its contents depending on if it is split out or not. Is there a direct way to tell?

In the tm-open-window message, you can provide a parameter such as inWindow="true".
This parameter will be passed along to the window as a variable.

Then, in your stylesheet, you can write:
<$list filter="[<inWindow>match[true]]">
   ... window specific styles go here ...
</$list>

-e

Mat

unread,
Jul 20, 2020, 2:57:02 PM7/20/20
to TiddlyWiki
@Eric - excellent! Thank you!

<:-)
Reply all
Reply to author
Forward
0 new messages