How can I remove the the tiddler title only for the default tiddler ‘Inhalt’ (displayed at startup)?
Thanks
Stefan
How can I remove the the tiddler title only for the default tiddler ‘Inhalt’ (displayed at startup)?
Thanks
Stefan
I would do it by styling, i.e create a stylesheet tiddler like so
title: whateveryouwant
tags: $:/tags/Stylesheet
type: text/css
text: [data-tiddler-title="Inhalt"] .tc-title { display:none }
Here’s a more general solution making use of the new cascades. It will use a custom template for all the default tiddlers. With this template you can actually do whatever you want to the title, including hiding it.
To create a cascade rule, create a tiddler tagged $:/tags/ViewTemplateTitleFilter
, e.g.
title: $:/config/ViewTemplateTitleFilters/hide-default
tags: $:/tags/ViewTemplateTitleFilter
text: [all[current]] :intersection[[$:/DefaultTiddlers]get[text]splitregexp[\n]] +[then[$:/core/ui/ViewTemplate/title/hide]]
Unfortunately, the default tiddlers list in $:/DefaultTiddlers
is not a title list, and also I haven’t found a filter operator to check if the input title(s) are contained in a specific title list.
The filter needs to return something so that it doesn’t fall through the cascade. In this case it returns the template to use. You will need to click on the tag pill and drag-n-drop reorder the cascade filters in order for your new filter not to come after the default (catch-all) filter.
Then you need a second tiddler to define the title template:
title: $:/core/ui/ViewTemplate/title/hide
text: <h2 class="tc-title"></h2>
I left the H2
HTML node in there, just in case, but empty.
It may be a bit overkill and somewhat convoluted, but this is the way of the cascade.
Have a convoluted day
Yaisog
PS: I’m all open for a nicer filter expression.
Maybe I’m not understanding your request completely… but it sounds to me like a job for a splash screen:
@Yaisog
Thanks for your solution.
At the moment it is easier for me to use the CSS code from @twMat.
The contents of $:/DefaultTiddlers
uses filter syntax. While it is often just a simple title list, it can also contain more complex filter expressions (e.g., [prefix[something]]
).
Instead of writing
:intersection[[$:/DefaultTiddlers]get[text]splitregexp[\n]]
use
:intersection[subfilter{$:/DefaultTiddlers}]
which will process the $:/DefaultTiddlers
contents and produce a title list as output.
Add a :filter[...]
run with a contains[]
operator, like this:
:intersection[subfilter{$:/DefaultTiddlers}] :filter[[$:/config/HideTitles]contains:text<currentTiddler>]
where the text
field of $:/config/HideTitles
contains a list of tiddlers whose titles you want to hide.
I’ve tested this on https://TiddlyWiki.com, and it works. One last bit to tackle: hiding the title doesn’t hide the subtitle, so the tiddler’s modification date still appears.
enjoy,
-e
@EricShulman: Great stuff, as usual.
I forgot all about the syntax of $:/DefaultTiddlers
, though I commented on it here just recently. What probably threw me off is that on tiddlywiki.com the entries were separated by line breaks. Hence my splitregexp[]
– which wouldn’t even work in general! The operator subfilter
ist definitely the way to go here.
I was thinking about the contains
operator, too, but stumbled over the title-to-check being the parameter while the cascade provides it as the input title. Your :filter/contains combo is a really nice workaround.
Maybe there should be a “contained” operator that reverses this and checks the input titles vs. a list defined in the filter parameter? At the very least your “workaround” should be in the examples for the contains
operator (though it may not be found there easily).
Have a great day
Yaisog
Another option while you are at it is to create the tiddler $:/config/EmptyStoryMessage and put your initial content in it with no default tiddlers set.
And/Or on close all you will see this content.