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

[IDEA] Please enhance the Lookup operator to also be able to return a fieldname/index value #6120

Closed
AnthonyMuscio opened this issue Oct 15, 2021 · 2 comments

Comments

@AnthonyMuscio
Copy link
Contributor

Is your feature request related to a problem? Please describe.

  • The lookup is the only operator in tiddlywiki that can transclude the result. However it is also almost the only transclusion related feature in tiddlywiki that does not allow us to specifiy a fieldname or index name.

  • With the increased value of using the "filtered transclusions" there would be added value in being able to lookup field and index values with or without a tiddler prefix applied first.

Describe the solution you'd like

  • Enhance the Lookup operator to include parameters to also be able to return a fieldname/index value
  • Ideal allow lookup to find a field or index in a single tiddlername without a prefix. eg: [[tiddlername]lookup[],<index>]
  • Thus lookup operator clearly illustrates retrieving information from tiddlers, tiddler fields and data tiddlers.
  • For example; The addition of a second prefix eg lookup:default:text[prefix] to maintain backward compatibility text will be the default, field and index new values. In the case of field or index an additional parameter will be used lookup:default:index[prefix],[indexname] and also allow no prefix such as lookup:field[],<fieldname> which would simply look up the fieldname in the current title and transclude it.

Describe alternatives you've considered

Other filter operators can achieve a similar result such as [tiddlername]addprefix[prefix]get[fieldname]] how ever these are also used for obtaining intermediate results such as [tiddlername]addprefix[prefix]get[fieldname]match[yes]] extending the lookup operator would be easier and make clearer what a filter containing this operator is doing.

Additional context

  • Almost all other transclusion widgets also permit the transclusion of the values of fields and indexes. Without this change the lookup operator remains another exception
  • New users may find it easier to revert to the lookup operator before they fully come to terms with the wider filter technology.
  • It would be easier to explain, self document and write filters that can use a simplified "lookup request".
  • It took me ages to understand how to get the contents in data tiddlers when I started with TW5, this would have helped me a lot.
@saqimtiaz
Copy link
Member

Please clarify how this is differs from #5742. If it is a duplicate or very similar, closing this and commenting on the PR instead is far more likely to yield favourable results.

@AnthonyMuscio
Copy link
Contributor Author

I did post such a request, and somehow its gone, perhaps transmogafied onto "take two" #5742

I will reply there, and delete this!

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

No branches or pull requests

2 participants