Re: template for displaying data fields in view mode

142 views
Skip to first unread message
Message has been deleted

Mohammad

unread,
Jun 26, 2019, 10:21:03 AM6/26/19
to TiddlyWiki
Added to TWScript

On Wednesday, June 26, 2019 at 12:38:07 PM UTC+4:30, A Gloom wrote:
This has probably been done plenty of times before.  A small template for displaying data fields of a tiddler when its in view mode without having to use "Info".  Where this differs from tiddler "Info", it doesn't show the standard fields (title, tags, type) but only the ones that display at the bottom of a tiddler edit page, the unique user created fields.

the visual format looks like this:

Hidden data fields of this page
field name : value field name : value field name : value

underlined (field names) will be in a <code> like border


It uses 2 spans-- one (ragsspannumb) to give the field name a border, reduce its text size a little and make it bold face.  The other span (ragsspannobrk) keeps the field name-data value together so they don't get separated by line breaks.

The container div and span borders for field names can be styled.

template tiddler, title: datafields display template (can be changed)

<div style="width:100%;margin:0px; padding:10px; border:dotted 1px;">
__Hidden data fields of this page__:
<br/>
<$list filter="[all[current]fields[]!prefix[filter-field]sort[title]] -[all[shadows]removeprefix[$:/language/Docs/Fields/]]" variable="listItem" >
<span class="ragsspannobrk"><span class="ragsspannumb"><$text text=<<listItem>>/></span> : <$view field=<<listItem>>/></span></$list>
</div>

the styles it uses, can also be renamed to suit needs

/* span nobreak */
.ragspannobrk {white-space: nowrap;}

/* span borders small bold */
.ragsspannumb {border:solid 1px; border-radius:4px; padding:0px 4px 0px 4px; font-size: smaller; font-weight: bold;}

to use it, in any tiddler, use:

{{||datafields display template}}

A Gloom

unread,
Jun 26, 2019, 5:59:22 PM6/26/19
to tiddl...@googlegroups.com
Somehow I deleted the wrong post--meant to delete a response, not the main post-- between my eyes and Google not applying my Windows system theme correctly, I end up with disasters like this

THE ORIGINAL POST

A Gloom

unread,
Jun 26, 2019, 6:10:28 PM6/26/19
to TiddlyWiki
Mohammad,

Added to TWScript

I just realized I wasn't attaching .tid files to my posts for you to add them to TWScripts. I shall for the next post-- its gonna be a long one about custom export templates for TW single file.

good news, I created the wiki that I'll eventually put somewhere public

Clipboard013.jpg

 

Mohammad

unread,
Jun 26, 2019, 10:02:15 PM6/26/19
to TiddlyWiki
That will facilitate the documentation at TWScripts.

A Gloom

unread,
Jun 26, 2019, 10:25:16 PM6/26/19
to TiddlyWiki
Mohammad,

A .tid had been attached to the "class=--" tiddlers thread, some editing and formatting added

Mohammad

unread,
Jun 27, 2019, 12:28:47 PM6/27/19
to TiddlyWiki
Many thanks!
I got it.
Reply all
Reply to author
Forward
0 new messages