Hide title and show caption

1,229 views
Skip to first unread message

Danielo Rodríguez

unread,
Aug 28, 2016, 11:25:26 AM8/28/16
to TiddlyWiki
Hello I was wondering if it is possible to hide the title of a tiddler without modifying the core template $:/core/ui/ViewTemplate/title

I only want to hide the title text, not the buttons because what I want is to display a caption instead.

Thank and regards

Mat

unread,
Aug 28, 2016, 12:16:35 PM8/28/16
to TiddlyWiki
Yes. You can style it. My Aliases thing shows an example of what can be done. I'll be glad to help you but must first know details; 

Is it ok to use "titles as links" in the TW? This makes it possible to css-target a title and thus hide it.
Otherwise you must use the tc-tagged-method but that leaves an ugly tag... but this can also be hidden... even that single tag, still showing other tags in the tiddler.

<:-)

Odder

unread,
Aug 28, 2016, 12:59:17 PM8/28/16
to TiddlyWiki
Hello Danielo,

I hide the tiddler title with

.tc-titlebar h2 {display:none;}

The toolbar is still visible.

Danielo Rodríguez

unread,
Aug 28, 2016, 1:07:49 PM8/28/16
to TiddlyWiki


Hello,

Thank to both, but both solutions hides the title for the entire wiki. What I want is to hide it only on certain tiddlers, and I don't want to add an specific tag.
Mat, does your solution display the title if no alias exists?
Maybe I should open an specific thread on this topic: How to style a tiddler without using tags or global styles. Good title...

Thank you.

Mat

unread,
Aug 28, 2016, 3:16:55 PM8/28/16
to TiddlyWiki
Mat, does your solution display the title if no alias exists?

Yes. The solution is not perfected yet though. I think it breaks if the title contains quotes etc. And I think it also targets titles mention in the tiddler body text and changes those. Should be solvable though.

<:-)

Tobias Beer

unread,
Aug 30, 2016, 1:41:30 AM8/30/16
to TiddlyWiki
Hi Danielo,

I'm afraid, you would have to define a custom override
of the ViewTemplate for the title, which atm
appears far too overloaded with non-title stuff (toolbar),
which is why I understand you are reluctant to do that.

Best wishes,

Tobias. 

Sebastian Ovide

unread,
Oct 7, 2019, 5:48:59 PM10/7/19
to TiddlyWiki
sorry for reopening this old thread. Is still the same ? (not simple way to overwrite the title with the caption?) thanks

TonyM

unread,
Oct 8, 2019, 5:50:34 PM10/8/19
to TiddlyWiki
Sebastian,

Things have moved on in later versions of tiddlywiki. There is now a class field and css that can be conditionally applied, 
operators that allow you to use the caption otherwise the title, and possibly more.

To make such a drastic change as hide the key to a tiddler, its title, I would consider making your own view template or modifying $:/core/ui/ViewTemplate/title

I suggest you raise a new fresh topic in google groups to address your requirement, but this has being raised before.

Regards
Tony

Mark S.

unread,
Oct 8, 2019, 7:39:23 PM10/8/19
to TiddlyWiki
Are you talking everywhere, or just in the displayed tiddlers? The modifications to use a caption
instead of a title, when available, turn out to be pretty modest. Make a backup in case of complications.
Then drag and drop the attached into your TW.

Remember:

You will need to delete or disable this tiddler whenever you upgrade. It might be good to put a note about that in a tiddler and have that tiddler open whenever the TW is refreshed.

This does not change the edit template. The title is key to everything, so actually swapping the function of the two would be very hard.
You could make a change to the edit template, that would make it easier to edit the caption field. One step at a time ...

Good luck!
$__core_ui_ViewTemplate_title.json

Xavier Cazin

unread,
Oct 9, 2019, 1:18:50 PM10/9/19
to tiddl...@googlegroups.com
Hi Danielo,

I'm not sure that we fully understand your constraints about not using tags nor global styles. I was about to suggest the use of attribute selectors (https://tiddlywiki.com/#Custom%20styles%20by%20data-tiddler-title) Could you elaborate on why you couldn't use one of the following constructs:

[data-tags*="example-test"] .tc-titlebar h2 {
  display:none;
}

or
[data-tiddler-title*="a sure match"] .tc-titlebar h2 {
  display:none;
}
Cheers,
-- Xavier Cazin


--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@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/2a74806d-2e86-477e-af2c-5cce74d82793%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Xavier Cazin

unread,
Oct 9, 2019, 2:00:33 PM10/9/19
to tiddl...@googlegroups.com
Sorry everyone. Got caught by the reopening of the thread after 3 years :-) 
-- Xavier

Sebastian Ovide

unread,
Oct 10, 2019, 4:21:01 AM10/10/19
to TiddlyWiki
thanks Tony and Mark

I was thinking about something without the need to overwrite the default template: otherwise I would loos the updates as Mark suggested... (more manual overhead). 

I'll see if I can find the thread that Tony is talking about..

damscal

unread,
May 22, 2021, 7:55:19 AM5/22/21
to TiddlyWiki
@Mat

Using your alias view template I had problems trying to make it work when using a macro in the alias field

I use the following macros to dynamically set the value of the alias field as the first element of the 'aliases' field:

\define getNth(tiddler-title:"" field-name:"list" index:"1" )
<$list filter="[list[$tiddler-title$!!$field-name$]nth[$index$]]">
<$view field="title"/>
</$list>
\end

\define getAlias()
<<getNth tiddler-title:"" field-name:"aliases" index:"1">>
\end

as a value of the alias field I use <<getAlias>>
as a value of the aliases field I set a list of titles such as  [[alias 1]] [[alias 2]] AnotherAlias

the macros work when called in wikitext, but when used with your solutions the title is not displayed

Dam

damscal

unread,
May 22, 2021, 3:53:25 PM5/22/21
to TiddlyWiki
It turned out my macro was including newline characters in the output
changing it to

\define getNth(tiddler-title:"" field-name:"list" index:"1" )
<$list filter="[list[$tiddler-title$!!$field-name$]nth[$index$]]"><$view field="title"/></$list>
\end

solved the issue
Reply all
Reply to author
Forward
0 new messages