Folks - I ask this question here because it needs a developers eye over it.
Background
The tiddler “type” field contains what are effectively, mime types, as I understand it. Some types will use a different way to “render” the text field eg text/plain and text/css that is they render the text field differently to the default. I understand this may also relate to deserialisers. In these cases the body text is not rendered.
Recent community activity
- A number of people have being asking how to programaticaly hide-body or fold mechanisms to stop simply rendering the the text (default type text/vnd.tiddlywiki)
- With edit in tiddler now possible people are reconsidering building forms or alternate views for different tiddler types.
My personal projects
Since I am building solutions that introduce a tiddler type “object-type” field to describe a tiddler,
- I also want to hide the standard rendering of the text field
- Provide a custom view template for each type
- Provide a custom edit template for each type
- Provide a templating mechaisium for each type
- Introduce so new innovative types of tiddler which treat the text field quite differently.
- One type could be print ready
But we already have something similar the type field.
I have being researching how to hack this type mechaisium and wonder it it would be possible to permit new types of the form user/subtypename for example;
- user/contact for a contact record, template form and view template
- user/location for places
- user/subnet for an ip subnet.
The advantages of this approach is
- we need not bloat the view template to take account of different ways to display alternative tiddler types
- We maintain a single type field and reuse an existing mechaisium
- Each type can include its own macros, css and other logic or content independently form other types.
- transcluding a different type can inherit its tiddler “type” allowing us to transclude multiple tiddler types into one tiddler and have its formatting honored. For example;
Content
{{Tiddler}}
<hr>
{{||Tiddler}}
more content
try the above where “Tiddler” is set to text/plain, it is transcluded as expected with no additional logic required. Thus one tiddler can have multiple tiddler types transcluded in it.
Notes;
- Although this would introduce new types they may very well be based on existing types, most commonly text/vnd.tiddlywiki but also text/plain to name a few.
Questions;
- So how plausible is this?
- If not have you an idea how to achieve this otherwise?
- What difficulties can you foresee?
- Could this one day be in the core, even if it were a plugin to start?
[Edited - postscript]
- One could choose to have a desktop/tablet/mobile tiddler for the same content if they needed a different structure.
Thanks in advance, Tony