Open kookma opened 1 year ago
You may need also to revise the Test the filter
in tiddlers tagged qith $:/tags/EC/AutoComplete/Trigger
I assume you have used a template.
Good idea, I'll make sure to make it use transclude!
I am not too fond of the "use a filter to generate wikitext" possible solution here, at some point in the nearish future I'll be adding new functionalities and one of the changes will be ability to chose between rendering via a transclude or via a filter... Or just make it to be a template and figure out how to make it backwards compatible.
Great to know you will add new functionality!
Just to be a clear here:
[all[tiddlers+shadows]tag[$:/tags/Filter]!is[draft]search:title<query>]
see the complete example above (in https://talk.tiddlywiki.org/t/auto-complete-plugin-1-0-14-complete-tiddlers-fields-and-your-dreams/5281/66).
filter:
to trigger autocomplete with Advanced Search Filters you will see an item like Tiddlers in storyRiver excluding, <$text text="$:/AdvancedSearch"/>
that means the current code in https://evidentlycube.github.io/TW5-PluginShowcase/#%24%3A%2Fplugins%2FEvidentlyCube%2FAutoComplete%2Fwindow will not wikify the field (here description) and you see such labels.If you use $transclude
this issue will resolved.
Q1. Is this solution is backward compatible? yes Q2 Is there any side effect? Yes, transclude may create links from CamelCase words in label Q2.1. What is the solution for this side effect? Disable camelcase link locally
Using transclude also allow you to use fields for label where they have wikitext. This is important because when you work with Core or other plugins, you may encounter such situations.
By the way, this is only a suggestion, and the current release (1.0.15) is very powerful and I myself can live with current release. Take any part you find useful!
Going from memory, I wanted to respond to you a month ago but got distracted and forgot
The reason I don't want to implement this change is because doing it this way would make it problematic to use characters [
and ]
in the template, as in some (many?) cases it would just output filter error. Which is why I want a solution without such traps!
I did not understand what is problematic. The transclude allows you to be able to use wikitext. Thank you anyway, I can live with current configuration, so feel free to close this issue!
Reinvestigated the issue and here is the problem I was talking about:
Essentially these two things:
subfilter
then for the wikitext with spaces to even be returned in full the whole thing needs to be wrapped in double square brackets, which makes it impossible to use them anywhere inside.But I am now trying to understand why I chose this... weird way of doing this, instead of just, I dunno, transcluding a template or something. Once I get down to working on 2.0 I'll probably have to make it backwards incompatible to fix the weird decisions I made here 🤔
Essentially these two things:
- Because I use
subfilter
Yes, that is right. In other words the problem is not with $text or $transclude here! The problem is with filter transclusion you use. {{{ [subfilter<someinput>] }}}
, here someinput
shall be a filter expression (in doc it says a selection of titles) but your test 3 and test 4 above are not!
What I understand here is you are going to show a label in drop down menu which may be created dynamically. So it is just a label and no matter how you create it! By the way I did not go through your code to see what other uses the display-filter has.
Once I get down to working on 2.0
Good news! looking forward it.
In https://evidentlycube.github.io/TW5-PluginShowcase/#%24%3A%2Fplugins%2FEvidentlyCube%2FAutoComplete%2Fwindow it shows the list of items using $text see the code:
This can replace the
$text
with$transclude
as below to be able to handle Text ReferencesAs an example, see https://talk.tiddlywiki.org/t/auto-complete-plugin-1-0-14-complete-tiddlers-fields-and-your-dreams/5281/66 and the filter I have used for Display filter, still the
Tiddlers in storyRiver excluding, <$text text="$:/AdvancedSearch"/>
does not work (see description of https://tiddlywiki.com/#%24%3A%2Fcore%2FFilters%2FStoryList)