Skip to content
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

feat: allow tags have its ViewTemplate tag and cascade #8462

Merged
merged 4 commits into from
Aug 1, 2024

Conversation

linonetwo
Copy link
Contributor

@linonetwo linonetwo commented Jul 31, 2024

Title and subtitle and body all have their ViewTemplate tag and cascade, now it's tag's turn.

I will need this to build https://saqimtiaz.github.io/sq-tw/sandbox.html#%24%3A%2Fcore%2Fui%2FViewTemplate%2Ftags that is not shadowing anything.

@pmario @saqimtiaz

@linonetwo linonetwo marked this pull request as ready for review July 31, 2024 18:13
Copy link

Confirmed: linonetwo has already signed the Contributor License Agreement (see contributing.md)

@linonetwo
Copy link
Contributor Author

linonetwo commented Jul 31, 2024

Example usage tiddlers.json

tiddlywiki.zip

图片

linonetwo added a commit to tiddly-gittly/title-caption that referenced this pull request Jul 31, 2024
@Jermolene
Copy link
Member

Thanks @linonetwo I think that the "subtitle" segment is now the only substantive view template segment that does not have a cascade. I think it would be worth giving it a cascade too, in this same PR.

We also need to add the new cascades to the control panel.

@linonetwo
Copy link
Contributor Author

图片

@Jermolene Updated, with some i18n

@Jermolene
Copy link
Member

Thanks @linonetwo

@Jermolene Jermolene merged commit 57d3e8e into TiddlyWiki:master Aug 1, 2024
3 checks passed
@kookma
Copy link
Contributor

kookma commented Aug 1, 2024

@linonetwo
I highly recommend to follow the same philosophy among Cascades.

So, I propose to add the default template for View Template Tags.

For example, see View Templates Fields, it is like belo:

image

BUT for View Template Tags, it is empty:

image

  • In other words, the current Tags shall be displayed through a default template
  • Users can utilize cascades by employing list-before fields to override the default template.

@linonetwo
Copy link
Contributor Author

@kookma I copied the code from $:/core/ui/ViewTemplate/body

@Jermolene
Should I delete the :and[!is[blank]else[$:/core/ui/ViewTemplate/body/default]] fallback from $:/core/ui/ViewTemplate/body too? Or is this a defensive programming and is left intended?

@linonetwo
Copy link
Contributor Author

Updated in #8470

@Jermolene
Copy link
Member

Thanks @kookma – I think it is important to match the existing cascades, which means shipping an explicit cascade entry rather than relying on the fallback.

@Jermolene Should I delete the :and[!is[blank]else[$:/core/ui/ViewTemplate/body/default]] fallback from $:/core/ui/ViewTemplate/body too? Or is this a defensive programming and is left intended?

That's correct.

tsukasa-au pushed a commit to tsukasa-au/TiddlyWiki5 that referenced this pull request Aug 3, 2024
* feat: allow tags have its ViewTemplate tag and cascade

* feat: quick addition of subtitle cascade

* docs: tag subtitle cascade control panel

* Update ControlPanel.multids
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants