Jean-Pierre,

The word template is over used in tiddlywiki, mostly because of the many 
ways to do templating. There are more possible than the common ones.

   - {{tiddlername}} is like incorporating content from a template 
   containing text or code
   - {{||tiddlername}} says display tiddler name here, with the current 
   tiddler as the underlying content ie; use the current text and fields title 
   etc...
   - These are in fact just a short hand for transclusion see the 
   <$transclued widget for the long hand form, the transclude say apply this 
   tiddler here, ie use it as a template.
   - Tagging a tiddler with $:/tags/viewTemplate says please use this in 
   the core template called  "viewTemplate" as you view each tiddler, the 
   viewTemplate is a special template
   - Tagging a tiddler with $:/tags/editTemplate says please use this in 
   the  template called  "editTemplate" as you edit each tiddler , the 
   editTemplate is a special template
   - In fact in many ways macros are almost identical. When you use a macro 
   its contents are pulled into the location where you use it.
   - Then after all your content development the finial result is 
   transcluded, expanded, rendered, processed and displayed according to what 
   you asked for.

In some ways it is best to return to the English definition of template;

*A template is a form, mold, or pattern used as a guide to making 
something. Here are some examples: A ruler is a template when used to draw 
a straight line. A document in which the standard opening and closing parts 
are already filled in is a template that you can copy and then fill in the 
variable parts.*

In some ways, in code and tiddlywiki a template is simply a piece of 
reusable content. Almost everything is reusable in tiddler wiki, so almost 
everything can be used as a template.

Widgets on the other hand are very similar to html tags eg; <li>List 
item</li> or <br/> but the $ indicates you are referring to a 
<$widgetname/> and like html it can have attributes which are effectively 
the parameters to the widget. Widgets are the tiddlywiki way to introduce 
code such as html may use javascript. In fact most widgets are javascript 
but with one special feature, they honor the structure of tiddlywiki, they 
do what they do but in a way the whole wiki knows how to handle changes to 
itself, it is this magic ingredient that makes a wiki so interactive, 
always up to date and maintains the user interface. Widgets are a way to 
transclude functional code in your tiddlers.

I hope this clarifies things a little.

Topes
On Monday, 28 June 2021 at 21:39:22 UTC+10 jn.pierr...@gmail.com wrote:

> Hi!
>
> I've read in the doc that widgets are the fundamental part of tiddlywiki 
> and that all wiki syntax sugar is finally resolved as a number of widgets.
>
> Use of template is only described with transclusion as {{||template}} 
> (with tiddler or field or index before ||).
>
> the transclude widget has no template attribute.
>
> How then is done the transclusion? Shouldn't the transclude widget have a 
> template attribute?
>
> Also, I've come across $:/tags/ViewTemplate which is only described as: 
> "The system tag <https://tiddlywiki.com/#SystemTags> $:/tags/ViewTemplate 
> marks the view template." which is not very telling.
>
> I've done tenplates tgat work fine. They are not 
> tagged $:/tags/ViewTemplate. If I tag them as scuch, they act aout as if 
> their content was twice included. What does $:/tags/ViewTemplate really do? 
> How should it be used?
>
> Regards,
>
> -- 
> Jean-Pierre
>
>
>
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4b26d05d-16df-429f-a4f1-7098184a87ben%40googlegroups.com.

Reply via email to