-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For View fields, to be able to define a representation of empty values #400
Comments
Thanks for this well-written FR.
Note: There is a setting to display |
Just updated my request taking into account my previous experience with the plugin. When any of the frontmatter property values are `VIEW[{CountryCode}][text]`
`VIEW[{CountryLink}][link]` Describe the Feature you'd likeI would like the Plugin to be able to do 2 things:
%% A visual representation of a missing value %%
`VIEW[{countryCode}][text(emptyText="N/A")]`
`VIEW[{countryLink}][link(emptyText="N/A")`
%% A link to some other page, e.g., with explanations why this value is empty.%%
`VIEW[{countryLink}][link(emptyLink="[[missing country note|N/A]]")`
`IF (countryCode) `
- **Country Code**: `VIEW[{countryCode}][text]`
- **Country Info note**: `VIEW[{countryLink}][link]`
`ELSE`
- **Country Info**: Not Applicable
`ENDIF` I'm not sure MetaBind would like to develop in that direction with potentially other plugins, e.g., based on Handlebars templating language being more suitable for that, but currently, not many sensible plugins exist to choose from. With AlternativesHave a PS I have found that I can do the trick with using Here is an example page to see why the
|
|
Please fill out these Check-boxes
Is your Feature Request related to a Problem or Annoyance?
I use Templater logic when creating new documents.
For example, it might look like this:
Then in the frontmatter:
And, finally, on the page:
Now, if I use
underfined
ornull
as an empty value, the VIEW won't look as expected.For example, the next Templater template with product the following result:
Resulting markup in Editing view:
and in Reading view:
Describe the Feature you'd like
I would like the Plugin to be able to do 2 things:
This feels like a feature of a dynamic templating based on frontmatter properties, which I'm not sure MetaBind would like to step in that direction. Maybe, some other plugins, e.g., based on Handlebars templating language would better with (Currently, not many sensible plugins to choose from).
But with
VIEW
fields, MetaBind is already dealing with conditional data presentation, why not extend current capabilities?Alternatives
Currently, I return empty strings (
""
) to populate the frontmatter and eventually to be presented by MetaBindVIEW[]
, as it is less ugly than "null" or "undefined" strings.Still have to figure out if the following plugin is worth any effort to be used for this kind of tasks:
obsidian://show-plugin?id=obsidian-handlebars
Additional Context
No response
The text was updated successfully, but these errors were encountered: