Trying to find a way to list skills if they have the same tag as a job(Solved)

Hi,

I have a table that matches the tag of a job with the tag of a skill.

There are 7 different combinations possible.

What i’ve come op with so far is;

The general Skills that can be learned are:
<style>
table, th, td {border: 3px solid; color: blue; text-align: center;
 }
</style>

<div style= "overflow-x: auto;">
<table>
 <tr>
     <th>Skill Name</th>
  </tr>
<$list filter= "[tag[Skills]!tag[Exclusive]tag[Divine]] [tag[Skills]!tag[Exclusive]tag[Arcane]]">
 <tr>
<td><$link><$text text={{{ [{!!title}removeprefix[Z-]] }}}/></$link></td>
</tr>
</$list>
</table>
</div>

this would have up to 7 steps, each for a different tag. Currently I have 2 of them, for Arcane and Divine.

If the skill is Exclusive it shouldn’t be listed, and it should have the Skills tag.

This works, as far as it goes. But if I change the tag on the skill or the job it doesn’t work without changing the table.

As both the job and the skill have the same tag, it should be possible to get a match, ideally with a procedure that is the same for any job.

I looked at the forum and saw a promising Enlist option, however that matched the tags with the title, not the other tags.

Any idea how i could do this? Thanks in advance for any help.

I’m not sure whether I’m following your goals correctly. Is this a template to be displayed on “job” tiddlers, thus matching skill tiddler tags with tags on the current tiddler?

If so, you could try something along these lines:

<$list filter="[enlist{!!tags}tagging[]tag[Skills]!tag[Exclusive]]">
<tr>
<td><$link><$text text={{{ [{!!title}removeprefix[Z-]] }}}/></$link></td>
</tr>
</$list>

How this works:

  • enlist{!!tags} — enlist all the tags of the <<currentTiddler>>
  • tagging[] — find each tiddler that has at least one tag defined in the previous step
  • tag[Skills] — restrict this list to tiddlers with the Skills tag
  • !tag[Exclusive] — restrict this list to tiddlers without the Exclusive tag

If not, more information or (ideally) a demo wiki would help clarify the issue.

1 Like

Thanks for the help.

The idea was to show which skills are available if you have the job.

The link to the Wiki is https://aesirius-rpg.tiddlyhost.com/

I did not complete your suggestion yet, but the tiddler in question is J-Healer.

With its divine tag it should list Z-Scribe and Z-Teach, who also have the divine tag.

And sorry if the wiki is messy, I started with Tiddlywiki around 18-1-2025 so it is very new.

Edit: it worked. Now to make a procedure or function of it.

If this is code you’d like to reuse, I’d recommend moving it into a procedure (or macro; not a function, as those display plain text, not HTML) once you’ve finished tinkering so you don’t have to repeat the same code on multiple tiddlers. Alternatively (and this is usually my preferred approach), you could move it into a separate ViewTemplate tiddler. For instance:

title: JobTemplate
tags: $:/tags/ViewTemplate
text:
<% if [<currentTiddler>tag[Job]] %>
your code goes here
<% endif %>

The contents of this tiddler will be automatically displayed as a view template segment on every tiddler with the Job tag.

1 Like

That is definitely something I have to look into.

What I did was extending the job.rank procedure that is called at the end of every Job tiddler.

Now all jobs list the skills they allow you to learn.

I have just uploaded the new version.

I think this is one of the strengths of tiddlywiki, as after finding the solution it is easy to upgrade rhe whole wiki to use the new procedure.

Also this is something I will need a lot later on when working on spells, monsters, etc.