Questions by a newbie

i have 3 things i want to do since i downloaded tiddlywiki:

i want to create a field that has to contain multiple variable.
the field will be called definition and as its variable will have all the parents of the tiddler.
the problem comes when i try to make a filter. i want it to show the list of tiddlers that have in the field definition the title of the tiddler i’m writing the filter in.
for example tiddler1 has definition: tiddler2, tiddler,3 and i want in both tiddlers a filter showing tiddler1 in it.
how can i do it?

i want to create a tiddler containig multiple attributes. all of themmust be global, i mean i want them to refer to them in all my wiki. can i do that? on top of that can they have multiple variable? and can i chose whitch variable to show in each context?

if i have an attribute with a variable. can i put latex code in it and have it rendered to show the thing i wanted? on top of that can a variable a link?

Luca, I think you can get the results you want but your question is not really about what you want to do but what you are trying to do with half the solution already described. It would be better to step back and explain what you want to happen at a logical level and ask the community how best to achieve it.

Another way to look at it is to see if you can find somewhere in tiddlywiki, or a public tiddlywiki or edition, that already does what you want for example the tags field can already contain multiple titles which may or may not also be tiddlers, the tag pills show how you can view them.

Almost anything is possible in TiddlyWiki but this means a lot of bad choices can be made as well. Going back to you requirements in the real world can make it easier for the community to help you.

if you have field definition with parent1 [[parent 2]] [[another parent]]
then you can use {{{ [enlist{!!definition}] }}} to get the 3 parents. if you are populating definiton using a filter then don’t forget to use +[format:titlelist[]]

is that part of what you are wanting?

TW_tones you’re absolutly right.
I study math and i want to create a wiki with all the definnition and theorem i studied.
to do so i wanted thought that the best solution, to not create enormous tiddlers, would be to create 3 kinds of tuddlers.

  • one with the theorems: that would have a field called theorem whitch contains a link to a definition tiddlers it will be attached to and a field called father with a link to a theorem tiddler of whitch is a consequence, hence that if i filter them it shoultìd be put after him (not necessarily imediately).
  • one with the observations: it will be the same as the theorem one but it will be put into another filter because more strictly relate to the definition
  • one with the definitions: it will contains the definitions and the filters of theorems and observations related to it (by filtering with the fields of the theorems and observations). moreover i wanted to put a filter of all backlinks from another definition to form a kind of map between them.

btw: i don’t know if it’s possible but i wanted to put all the variables in the end of the page where it ask you whith field you want to add, separated by a comma.

for the global attribute:
i thought the safer way to indicate to something would be to create a tiddler containing all those attributes.
i wanted them to contain multiple variables: linkname, linkalias1, linkalias2, … .
all of those connected with the same tiddler.
the idea was to put linkname as title of a definition tiddler and each time i have to call for the tiddler just place the attribute with the right alias.

i wanted the variable able to be rendered just because it could be useful to call a simbol to the definition of it.

why i chose this setting?

  • since i don’t know if in the future i will add another tiddler higher than the first i put i can’t use tags for a hyerachical structure (and i didn’t wanted it).
  • putting all the information into one field seems more easy. the only problem i had is what i told before. If i have more than one value in a field how can i search for it
  • if i use this method then if for any reason i need to change a name in the wiki i hust need to go in the names tiddler and change it once for all.

conclusion:
maybe this method could slow tiddlywiki a bit but:

  • i’ll be able to write large tiddlers with the informations i need without writing all of it each time
  • it gives me flexibility with names
  • once i finished writing the templates for the three tiddlers i just need to write some paragraphs and they will add each other easily

please tell if this could be a good way.
my only concern is that tiddlywiki will not be able to render a tiddler if it becomes too long
idk if there are any other ways to handle it more efficently
thenks in advance

VikingMage i’m not sure to have understood it
what i wanted to do is:
tiddler1:definition:tiddler2,tiddler3
tiddler2:definition:tiddler3
tiddler3:fefinition:

then want a filter that from tiddler3 calls all the tiddlers that have in the field definition the name tiddler3 (hence tiddelr1,tiddler2)
for tiddler2 return tiddler1
and for tiddler1 returns nothhing
idk if it was what you meant?

Have you tried maths/ physics notebook?

If I understand correctly, you can use the contains operator.

Here I use a common tag, MyTag, as presumably you want to limit this to only some subset of all your tiddlers. I use a ViewTemplate to add a footer to appropriate tiddlers. It looks like this:

title: MyTag Template
tags: $:/tags/ViewTemplate
list-after: $:/core/ui/ViewTemplate/body

<% if [<currentTiddler>tag[MyTag]] %>
  <% if [tag[MyTag]contains:definition<currentTiddler>] %>

----------
!!! Others using this
<<list-links filter:"[tag[MyTag]contains:definition<currentTiddler>]" >>

  <% endif %>
<% endif %>

Here we wrap our template to only apply when the current tiddler has the tag MyTag. Then we use the filter [tag[MyTag]contains:definition<currentTiddler>] twice: first to avoid the footer if it would be empty, and second, if it’s not empty, to show the list of tiddlers whose definition fields contains the current tiddler.

The tiddlers themselves are trivial:

title: Tiddler 1
tags: MyTag
definition: [[Tiddler 2]] [[Tiddler 3]]

Content for Tiddler 1 here
title: Tiddler 2
tags: MyTag
definition: [[Tiddler 3]]

Content for Tiddler 2 here
title: Tiddler 3
tags: MyTag
definition:

Content for Tiddler 3 here

It might look like this:

You can test this yourself by downloading the following and dragging the resulting file onto any wiki:

MyTag.json (895 Bytes)

thank you so much!!
that’s exatly what i was looking for.

if it’s not too much of a burder could someone explain me the part of the global variables?

thanks in advance

I’m not sure if this is what you mean:

If you use \define, \procedure or \function pragmas in your tiddler, you will have access to them through the rest of the tiddler. But they will be available nowhere else… except, if your tiddler has the tag $:/tags/Global. Then those definitions are available throughout your wiki.

title: Tiddler 1

\define PI() 3.141592653589793238462643383279

The value of PI: <<PI>>

yields:

The value of PI: 3.141592653589793238462643383279

But

title: Tiddler 2

The value of PI: <<PI>>

looks like

The value of PI:

However if we use a global tag:

title: Tiddler 3
tags: $:/tags/Global

\define EULER() 2.718281828459045235360287471352

The value of EULER: <<EULER>>

yields

The value of EULER:: 2.718281828459045235360287471352

as expected, and

title: Tiddler 4

The value of EULER: <<EULER>>

looks like:

The value of EULER: 2.718281828459045235360287471352

because EULER was defined in Tiddler 3, which has the tag $:/tags/Global.

You can test it yourself with this:

Globals.json (634 Bytes)

Thank you so much
You were really helpful!!!

yes, thanks for pointing it out.