Storing formatted text but not in the text field

I have been researching how I can store formatted text, using wiki formatting characters, in a field but not the text field. On display, the wiki formatting should be observed so the user sees what they might see in a formatted text field.

From what I can read, JSON seems the way to go.

Can someone point me into the right direction please.

bobj

I think its a bit of a journey, and there are different ways to go about it depending on what you want to achieve… but to start on one right direction you could:

  1. Clone a copy of $:/core/ui/ViewTemplate/body/default - this is the template for what you see as formatted text. You will need to edit this to show your new text field.
  2. Tag that cloned copy with the system tag $:/tags/ViewTemplate so that it will show up on every tiddler.

Once you get this far you’ll notice that most tiddlers will repeat the formatting of the text field and that some tiddlers have red boxes of errors (from too much recursive transclusion)… To fix this you can edit your cloned viewtemplate to be more selective - say to only transclude the field text-2 if it exists. (use the conditional formatting <%if etc… )

The editing of this field can be done in a similar way with a clone of $:/core/ui/EditTemplate/body/editor and system tag $:/tags/EditTemplate… but after that it gets a bit more complex in terms of things like - reusing the toolbar if desired, positioning this above the fields, making the text-2 field not visible among the fields list …

I would recommend creating a new wiki for this before starting - customising at this level can be precarious.

:smiley:

You may have a look at the linked thread, which describes my Field Editor Plugin. It also contains a link to a Youtube video, which shows the functionality.

It is not a 100% fit to the questions in the OP, since there is no field-editor - preview. The formatted output can only be seen once saved and when the fields are rendered by a view-template

1 Like

Thats a much nicer solution for the editing of the fields… well done !

Could you then combine that with the cloneing of the View template body to show both fields in view mode ?