Show items added in the list field of the current tiddler

186 views
Skip to first unread message

Jake

unread,
May 27, 2020, 8:57:23 AM5/27/20
to TiddlyWiki
Hi, I'm new with Tiddlywiki and I have a question to ask. I think it should be rather simple, but I've read quite a bit about Lists and Filter Operators and couldn't figure that out. 
(Btw, a little advise to those who write those database: it could really use some examples how the FINAL CODE should look like, not only the description and some... schemes?). 

So, the question is: How to add the list of all the items added in the "list" field of a current tiddler at the bottom of that tiddler in a horizontal line?

I know that many use "tags" for that kind of reasons, but I heard that lots of tagging could slow down tw, so how to do that just using the list field?

Mat

unread,
May 27, 2020, 10:48:35 AM5/27/20
to TiddlyWiki
First, you don't have to worry about tags slowing down TW. It is in extreme cases and, really, anything in extremes would probably slow down any system. TW is designe for using tags and if you don't... it's like pizza without any cheeze. (Is that even pizza?)

Regardless, you question probably doesn't have anything to do with tags.

Do you want the list field content to show at the bottom of just a few specific ones or do you want it for every tiddler, or perhaps for every tiddler tagged xxx?

<:-)


Jake

unread,
May 27, 2020, 11:08:23 AM5/27/20
to TiddlyWiki
I want the list content to show at the bottom of the specific tiddlers. Well, I can always write them down as an ordinary text like: "see also: [[blabla]], [[blablabla]]", but as I understand they won't update if I change the name of the tiddler. And the items in the "lists" as I understood are updated automatically if I rename a tiddler. So I just want that bottom text to be auto updated, because if I have 50-100 tiddlers with ordinary text at the bottom [[blablabla]] and then I need to rename that tiddler to [[notblablabla]] I don't want to manually edit those 50-100 tiddlers... :)

Mat

unread,
May 27, 2020, 11:18:20 AM5/27/20
to TiddlyWiki
Jake wrote:
I want the list content to show at the bottom of the specific tiddlers.

OK, you can put this at the bottom of the text field

{{{ [enlist{!!list}] }}}

You're right that if you change the titles of those tiddler, then this will be updated. You might also be interested in Flibbles Relink plugin.

<:-)

Jake

unread,
May 27, 2020, 12:10:14 PM5/27/20
to TiddlyWiki


среда, 27 мая 2020 г., 18:18:20 UTC+3 пользователь Mat написал:

OK, you can put this at the bottom of the text field

{{{ [enlist{!!list}] }}}

You're right that if you change the titles of those tiddler, then this will be updated. You might also be interested in Flibbles Relink plugin.

<:-)

Yay!! Thanks!... I knew this should be easy, and they even update properly after renaming ( ͡° ͜ʖ ͡°) , "BUT"... but they are displayed just one after another without any spaces, like: Tiddle01Tiddle02Tiddle03. How can I add some space between them? And also is there a way to add some formatting to the results? Because if I put it inside a <p> or <div> tag the list becomes "vertical".

Jake

unread,
May 27, 2020, 12:37:47 PM5/27/20
to TiddlyWiki
среда, 27 мая 2020 г., 18:18:20 UTC+3 пользователь Mat написал:
You might also be interested in Flibbles Relink plugin.

<:-)


wow-wow-wow... what sorcery is this??? ༼ つ ◕_◕ ༽つ i tried this Flibbles Relink plugin - and looks like it worked! I also thought it would be difficult to install (haven't installed plugins to tw yet), but it's easy even for stupish idiots like meself... 。◕‿◕。

Mat

unread,
May 27, 2020, 12:45:54 PM5/27/20
to TiddlyWiki
You can do this. 
Create a macro tiddler with this content:

tags: $:/tags/Macro
text
:
\define commalist()
<div class="commalist">
{{{ [enlist{!!list}] }}}
</div>
\end

...and then add the following styledef to an existing stylesheet or creeate a separate stylesheet like this:

tags: $:/tags/Stylesheet
type
: text/css
text
: .commalist span:not(:last-child):after {content:", ";}

Then whenever you want to use this, you just type <<commalist>> in your tiddler.

<:-)

Jake

unread,
May 27, 2020, 1:41:35 PM5/27/20
to TiddlyWiki


oooookey... now I'll try to process this one... it may take several days... :))  i liked "{{{ [enlist{!!list}] }}}" more. But anyway - thanks a lot! You were very helpfull!

Mat

