Hide certain properties

What I’m trying to do

I’m trying to do a file using meta-bind plugin, but i find it very ugly when there is a lot of properties. I would like to occult some of them in the preview mode, but not all of them. This may be possible with css classes but i’m kinda dumb with them. Thank you for the help and sorry for the english;

1 Like

Have a look at the CSS in this thread: https://www.reddit.com/r/ObsidianMD/comments/17f1h9h/is_there_a_way_to_hide_just_some_properties/

(Also I think the word you were looking for is occlude, but hide might be easier :slight_smile: )

Do you know how to use CSS snippets?

2 Likes

Oh thanks, it worked. I know a little bit. Do you know some way to use this css only in some notes? I tried to do but couldn’t

There may be a way to use CSS only for some notes, but that would require more CSS and more properties. I can’t help you with that, sorry. Maybe someone else knows how to do that.

Ok i will search for that, but thank you for the help

Given this frontmatter:

---
toBeHidden: some value
cssclasses:
  - forThisNote
---

You could this CSS to hide the first property:

.forThisNote .metadata-property[data-property-key="toBeHidden"] {
 display: none;
}

And if you wanted in addition to hide myGloballyHiddenProperty you could use:

.metadata-property[data-property-key="myGloballyHiddenProperty"],
.forThisNote .metadata-property[data-property-key="toBeHidden"] {
 display: none;
}

And from there on you could just keep stacking up new globally or locally hidden properties. Hopefully you’re now able to see the pattern and can adapt to hide whichever property you want. :smiley:

3 Likes

Oh this worked perfectly. I had done this way but i think yours work better. Thank you so much.

.x{
[data-property-key="1"] {
  display: none;
} [data-property-key="2"] {
  display: none;
}
}

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.