I believe filters can be used in css data-tags. Not done it myself. There is the class field and you can conditionaly display css between <style> html tags in the view template using filter which can depend on field values or existence.
Short answer because I am mobile.
Tony
I believe filters can be used in css data-tags. Not done it myself
There is the class field and you can conditionaly display css between <style> html tags in the view template using filter which can depend on field values or existence.
<style>css</style>
Other possibilities can be found in the Style FAQ. Especially "dynamically create a CSS". ... But this method can have a negative performance impact, if done wrong. ... It should be "a last resort" if other possibilities don't work, because it can lead to 1 CSS rule per tiddler if done wrong.
<$list filter=[all[current]has[fieldname]]">
<style>
css here
</style>
</$list>
<$list filter=[all[current]has:field[fieldname]]">
<style>
css here
</style>
</$list>
[all[current]!has:field[fieldname]]
<a href=<<qualify ##h1>> >Link to My Heading</a>
<h1 id=<<qualify #h1>> > My Heading</h1>
Also the following works to help users nest headings
<a href=<<qualify ##h1.1>> >Link to My Heading 1.1</a>
Later in tiddler
<h1 id=<<qualify #h1.1>> > My Heading h1.1</h1>
<$list filter="[is[current]tag[item]]">
<$list filter="[is[current]class[locked]]">
{{_template_tiddler-locked}}
</$list>
<$list filter="[is[current]!class[locked]]">
-- all the styling/macros for the not locked tiddler tagged "item" go here
</$list>
</$list>
[data-tags*="item"] .tc-titlebar h2 { display: none; })
<$list filter="[is[current]has[data_type]data_type[item]]">
<$list filter="[is[current]class[locked]]">
{{_template_tiddler-locked}}
</$list>
<$list filter="[is[current]!class[locked]]">
-- all the styling/macros for the not locked tiddler go here
</$list>
</$list>
[data-tags*="item"]
no longer works, understandably, because the tiddler is no longer tagged, I've replaced the tag with a field![data-tags*="item"]
and on the "class" field as both of these target the whole tiddler (including system buttons, the title etc.) Styling from within a view template only targets tiddler body and this is not enough for my use case.What I forgot to say is that the functionality I'm looking for is one that would match the power of the "class" field, in that it would be able to style the entire tiddler, not just its body.
Like using the class field, we could, say, remove a tiddler's title by using .tc-titlebar h2 { display: none; } etc.
But the class field (being a field) can only have one value. Since I need two values, what I'm missing is another (custom) field that will match the power of class. Or, ideally, the ability to add more custom fields at system level that will match the functionality of a class field.
Everything works perfectly and I've had all of this working well for months. I'm very happy with this design. BUT, as I've said above, I want to get rid of tags altogether (for performance reasons).
- Added pluggable index modules to accelerate the field Operator and the tag Operator (in tests on a wiki with 60K tiddlers, startup time is reduced by 25% with these optimisations, and refresh time is reduced by a factor of three.)
If the description doesn't work for you, I can record a short video. Just let my know!
Would YOU be in it? :-)Your voice is nice. You might look as good?
Thanks again, I consider this resolved. I'll just have to fiddle a bit more haha :)
Thanks again, I consider this resolved. I'll just have to fiddle a bit more haha :)