unread,
May 27, 2020, 2:08:01 PM5/27/20
to TiddlyWiki
Haha, OK, since you were so comfortable with the {{{ [enlist{!!list}] }}} thing, I assumed you had some more experience (all the braces would have freaked me out if I were totally new, for sure). Sorry. You can do it like the following instead which is pure WikiText without involving the styling:

tag: $:/tags/Macro
text
: \define mylinks() <$list filter="[enlist{!!list}]"><$link/> </$list>

I.e make a new tiddler, title it whatever you want and tag it as stated and at the very top in its text field you put the "\define" line

Then in whichever tiddlers you want the list, you add  <<mylinks>> and it shows that the current tiddlers list field contents, space separated.

A "macro" is a text that you can reuse in this way, in this case it is some code.

<:-)

Jake

unread,
May 28, 2020, 9:41:12 AM5/28/20
to TiddlyWiki
Yeah! This one worked perfectly! And it's a lot easier to implement and understand (still fighting with the first one though :))  And as I understood - you can put whatever you like before last </$list>, not only space, but ", " or " | " or whatever and it works like separator between tweedlers like "Twiddler01 | Twiddler02 | Tweddler03..."

But also I have a little question, not related to the previous one. TwiddlyWiki doesn't like links to local folders in Cyrillic or should I just need one more plugin for that? Because when I tried [[My Awesome Folder|file:///d:\folder\]] it worked fine, but when I tried [[My Awesome Folder|file:///d:\моясукапапка\]] nothing worked. I even tried via html tags: still <a href="file:///d:\folder\">My Awesome Folder</a> worked fine, but with Cyrillic letters in local folder name - nothing worked...

среда, 27 мая 2020 г., 21:08:01 UTC+3 пользователь Mat написал:

Flibbles

unread,
May 28, 2020, 10:13:39 AM5/28/20
to TiddlyWiki
[enlist{!!list}] does work.

...also

[list[]]

Surprised nobody mentioned that.

For your linking to a file, make sure you can open "file:///d:\моясукапапка\" directly in your browser, such as by dragging that file onto a new tab. The link supplied from that is the href you should be using for the link. But If you're still having trouble, maybe you have to encode the uri.

