What you want to do is change how the tiddler presents its content in view 
mode. But you don't want every tiddler to change how it appears.

Typically in this situation, you use a (real) template. Or actually, you 
modify the view template. To indicate that you want this tiddler treated 
differently, you typically do something like tag it with a special manner. 
Let's say you tag all quotes with "Quote". Although, if you never use 
"attribution" anywhere else, you could use the existence of that field. But 
for the moment, let's go with tag Quote.

Back up your TW, just in case. You might want to try this on TiddlyWiki.com 
just to see how the flow goes.

Create your tiddler with populated field "attribution". Put the text of the 
quote in the text box, because it's big and easy to edit. ;-) Put a tag 
"Quote" on the tiddler. Save it.

Edit the following tiddler (I'm assuming that you have a recent edition of 
TW -- I'm doing this based on v 5.1.19) :  

$:/core/ui/ViewTemplate/body

Paste in the following contents and save the tiddler:


<$list filter="[all[current]!tag[Quote]]">
<$reveal tag="div" class="tc-tiddler-body" type="nomatch" stateTitle=<
<folded-state>> text="hide" retain="yes" animate="yes">

<$list filter="[all[current]!has[plugin-type]!field:hide-body[yes]]">

<$transclude>

<$transclude tiddler="$:/language/MissingTiddler/Hint"/>

</$transclude>

</$list>

</$reveal>
</$list>
<$list filter="[tag[Quote]]">
<div style="background-color:black; color:white; padding:5px"><div align=
left style="font-size: 200%">“</div><div style="margin:5px"><$view 
field="text"/></div><div align=right style="font-size: 200%">”</div><div 
style="font-size: 150%">-<$view field="attribution"/></div></div>
</$list>

Your tiddler should now appear formatted with text and attribution.

Note that what this does is wrap a <$list> structure around the original 
contents of the tiddler and displays them when the tag is not "Quote". Then 
it adds a 2nd <$list> to display your template text when the tag is "Quote" 
. So the lower part is the part you want to edit if you want to tweak your 
design. If you're using a recent version of TW, then the text should work 
out of the box.

Now any tiddler you tag with "Quote" will have it's text and attribution 
formatted per your template text.

HTH
-- Mark


On Saturday, March 16, 2019 at 7:49:54 PM UTC-7, Elijah wrote:
>
> Because then I can't get that tiddler too to display the formatted quote. 
> At least, that is how it is currently. Right now, the tiddler with the 
> quote, and attribution fields has the {{tiddler||template}} in the main 
> text field.
>
> I'll give you a "real" example to help explain.
>
> This is the template:
>
> <div style="background-color:black; color:white; padding:5px"><div align=
> left style="font-size: 200%">“</div><div style="margin:5px"><$view 
> field="quote"/></div><div align=right style="font-size: 200%">”</div><div 
> style="font-size: 150%">-<$view field="attribution"/></div></div>
>
> It's title is "$:/eab/block-quote".
>
> I have a tiddler literally called "untitled note" (untitled note is the 
> default title for new tiddlers in my Tiddlywiki, and this one just happens 
> to be the first note I added to the Tiddlywiki), it has the following 
> contents:
>
> text field:
>
> {{untitled note||$:/eab/block-quote}}
>
> "quote" field:
>
> Empty your mind, be formless. Shapeless, like water. If you put water into 
> a cup, it becomes the cup. You put water into a bottle and it becomes the 
> bottle. You put it in a teapot it becomes the teapot. Now, water can flow 
> or it can crash. Be water my friend.
>
> And "attribution" field:
>
> Bruce Lee
>
> And so the tiddler "untitled note" itself displays (without the CSS, 
> approximately):
> “
> Empty your mind, be formless. Shapeless, like water. If you put water into 
> a cup, it becomes the cup. You put water into a bottle and it becomes the 
> bottle. You put it in a teapot it becomes the teapot. Now, water can flow 
> or it can crash. Be water my friend.
>                                                                           
>                                                   ”
> -Bruce Lee
>
> Which is exactly what I want to display. What I want though is to not have 
> to use the "quote", and "attribution" fields at all, because of the above 
> mentioned "issues", especially that which is that I can't have 
> multi-paragraph quotes with this current setup. Maybe this is the best way 
> to do it though, in which case I'll just rework the the template to accept 
> an arbitrary number of fields, one for each paragraph of a quote, and then 
> display them accordingly, which now that I'm thinking about it, may not be 
> that difficult
>

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/9085c4b5-9d8b-488e-8b03-9456b7ed265f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to