Reveal fields on View mode

58 views
Skip to first unread message

Mohammad Rahmani

unread,
Apr 8, 2021, 1:35:03 PM4/8/21
to tiddl...@googlegroups.com
In the Utility plugin there is a button on the sidebar that on click shows the fields under subtitle and above the text of tiddler.
To simplify it I decided to transclude the core tiddler e.g $:/core/ui/EditTemplate/fields in my own tiddler as below and conditionally tag it with $:/tags/ViewTemplate.

So if you like to reproduce the whole work

2. create a tiddler as below

title: my view fields
tags: $:/tags/ViewTemplate
text: <$transclude tiddler="$:/core/ui/EditTemplate/fields"/>

3. create a test tiddler with fields like fld1 fld2 with some test values
4. save test tiddler and see fields in view mode

I have attached it for your convenience.

It works but there are two issues
1. the keyboard shortcuts do not work
2. the add new fields does not work

I think some variables are not set correctly in my solution above! e.g we need 
<$vars ....    ... ...>
 <$transclude tiddler="$:/core/ui/EditTemplate/fields"/>
</$vars>

What do you think?

Best wishes
Mohammad
my view fields.tid

Mark S.

unread,
Apr 8, 2021, 2:20:17 PM4/8/21
to TiddlyWiki
As a start:

<$fieldmangler>
<$vars newFieldNameTiddler=<<qualify ":/temp/NewFieldName">>
newFieldValueTiddler=<<qualify ":/temp/NewFieldValue">>
>
<$transclude tiddler="$:/core/ui/EditTemplate/fields"/>
</$vars>
</$fieldmangler>



Mohammad Rahmani

unread,
Apr 8, 2021, 2:33:21 PM4/8/21
to tiddl...@googlegroups.com
Good start Mark,

The current fields are displayed
New fields can be added
the field name does not filter names as you type
enter key on adding the new fields works
other shortcuts does not work





Best wishes
Mohammad


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/39af16b4-1594-4d06-b309-c1cb85be153cn%40googlegroups.com.

Mohammad Rahmani

unread,
Apr 8, 2021, 3:21:35 PM4/8/21
to tiddl...@googlegroups.com
Mark I think the below works

<$vars newFieldNameTiddler=<<qualify "xx:/temp/NewFieldName">>
newFieldValueTiddler=<<qualify "xx:/temp/NewFieldValue">>  
searchListState=<<qualify "xx:/temp/searchListState">> 
storeTitle=<<qualify "xx:/temp/storeTitle">> 
>
<$transclude tiddler="$:/core/ui/EditTemplate/fields"/> 
</$vars>


By way not sure if we meet all requirements or not ;-)


Also this works (copied from TW core editviewtemplate ui itself)

<$vars storyTiddler=<<currentTiddler>> newTagNameTiddler=<<qualify "$:/temp/NewTagName">> newFieldNameTiddler=<<qualify "$:/temp/NewFieldName">> newFieldValueTiddler=<<qualify "$:/temp/NewFieldValue">> newFieldNameInputTiddler=<<qualify "$:/temp/NewFieldName/input">> newFieldNameSelectionTiddler=<<qualify "$:/temp/NewFieldName/selected-item">> newTagNameInputTiddler=<<qualify "$:/temp/NewTagName/input">> newTagNameSelectionTiddler=<<qualify "$:/temp/NewTagName/selected-item">> typeInputTiddler=<<qualify "$:/temp/Type/input">> typeSelectionTiddler=<<qualify "$:/temp/Type/selected-item">>>
<$keyboard key="((cancel-edit-tiddler))" actions=<<cancel-delete-tiddler-actions "cancel">>>
<$keyboard key="((save-tiddler))" actions=<<save-tiddler-actions>>>
<$list filter="$:/core/ui/EditTemplate/fields" variable="listItem">
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
<$transclude tiddler=<<listItem>>/>
</$set>
</$list>
</$keyboard>
</$keyboard>
</$vars>



Best wishes
Mohammad


On Thu, Apr 8, 2021 at 10:50 PM 'Mark S.' via TiddlyWiki <tiddl...@googlegroups.com> wrote:
--
Reply all
Reply to author
Forward
0 new messages