How to have a dropdown list in tiddler field?

I want to add a field to my tiddlers, content-type. This field can have these values

  1. video
  2. reading material
  3. discussion prompt
  4. practice quiz
  5. quiz

So I want the field to appear as a dropdown list from which I can choose the appropriate option.

Exactly like how we have a dropdown for tiddler type.

Perhaps do as I do, and use a seperate field such as “object-type” and use the cascade mechanism or view template to display the content differently,

  • It is not advisable to use the tiddler “type” field for anything other than its intended use, it is in fact a mime type. Of course you could study the use of additional mime types.
  • I see MP4 is there already but the remaining tiddler types look more like they will be wikitext with different content so type can be empty or TiddlyWiki5
  • otherwise search for “type field” or “mime types” here or in google groups see see previous discussions.

@TW_Tones I want to add a new field. I am definitely not planning on reusing the “type” field.

But what I am looking for is a dropdown similar to “type” field dropdown.

1 Like

These two might be of interest to you

http://fieldvalueselector.tiddlyspot.com/

https://tiddlywiki.com/#Customizing%20EditTemplate%20field%20rendering and the demo

6 Likes

The first link is exactly what I was looking for!

The only thing I think I’m going to look into changing is possibly moving the dropdown arrow to be between the text field and the button, just because having the arrow below the text area is a little bit unappealing.

ATM I can’t figure out how to do so without editting the edittemplate tiddler, I did create a proof of concept that, while a bit jury rigged, works as intended!

@twMat is the creator of that plug in…May be he can give some suggestions.

The thingy is separately located below the other stuff because it is a an edittemplate in order to not modify any core tiddlers. I.e the arrow can be placed where you describe it but that would mean overwriting the core template named $:/core/ui/EditTemplate/fields This might never become a problem but if a future update of TW has an update to that tiddler then the update modifications will not kick in, as you have the tiddler is overwritten.

Anyway, if you still want to insert the arrow there, this would probably work:

In $:/core/ui/EditTemplate/fields, locate the exact location where you want the button. (To do this, I throw in a lot of “aaa”, “bbb”, … etc in different places to see where they appear in viewmode, so to zoom in on the exact area). Once located, insert this macro call there:

<<new-field-value-dropdown>>

…and save that tiddler.

Now open the Fieldvalueselector tiddler and edit:

  • delete the macrocall seen close to bottom of the tiddler
  • delete the whole style block
  • change the tag from $:/tags/EditTemplate into $:/tags/Macro

That is basically it. It may be that the button is not styled correctly, I don’t know. If you need help with that then @twMat me here

https://flashsystems.github.io/FieldTemplatesDemo/#DropDown%20field%20test

i pasted the code from this tiddlywiki,it fails to show any dropdown menu for mydropdown and mydate.

my tiddlywiki version is 5.3.1

thanks in advance

@Shaheen_Merchant i have some working examples in one of my wikis …I can share them once i am back on my desktop.

1 Like

@Shaheen_Merchant
Is this what you wanted ?

https://field-dropdown-demo.tiddlyhost.com/

Edit this tiddler account-A to see the dropdown in fields - My TiddlyWiki — a non-linear personal web notebook

3 Likes

Hopefully it is, I know it absolutely is for me, this is something I’ve been needing to figure out how to do, so thank you! :grinning_face_with_smiling_eyes:

1 Like

Absolutely, I get it! This has been a puzzle I’ve been trying to solve, so thanks for shedding light on it. It’s a relief to finally grasp this.:ok_hand:

1 Like

Looking at your brilliant solution, I am wondering the purpose of the buget: shadow field and content in it ?
I created a new tiddler C tagged account-holder without this field and the dropdown works…
Is it a way for you to document or trace your modifications in your wiki ?

1 Like

This is the description: https://tiddlywiki.com/#Customizing%20EditTemplate%20field%20rendering which needs to be read carefully.

1 Like

This is the exact reason for those fields…I use filter pill macro to organise such modifications