Dynamic table help - filter by a tag, but don't show that tag in the tags column

How can I create a table that shows all tiddlers tagged with Contents, shows tags as a field in the table, but does not show the Contents tag in that column?

To put it another way, I’m using the below, but I don’t want the tags field to display the Contents tag in the tags column.

<<table-dynamic filter:"[tag[Contents]]" fields:"title created modified tags" stateTiddler:"currentTiddler" caption:"''List of Articles''">>

Shiraz uses templates to show field contents as table columns. for tags, you can find the template in $:/plugins/kookma/shiraz/templates/body/tags tiddler. You can customize it to exclude specific tab!

By default, the content of tags field are shown!

So, when I see a URL like that, what’s the best way to load/display that?

DesertDwarf, that’s not a url, but a tiddler name. System tiddlers (backstage ones that aren’t your own ordinary workaday content) start with $:/

The quickest way is to use the “Advanced search” interface. To the right of the regular search window, the magnifying-glass icon with three dots brings up the advanced search window.

Once you’ve opened that “shadow” tiddler, you’ll look for this bit around the middle of it:

<$list filter="[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]" variable="listItem"> 
<$transclude tiddler=<<listItem>>/> 
</$list>

The filter is this part:
"[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]"

and that’s where you’ll want to insert (before the closing quote) something like
-MyTag

If you’re not yet familiar with filter syntax, this may be a good occasion to start learning. :slight_smile: Stop back in with any questions that stump you!

So, just to make sure I’m doing it right, I’ll need to edit the Shadow $:/plugins/kookma/shiraz/templates/body/tags tiddler, right?

Correct. That shadow tiddler tell the plugin how to display tags, and (in your case) you can modify it to so that it will leave out particular tags.

I think my previous post didn’t properly display the space before the minus. To remove Contents from the filter expression, put a space, the minus sign, then Contents right before the closing quote for that filter. If you later discover another tag you’d like to remove, you can add it also, as in:

"[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]] -Contents -SillyTag"

This solution removes the Contents tag (etc.) wherever a dynamic table has a column for the tags field. If you want different tags removed from different tables, that’s a next-level challenge. :wink:

Thank you for helping me with this, but my column still has the Contents tag in it. I’ll share more below. At present, this is how I’m generating the table:

<<table-dynamic filter:"[tag[Contents]]" fields:"title created modified tags" stateTiddler:"currentTiddler" caption:"''List of Articles''">>

This is how the table is displayed:

This is the current contents of the shadow tiddler $:/plugins/kookma/shiraz/templates/body/tags:

<$reveal type="nomatch" stateTitle=<<tempTableEdit>> stateIndex="mode" text="edit" tag="td">
<$list filter="[title<currentRecord>tags[]]">
<span class="tc-tag-list-item" >
<$set name="transclusion" value=<<currentTiddler>>>
<$macrocall $name="tag-pill-body" tag=<<currentTiddler>> icon={{!!icon}} color={{!!color}} palette={{$:/palette}} element-tag="""$button""" element-attributes="""popup=<<tempTagPopup>> dragFilter='[all[current]tagging[]]' tag='span'"""/>
<$reveal state=<<tempTagPopup>> style="position:absolute; z-index:9999;" type="popup" position="below" animate="yes" class="tc-drop-down">
<$set name="tv-show-missing-links" value="yes">
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
</$set>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]] -Contents" variable="listItem"> 
<$transclude tiddler=<<listItem>>/> 
</$list>
<hr>
<$macrocall $name="list-tagged-draggable" tag=<<currentTiddler>>/>
</$reveal>
</$set>
</span>
</$list>
</$reveal>
<$reveal type="match" stateTitle=<<tempTableEdit>> stateIndex="mode" text="edit" tag="td">
<!--check if the current column is not selected for sorting-->
<$list filter="[<tempTableSort>getindex[sortIndex]match<currentColumn>]" variable=ignore
emptyMessage=<<editCell>> >
 <<showCell_Locked>>
</$list>
</$reveal>

And a screenshot of the shadow tiddler in edit mode (just in case it helps for diagnosis):

Try adding “-Contents” to the filter in the second line, instead of the filter in the 10th line.

<$list filter="[title<currentRecord>tags[]] -Contents">

-e

1 Like

There we go.

Simply splendid! Thanks, @EricShulman.

image

Desert Dwarf,

Apologies that my answer was written hastily without slowing down to verify that I was looking at the right filter location. I’m glad EricShulman was poised with the correction!

-Springer

I thank you very much for responding and trying to help. I well understand the complexity of responding to a query like mine, especially when it’s not your code that you’re trying to help me modify.

I’m just delighted with the results. I showed it to my team yesterday and they’re happy with my TW-managed “changelog” of things our team needs to keep track.

Can one of you (@EricShulman, @Mohammad, or you) let me know if I upgrade Shiraz, will I need to re-edit that shadow tiddler? I’m not certain yet what impact there is in modifying a shadow with regards to future upgrades and such.

When you edit a shadow tiddler, it automatically creates a “real” tiddler with the same name. As long as that “real” tiddler exists, it supercedes the shadow tiddler definition, even if you upgrade the plugin from which the shadow tiddler originates.

One caveat: if the shadow tiddler definition was changed by a plugin upgrade, then those changes will NOT be automatically applied to the modified “real” tiddler that was previously created. After upgrading, you should check to see if the shadow tiddler has changes and if it does then you should hand-merge your modified tiddler with the newly upgraded shadow tiddler.

-e

1 Like