<a href={{{ [[file:///d:\моясукапапка\]encodeuri[]] }}} />Link</a>

Though honestly, I'm not sure that's the answer. If you can open it directly in the browser, you should be able to open it in Tiddlywiki just fine.

Jake

unread,
May 28, 2020, 11:03:33 AM5/28/20
to tiddl...@googlegroups.com
Yeah, I can open file:///d:\моясукапапка\ in my browser (Chrome) just fine. I just print "file:///d:\моясукапапка\" in url field - and here it is, all the content of the folder. So the issue is not with a browser or a wrong spelling, but the TiddlyWiki engine I assume.

The problem is that if I copy the link from the Chrome browser "file:///d:\моясукапапка\" translates into smth like this: "file:///D:/%D0%BC%D0%BE%D1%8F%D1%81%D1%83%D0%BA%D0%B0%D0%BF%D0%B0%D0%BF%D0%BA%D0%B0/" and if I try to use the latter as a local folder link - that doesn't work either.

[enlist{!!list}] or [list[]] should be put... where?.. :)  coz if I leave it like that - that's just text.


Flibbles написал:

Flibbles

unread,
May 28, 2020, 11:17:04 AM5/28/20
to TiddlyWiki
[list[]] works replacing [enlist{!!list}] in everyone else's examples. So the easiest way to print the list of the current tiddler is:

{{{ [list[]] }}}

As for your unicode directory name, I don't know what to tell you. I can't replicate the issue. Every single combination of escaped, unescaped, encoded, and decoded that I use on my windows machine all work using the directory name you passed me. The only time I could get it not to work was when I was trying to follow a link made in a tiddler that wasn't local to my own machine.

Jake

unread,
May 28, 2020, 2:56:35 PM5/28/20
to TiddlyWiki
Yeah, looks like replacing [enlist{!!list}] with [list[]] works just fine. Another little question: what if I want to add a <br> and start of a new paragraph for the bottom links? What should I add here:
"\define mylinks() links: <$list filter="[list[]]"><$link/>, </$list>" for macro? (As I noticed if I type "something" before the list tag it just appears before that list, no magic voodoo brackets required)

As for links to local folders in Cyrillic: tried everything that I could google, doesn't work. Seems like I'll have to rename them on my pc into latin via transliteration. Won't be a very big problem with most of personal data folders (still inconvenient though), but might be troublesome for program folders.


четверг, 28 мая 2020 г., 18:17:04 UTC+3 пользователь Flibbles написал:

Flibbles

unread,
May 28, 2020, 3:16:50 PM5/28/20
to TiddlyWiki
Not quite sure what you mean. You want the last item in the list to be displayed separately? So...

\define mylinks()
links: <$list filter="[list[]butlast[]]"><$link/>, </$list>

<$list filter="[list[]last[]]">and <$link/></$list>
\end


What kind of output are you trying to get?

Jake

unread,
May 28, 2020, 3:31:48 PM5/28/20
to TiddlyWiki
No-no-no... much more simple than that...

I just want it to be like:

"Main text of the tiddler... blah-blah-blah...


<blank row>
new paragraph:

links: (here goes my links)"


for the last part I have:
"\define mylinks() links: <$list filter="[list[]]"><$link/>, </$list>"
Now I just need to include in macro blank row before them and start them from a new paragraph.



четверг, 28 мая 2020 г., 22:16:50 UTC+3 пользователь Flibbles написал:

Flibbles

unread,
May 28, 2020, 3:42:33 PM5/28/20
to TiddlyWiki
Like... this...?

\define mylinks()
links: <$list filter="[list[]]"><$link/>, </$list>
\end

This is my content

<<mylinks>>

Just including a space between the macro and your body would start a new paragraph. Or are you saying you want that macro to automatically render at the bottom of every tiddler or something?

Jake

unread,
May 28, 2020, 3:54:34 PM5/28/20
to TiddlyWiki
Yeah, the paragraph part works fine. Now I just need a blank row, like <br>, before it.

четверг, 28 мая 2020 г., 22:42:33 UTC+3 пользователь Flibbles написал:

Flibbles

unread,
May 28, 2020, 4:08:06 PM5/28/20
to tiddl...@googlegroups.com
Oh. So this?:

links:<br><$list filter="[list[]]"><$link/>, </$list>

Flibbles

unread,
May 28, 2020, 4:10:20 PM5/28/20
to TiddlyWiki
Or this?

\define mylinks()
<br>
links:<$list filter="[list[]]"><$link/>, </$list>
\end

Jake

unread,
May 28, 2020, 4:14:50 PM5/28/20
to TiddlyWiki
Yeah, of course I tried this one. It definitely adds a blank row, but it doesn't want to consider the "links:..." part as a new paragraph. I have paragraphs with "text-indent: 1em", but this way macro considers links part as a simple text, with no indent like other paragraphs do.

четверг, 28 мая 2020 г., 23:10:20 UTC+3 пользователь Flibbles написал:

Flibbles

unread,
May 28, 2020, 4:21:03 PM5/28/20
to TiddlyWiki
Like <p>link: ...</p>??? I don't get what you're asking for. If you have your macro separated the way you say you do, then it should already be wrapped in <p> elements. Maybe if you show me what you have?

Flibbles

unread,
May 28, 2020, 4:27:36 PM5/28/20
to TiddlyWiki

newline needed.png


Jake

unread,
May 28, 2020, 4:32:45 PM5/28/20
to TiddlyWiki
Yep, that's it! That's all I need ("for now" (◑‿◐)). I thought it should implement 'p' by itself somehow. :))

\define mylinks()
<br> 
<p>
links: <$list filter="[list[]]"><$link/>, </$list>
</p>
\end


PS. On the image you posted - I think there's no "blank row". I think that's just "margin" between the paragraphs. And since I made that margin 0 by default (like it better this way) - I can see the existence/nonexistence of <br> more clearly. :)

четверг, 28 мая 2020 г., 23:21:03 UTC+3 пользователь Flibbles написал:

Flibbles

unread,
May 28, 2020, 4:36:36 PM5/28/20
to TiddlyWiki
O... okay. But it already should have been...
I guess I'm glad you've got something working for you though. Good luck!

TonyM

unread,
May 28, 2020, 8:00:05 PM5/28/20
to TiddlyWiki
Quick tip,

On any tidler the Info Button opens a set of tabs, one of these is tagging which is effectively the list field.

It can be nice to make the visible on the tiddler, but it is worth remembering this info is always a couple of clicks away

Regards
Tony

Jake

unread,
May 29, 2020, 2:00:17 AM5/29/20
to tiddl...@googlegroups.com
Yeah, I knew about that part before asking the question and have the info button enabled for all the twiddlers, but that is not that effective for me. One time two more clicks is not a problem, but make it a hundred... Plus it's "vertical", i like it horizontally. But thanks.

пятница, 29 мая 2020 г., 3:00:05 UTC+3 пользователь TonyM написал:

TonyM

unread,
May 29, 2020, 5:36:47 AM5/29/20
to TiddlyWiki
Jake,

Understood, Just letting you know in case.

Given list fields are really one side of tags, perhaps you would like these tag pill extensions.

You can make a tag pill anywhere with 
<<tag tagname>>

In Tag Pills you can drag and drop the order
And with the attached tiddlers it add to the tagpil drop down
  • copy tag (To Clip Board)
  • Open all
  • close all (including current if so tagged)
Regards
Tony
tag-dropdown.json

Jake

unread,
May 30, 2020, 11:11:15 AM5/30/20
to TiddlyWiki
One more little question. What's the proper way to include internal styles without classes, only for a certain element? I read this thing: http://tobibeer.github.io/tb5/#Markup  but still couldn't make it. 

For example, if I have this class defined in my stylesheet

.icon {height: 1.2em;  
position: relative;
top: 0.2em;}

and then use like


everything works fine. 

But if I want to use it without class (e.g. if i need to move certain icon a bit more up or down) and use the common html/css syntax - it doesn't work.

That means that this 'style' code does nothing to the image:

[img style="height: 1em; position: relative; top=0.2em" [https://www.mediawiki.org/static/favicon/mediawiki.ico]] Sample 2

I tried using @@, in different places and combinations as well but it didn't seem to work either. 

I tried using direct html code 
<img src="https://www.mediawiki.org/static/favicon/mediawiki.ico" style="height: 1em; position: relative; top=0.2em"> Sample 3

height property worked, but positioning did not.

So the very simple question is what is TW equivalent for <img style="...">. And is it written somewhere? And if it is - maybe change it to be a bit more clearer for a newbie to understand? Coz currently it is definitely not. :)

PMario

unread,
May 30, 2020, 12:17:58 PM5/30/20
to TiddlyWiki
On Saturday, May 30, 2020 at 5:11:15 PM UTC+2, Jake wrote:
 
But if I want to use it without class (e.g. if i need to move certain icon a bit more up or down) and use the common html/css syntax - it doesn't work.

It does, if you define the minor changes within the tiddler body. ... BUT this is bad practice and will probably bite you in the future.
 
That means that this 'style' code does nothing to the image:

[img style="height: 1em; position: relative; top=0.2em" [https://www.mediawiki.org/static/favicon/mediawiki.ico]] Sample 2

As I wrote, hardcoding styles may bite you in the future! But if you need to: this is the code to use, if you want to overwrite the global height setting.

<style>.icon {height:3em;}</style>

Be aware, that the hardcoded <style> directive is active for the whole page. So all open tiddlers will be effected as long as the tiddler is visible. To avoid this, you'll need to define a unique class-name for "special settings".

--------------------------- IMO better practice!

If you need to change settings for all your images, it will be better to create your own image macro. eg:

[img[xx]] is a shortcut for: <img src="""xxx""">

So your macro can look as the following code. Create a new tiddler eg: myMacros and tag it: $:/tags/Macro so it will be a global macro

\define image(url, class, height)
<img class="$class$" style="height:$height$" src="""$url$""">
\end

usage will look like this:

<<image "https://www.mediawiki.org/static/favicon/mediawiki.ico" height:"3em">>

<<image "https://www.mediawiki.org/static/favicon/mediawiki.ico" class:icon height:"2em">>




have fun!
mario

PMario

unread,
May 30, 2020, 12:20:13 PM5/30/20
to TiddlyWiki
On Saturday, May 30, 2020 at 6:17:58 PM UTC+2, PMario wrote:

So your macro can look as the following code. Create a new tiddler eg: myMacros and tag it: $:/tags/Macro so it will be a global macro

\define image(url, class, height)
<img class="$class$" style="height:$height$" src="""$url$""">
\end


If you want to  assign a default value for a parameter eg:class you can do this:

\define image(url, class:"icon", height)

<img class="$class$" style="height:$height$" src="""$url$""">
\end

-mario

Jake

unread,
May 30, 2020, 4:29:49 PM5/30/20
to TiddlyWiki
2Mario:

Yeah! Looks like it worked. I wrote a marco:

\define imgtxt(url, height, top)
<img src="""$url$""" style="height:$height$; position:relative; top:$top$">
\end

And now it seems like I can modify the size and position of any icon in the text the way I want with this:

<<imgtxt "https://..." height: "1.8em" top:"0.7em">>

That's rather useful, since the existing set of standard emoji that I used is not enough for me. :)

Thanks, Mario! That was very helpful!


Reply all
Reply to author
Forward
0 new messages