Complicated Design Questions, Json Editing, and Gui features

128 views
Skip to first unread message

Tiddly Novice

unread,
Nov 1, 2020, 4:06:19 PM11/1/20
to TiddlyWiki
I apologize for using pictures to explain this, but I've no idea what the right words are. I was looking at the examples for the Json Editor plug-in, when I wondered if there might be a way to dodge having to deal with wikitext all the time and just make templates with editable fields. But then I realized I didn't really want the fields to look editable all the time since, for one thing, that tends to take up more space. So, after some thinking, I came up with a kind of template flowchart since I couldn't write a good explanation for what I decided I wanted to do and how I wanted to design a TW for tracking my story writing stuff. The arrows indicate which tiddler is using which as some kind of reference. Does it make sense? (I can try to explain more if asked, but it will probably take a lot of words.)

The main question I have right now is: is it even possible to use common gui design features (textboxes, drop-down menus, color picker buttons, etc) as part of a process of editing a data tiddler (separate from the tiddler that is displaying the gui stuff, of course, since tiddlers can't self-edit. I think?) without the Json Editor Plug-in? (Since that plug-in is no longer being updated)

I will need the gui features in order to make the Value-of-Fields Editing Tiddler Template I'm hoping to use. I'm probably misusing terminology somewhere, but hopefully I'm close enough to be understood. I'm relearning TW after years of not using it, so forgive my ignorance. Also, all the current global events have worn my mental state ragged (hence why I once again need a TW outside my head to keep track of things), so forgive me if I've overlooked something obvious.
twdesigntree.PNG

Mark S.

unread,
Nov 1, 2020, 4:27:06 PM11/1/20
to TiddlyWiki

I'm afraid I don't quite understand the flow chart.

But here ...

 I wondered if there might be a way to dodge having to deal with wikitext all the time and just make templates with editable fields. But then I realized I didn't really want the fields to look editable all the time since, for one thing, that tends to take up more space.

 you could either have your editable template fields hidden/displayed by a button, or you could have a main configuration tiddler that would be used to determine if the editable fields were displayed or not.

I'm not sure why the JSON editor would be required, but perhaps your character data is already in JSON format??


Tiddly Novice

unread,
Nov 1, 2020, 9:32:29 PM11/1/20
to TiddlyWiki
Json is...I'm honestly not sure if it's required or not. I only mentioned it because I got the idea for easy editing while looking at the examples for the Json Editor Plug-in. But as I'm starting to remember TW, I'm slowly starting to realize it might not be needed. I'm still figuring that out.
Meanwhile, I've been making some attempts at creating a test wiki to see where my concept's flaws were and I figured out an important detail. It is likely a very bad idea to design a system such that, in order to make corrections/improvements/upgraded versions of templates/structures, you would edit a defining structure for tiddlers when there are already tiddlers using it. I shouldn't mess with the original template file, instead I should make a new version of the template and migrate the data that was using the old version over to it. That realization has a pretty big impact on my intended system design.

TW Tones

unread,
Nov 2, 2020, 3:45:04 AM11/2/20
to TiddlyWiki
Tiddly Novice,

You are wise to ask as you have at such an early stage as you are considering paths of more complexity that you need. 

Let me try a narrative answer to your case.

  • Tiddlers have fields and thus can be used as objects such as a "character", and you can add and edit fields on "character tiddlers" as you wish in edit mode, they also can have a custom view template applied. 
  • Now a view template typically displays and renders the content of the text field, but you can write one that determines, if you are looking at a character tiddler or not, if you are, it can present the content including the fields in a layout you desire. 
  • Now with another field you could have a custom edit mode, if set to yes, rather than use the aforementioned character view template, or the default edit template it could use your own custom edit mode.
    • Now it is true if you try and edit a tiddler from the same tiddlers your edits will loose focus every character you type, making it unusable. There are ways around this but I have not learned how to share this with others easily as it is not strait forward.
  • So, instead you can create a new tiddler called "Characters" (the plural of character), and within it, or another custom view template you can allow the user (you) to select the character you want to look at and retrieve the information required for that Character from the character tiddler, in this case you are not editing the character tiddler directly, it need not even be visible except in your Characters tiddler.
  • In "characters" you can have a field that you can change from edit to view, and the in edit mode it will show edit-text widgets that let you edit the fields in their separate character tiddlers, ie you edit the character.
Some quick recommendations
  • Every tiddler you create for this, give them a field called object-type, first give an object-type = character to each character tiddler, and other pages such as the Characters view and edit tiddler give it an object-type = page
  • (1) Create a view template for any tiddler with an object-type = character
    • Use this to display additional fields the way you want
  • Create a view template for any tiddler object-type = character
    • Include a selection for current character and view or "custom" edit mode.
    • If in view mode do something similar to (1) even transclude it
    • If in "custom edit mode" provide edits for all relevant fields.
Later when you feel more confident and you learn the tricks to making a view template that can edit the current tiddler, you can move this into the character view template, so on any character you can switch into custom edit mode on itself. Until then open the character tiddler and select the character to edit first.

Keep in mind if you can create a character and instead give it an object-type = character-template, all its required fields an a default, you could use this as a template for new character, or just but editing the character with the characters tiddler you can create an get the character tiddler to have all the required fields.

In a tiddler tagged $:/tags/ViewTemplate
<$list filter="[all[current]object-type[character]]" variable=nul>
  How to display a character tiddler in view mode
  Content for all characters
</$list>
<$list filter="[all[current]object-type[page]]" variable=nul>
   Content for all pages (only one discussed so far)
   Use select widget to choose the character in 
$:/config/selected-character and the view or edit mode here
   <$list filter="[{$:/config/selected-character}]">
         
     <$list filter="[all[current]tiddler-mode[view]]" variable=nul>
        How to display a character tiddler in view mode on the characters tiddler
     </$list>
     <$list filter="[all[current]tiddler-mode[edit]]" variable=nul>
        How to display a character tiddler in edit mode on the characters tiddler
     </$list>
         
   </$list>
</$list>

Happy to offer more details, but perhaps this helps get you started.

Tones
Reply all
Reply to author
Forward
0 new messages