Funny behaviour TW5.1.22

I am creating a wiki with a set of buttons defined on various ViewTemplates. This worked OK until this afternoon, displaying the required buttons only on my data tiddlers.

However, I am now seeing three of the buttons displayed on all tiddlers I open, including system tiddlers.

The following is a link to a screen grab showing what I am seeing.
[Dropbox - funnybuttons.png - Simplify your life]

Anyone got any ideas? Obviously something has gotten corrupted but what?

bobj

The ViewTemplate code is as follows:

<$list filter="[all[current]tag[Exhibitions]!tag[Templates]!tag[Index]]" variable=null>

<img src={{!!exhibition_url}}>

{{!!exhibition_name}}, {{!!exhibition_gallery}}, {{!!exhibition_date}}

----

''The following artwork were exhibited in this exhibition''

<$list filter="[tag[Artworks]{!!exhibition_id}!is[blank]]" variable="not_blank">
   <$list filter="[!tag[Index]!match<currentTiddler>contains:exhibition_id{!!exhibition_id}]">
      <$link/> <$view field="artwork_title"/><br/>
  </$list>
</$list>

''The following consignments were used for this exhibition''

<$list filter="[{!!exhibition_id}!is[blank]]" variable="not_blank">
   <$list filter="[tag[Consignmentss]!tag[Index]!match<currentTiddler>contains:exhibition_id{!!exhibition_id}]">
      <$link/> <$view field="consignment_date"/><br/>
  </$list>
</$list>

''This exhibition was organised by the following person/organisation''

<$list filter="[{!!exhibition_id}!is[blank]]" variable="not_blank">
   <$list filter="[tag[Names]!tag[Index]!match<currentTiddler>contains:exhibition_id{!!exhibition_id}]">
      <$link/> <$view field="person_name"/>  <$view field="organisation_name"/><br/>
  </$list>
</$list>

----
<$fieldmangler>
<$button message="tm-add-tag" param="Mark">Add Mark</$button>
<$button message="tm-remove-tag" param="Mark">Clear Mark</$button>
</$fieldmangler>
<$button>
<$list filter="[tag[Mark]]">
<$fieldmangler>
<$action-sendmessage $message="tm-remove-tag" $param="Mark" />
</$fieldmangler>
</$list>
Clear All Marks
</$button>
 <$button to="Mark/UnMark Pages">?</$button>

<$button>
<$action-createtiddler $basetitle="$:/TLS/exhibition_id" text={{!!exhibition_id}} $overwrite="yes"/>
<$action-navigate $to="Link artworks to exhibition" />
Add Artwork to Exhibition
</$button>

</$list>

A post was split to a new topic: Problem with scrolling behaviour

What did you change before the problems happened?

With most view template items wrapping the whole lot in a conditional list with a named variable is the way to do it. Don’t be shy using nested lists, they are great;

<$list filter="[all[current]!is[system]]" variable=nul>
all your above code here will show only on non system tiddlers
</$list>
  • These conditional filters usually operate on something about the current tiddler.
  • I see you code jumps strait into the filter about tags, you make no attempt to exclude non-system tiddlers.

Finally when you see something displaying when it should not it can often be because part of you filter this throwing a different result to what you think, or a variable resolves to empty/blank or zero.

We’re at a disadvantage not being able to see your actual code and data. My guess is that you cloned a tiddler and now there are two templates being applied.

On another note, I don’t think this will do what you’re hoping it to do:

<$list filter="[tag[Artworks]{!!exhibition_id}!is[blank]]" 

I think the {!!exhibition_id} will replace the preceding tag[Artworks] filter. So basically the tag operator does nothing.

Good luck!

after considering all your comments about lists etc, I reviewed my four viewtemplates and found one that had the button statements outside of a list loop. Not sure how this happened but putting the loop correctly, all extraneous buttons disappeared.

Thank you for helping to focus my thoughts.

Now to go on and further consider specific comments about my list statements and most likley amend from one more complex to two or more simpler ones.

bobj

1 Like