Sorry for jumping in, but I think my comment/question is related to this 
post (if not, I'll create new post)

@Mark

To be more specific about my question above, let me explain what I 
understand :-


   1. By default,  TW5 render ALL tiddlers based on the following templates 
   (taged with $:/tags/ViewTemplate):-
   - $:/core/ui/ViewTemplate/title
      - $:/core/ui/ViewTemplate/unfold
      - $:/core/ui/ViewTemplate/subtitle
      - $:/core/ui/ViewTemplate/tags
      - $:/core/ui/ViewTemplate/classic
      - $:/core/ui/ViewTemplate/body
      2. We need to change this behavior ONLY for the tiddlers tagged 
   "myTag"
   3. As you suggested , we can create a new tiddler (myTemplate01) and tag 
   it with "$:/tags/ViewTemplate" that contains our customization (I'm using 
   your example with some modification) :
   <div class=myclass01>
     <$list filter="[all[current]tag[mytag]]">
               .... whatever you want to present, such as fields, 
   additional information, etc.
     </$list>
   </div>
   
   <div class=myclass02>
   ... other sections for other tags, fields, etc.
   </div>
   4. Now TW5, will use the following Templates to render ALL Tiddlers 
   (let's ignore the order):
   - myTemplate01
      - $:/core/ui/ViewTemplate/title 
      $:/core/ui/ViewTemplate/unfold
      $:/core/ui/ViewTemplate/subtitle
      $:/core/ui/ViewTemplate/tags
      $:/core/ui/ViewTemplate/classic
      $:/core/ui/ViewTemplate/body
      

Now I've the following questions:

   1. How to prevent ALL tiddlers that NOT taged with "myTag" to render my 
   new template? I know that the render output will be empty, but all CSS 
   styles will still applied, Right? Any overhead?
   2. How to prevent Tiddlers that tagged with "myTag" to render the 
   "standerd ViewTemplate" ?
   

Thanks in Advance


On Monday, February 17, 2020 at 11:05:49 PM UTC+2, Mohamed Amin wrote:
>
> Changing existing portions of the tiddler (such as the tags) would require 
>> you to hide the existing sections by removing their
>> $:/tags/ViewTemplate tag, and writing your own replacement.
>>
>
> Would you please give more details, as I didn't get this point 
>
> On Monday, February 17, 2020 at 3:13:54 PM UTC+2, Luis Gonzalez wrote:
>>
>> Usually in the story river all tiddlers are shown with the same 
>> ViewTemplate: you can see the Title, Subtitle, tag zone and the content. 
>> But imagine you can see different content depending on a tag when you open 
>> the tiddler (witth other view template). It would be like having several 
>> types of tiddlers:
>>
>>
>>    - The usual tiddlers
>>    - Tiddlers with sub-stories inside (not reordered and reordered).
>>    - Ttiddlers that show some fields
>>    - etc.
>>
>>
>> I know you can apply a stylesheet depending of a tag or some field: 
>> https://tiddlywiki.com/#Custom%20styles%20by%20data-tags.
>>
>> Is there any way to apply different templates in the story river?
>>
>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/a78b8694-5b5c-40fd-be92-4f90483bc654%40googlegroups.com.

Reply via email to