Hi Eric,

The modification in $:/core/ui/ViewTemplate still seems to cause a navigation bug. I tested a bit more on tiddlywiki.com: apparently it does not appear all the time when opening a (previously closed) tiddler, but it's always visible (to the extent of my tests) if you click on a tiddler title from the "open" tab (i.e. when the tiddler was already open): in this case the browser doesn't navigate at all to the tiddler.

Also your explanations helped me understand how CSS style is applied in TW, and with that understanding I now think my original idea isn't so good after all: first I'm a bit reluctant to modify ViewTemplate for that, and as discussed in a recent thread it's not very good practice to have small pieces of CSS scattered everywhere. So I'll just leave it at that for the moment, maybe I'll find a better idea later.

Thank you for your help!

Erwan


On 04/01/16 00:49, Eric Shulman wrote:
On Sunday, January 3, 2016 at 9:27:10 AM UTC-8, Erwan wrote:


    Thank you for your answer. I see now why this is tricky...
    Unfortunately I have two problems with your solution:

    - As far as I understand, I still need to define my tiddler custom
    classes in a stylesheet tiddler, where I cannot use the
    tiddler-specific color, is that correct?


As a general principle, you should define CSS rules in a stylesheet, and then enter the CSS classname(s) into the custom "class" field in the desired filter.

If you want to apply custom styles *without defining classnames*, then this ViewTemplate is what you want:
|
\define frame-classes()
tc-tiddler-frame tc-tiddler-view-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$ $(tiddlerTagClasses)$
\end
<$set name="storyTiddler"value=<<currentTiddler>>><$set name="tiddlerInfoState"value=<<qualify "$:/state/popup/tiddler-info">>><$tiddler tiddler=<<currentTiddler>>> <div class=<<frame-classes>>style={{!!styles}}><$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]"variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
</div>
</$tiddler></$set></$set>
|

Note how this is very similar to using a custom class, but the syntax is even simpler. Just add "style={{!!styles}}" to the attributes of the tiddler frame. Then create a custom "styles" field in a tiddler and enter your CSS attribute definitions there.

    - when I tested this solution I found that modifying
    $:/core/ui/ViewTemplate apparently caused a bug in the navigation:
    when clicking on a link from the "open" or "recent" tab, the
    browser doesn't take me to the tiddler as it should. I tested with
    Firefox and Chrome on a TW version 5.1.8 (does that matter?).


I tested this directly on http://tiddlywiki.com, and didn't see the problem you describe. Perhaps you broke something during editing?

HTH,

enjoy,
-e

--
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] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>.
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/1ec6f527-fb2b-497b-bbea-538d8722cc8b%40googlegroups.com <https://groups.google.com/d/msgid/tiddlywiki/1ec6f527-fb2b-497b-bbea-538d8722cc8b%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
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 post to this group, send email to [email protected].
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/568C6038.6000008%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to