Closed Spangenhelm closed 11 months ago
Create your own edit template and use it. -done imo no need to modify the core.
:+1:
I think it's quite reasonably to default to textarea instead of a basic input. What reason would there be not to? (Having to figure out the css to make it initially look as if an input would not be a reason.)
Another related discussion wishing to use fields for SQL statements: https://groups.google.com/forum/?fromgroups=#!topic/tiddlywiki/kqK5hsDvHuw
@pmario
imo no need to modify the core.
Assuming it is possible to set the default size to be as small as it is currently, I can only see advantages with this proposal. Are there any disadvantages?
There is also an "educational" aspect in this; it took me quite some time before I understood that all those elements in the edittemplate are fields - and that this is what a tiddler "is".
@pmario i was not thinking of it only for myself: i'm surely not the only one who needs this and i don't see any good reason to not do it. -done
Also, after all, the body itself of the tiddler is nothing but a field like any other except that this one is a textarea !
There are a couple of reasons not to change the defaults such that all fields are displayed with a textarea:
.tid
file format can only cope with newlines in the text field). It can be fixed by switching to JSON tiddlers as required.In the meantime, I believe that the best solution is as @pmario suggests:
<$edit-text field="myfield" tag="textarea"/>
$:/config/EditTemplateFields/Visibility/myfield
and setting it's text to hide
Maybe we can have a new file extension for tiddlers- .jtid and serialize to json.
Hi @buggyj right now we use .json
for json files containing tiddlers, which is arguably inconsistent with tiddlywiki.files
, plugin.info
and tiddlywiki.info
.
Exporting tiddlers from within "advanced filters" creates tiddlers.json
. So we could use this format
In the meantime, I believe that the best solution is as @pmario suggests
...with the restriction that it would break the tiddler under node.js, so it's only available for standalone TiddlyWiki. Correct?
...with the restriction that it would break the tiddler under node.js, so it's only available for standalone TiddlyWiki. Correct?
Yes, that's right.
textareas take up more vertical space
This is not correct. For example;
<div style="line-height:80%"><textarea rows="1" cols="30"></textarea></div>
where the most important bit is rows="1"
@twMat but if we make a textarea that's a single row then I'd say we've lost the advantages of using a textarea. My experience is that users will not realise that such a textarea can hold more than one line of text.
@Jermolene Hm, at least in FF and Chrome there's a small "expand textbox" indicator. I would think most tw users are familiar with this indicator. But, regardless, it would at least allow for multiple lines which is not possible currently.
I think textareas that scroll so that you can't see all of the content at once are deeply confusing for ordinary users.
Anyhow, we could add a hidden configuration option for specifying whether input or textarea should be used for the field editors. Might make a good first pull request for someone! :)
I agree with the point that the user must clearly see there is more when there is more. Maybe I can find some method for this... and then someone can proudly make his second pull request as he very proudly actually made one a few versions back. I can't remember what it was but let's just say I didn't exactly revolutionize anything, hehe ;-)
I think if inputs were textareas, the documentation would clearly state it and so the first time you used it, there is nothing confusing about that anymore. What would perhaps be desired at that point was an ability to define the editor size for a given field-name, i.e. configuration-options specifying such options and, perhaps, in some distant future, maybe, also validation rules, etc...
I think if inputs were textareas, the documentation would clearly state it and so the first time you used it, there is nothing confusing about that anymore
I'm afraid that people don't read the docs. Look at how many beginner questions get asked on the groups despite being in the docs. I'm not complaining about it; it's human nature. It's up to us to make the app as easy for people to learn as possible.
What would perhaps be desired at that point was an ability to define the editor size for a given field-name, i.e. configuration-options specifying such options and, perhaps, in some distant future, maybe, also validation rules, etc...
All of that is possible right now using the technique I outlined above.
Revisiting this after fellow David requested this feature elsewhere.
@Jermolene , wrote:
fields containing newlines don't get saved properly under Node.js (the reason is that the .tid file format can only cope with newlines in the text field). It can be fixed by switching to JSON tiddlers as required.
Does the new JSON storing of tiddlers change this? Restricting custom fields to single lines clearly interferes with usability.
As for a textarea not showing all its content... can't it just auto expand? (example method).
Does the new JSON storing of tiddlers change this?
No. That change is only relevant to saving in single file TW.
@Jermolene -- IMO can be closed.
Thank you @pmario
Hi everybody, i don't know if this has been discussed before but when editing a tiddler i think this:
should be textareas instead (to allow multiline edition, obviously with a better look this is just for the example):
and of course so does this (to allow editing the field easily after its creation):
In my example i would like to add my recipes to my tw, using a template to display the differents fields (picture of the dish, ingredients and instructions) in a certain way, like this i can easily modify the layout of all my receipes at once without needing to dig into each tiddler individually.
Final example (only possible if the fields are textareas instead of regular inputs AFAIK):
Ps: for those interested in such modifications i have only edited this tiddler:
$:/core/ui/EditTemplate/fields
I have added the
tag
attribute to this line:<$edit-text tiddler=<<currentTiddler>> tag="textarea" field=<<currentField>> placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}}/>
and changed the
tag
attribute of this line:<$edit-text tiddler="$:/temp/newfieldvalue" tag="textarea" default="" placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}} class="tc-edit-texteditor"/>
Thank you