Reveal Widget Replacement

Based on the deprecating reveal widget comment in [TW2036] Planning for v5.4.0

Would Conditional Shortcut Syntax be the preferred method going forward?


I have managed to get a working replacement version, I just need to adjust for use in tabs macro.

<style>
/* Table caption at top */
.table-caption-top caption {
 caption-side:top;
 margin-bottom:0.2rem;
}
</style>

<div style="overflow-x:auto;">
<%if [{!!category_radio}match[Total]] %>

|tc-center tc-max-width-80 table-caption-top|k
|A|B|C|lorem|h
| 100| 200| 300|<<.lorem>>|
|<$radio field="category_radio" value="Total"> Total  </$radio> - <$radio field="category_radio" value="Stat/1s"> Stat/1s  </$radio> - <$radio field="category_radio" value="Stat/60s"> Stat/60s  </$radio> -  Test Table|c
<%endif%>

<%if [{!!category_radio}match[Stat/1s]] %>

|tc-center tc-max-width-80 table-caption-top|k
|A|B|C|lorem|h
| 1| 2| 3|<<.lorem>>|
|<$radio field="category_radio" value="Total"> Total  </$radio> - <$radio field="category_radio" value="Stat/1s"> Stat/1s  </$radio> - <$radio field="category_radio" value="Stat/60s"> Stat/60s  </$radio> -  Test Table|c
<%endif%>
<%if [{!!category_radio}match[Stat/60s]] %>

|tc-center tc-max-width-80 table-caption-top|k
|A|B|C|lorem|h
| 60| 120| 180|<<.lorem>>|
|<$radio field="category_radio" value="Total"> Total  </$radio> - <$radio field="category_radio" value="Stat/1s"> Stat/1s  </$radio> - <$radio field="category_radio" value="Stat/60s"> Stat/60s  </$radio>  -  Test Table|c
<%endif%>


</div>
1 Like

I came to the same conclusion when the reveal deprecation also stuck out at me in the post. I have just gone through and changed almost all of my reveals with conditional shortcuts, other than the reveal widget instances that I use for popups. Anyone know how or what would be used as the replacement for using the reveal widget for displaying a popup?

The “PopupMechanism” documentation only shows three parts to a popup:

  • StateTiddlers to record whether a popup is currently displayed or not
  • The RevealWidget to selectively display the popup content
    • Introduced in v5.2.4 For positioning the popups relative or absolute coordinates can be used. See Coordinate Systems for more information about usage and format.
    • For “sticky” popups — those that don’t close when clicking inside one — set the class attribute to tc-popup-keep
  • The ButtonWidget to trigger the display of the popup by setting the state tiddler appropriately

So you use a state tiddler to determine whether or not it should be displayed, the reveal widget for the content of what to display and the button widget to initiate the display. So what can replace the reveal step?

1 Like

i am also very interested in learning what the intended replacement is for the reveal widget, as i currently use it heavily in my wikis as the “go-to” for dynamic rendering based on variables/state tiddlers… i was not aware it was slated for depreciation.

We will need something a bit more complex to replicate a few important aspects of the behaviour of the reveal widget, such as the ability to animate the reveal/hide and the popup handling.

I’m hoping we can replace the reveal widget with a wikitext implementation as a custom widget. It would be part of a new plugin where we will move deprecated features. This approach would require us to relax the current restriction on custom widget names.

2 Likes