When you click on a tag and see a list, and then drag an item in the list, 
where is that sort-order stored? It's stored in the "list" field of the 
tiddler with the same name as the master tag that you clicked on. So, for 
instance, if you go to TiddlyWiki.com and open the HelloThere tiddler, and 
look at the "list" field, you will see the tiddlers that reference 
"HelloThere" listed in the field. They are not in alphabetical order.

If you copy the following into a tiddler at TiddlyWiki.com, and press the 
"Sort" button, the corresponding tiddlers will be sorted:

\define alphasort() <$action-listops $tidd ler="HelloThere" $subfilter=
"+[sort[]]"/>

<$button actions=<<alphasort>>
Sort "HelloThere"
</$button>

You can make changes to this code to sort the list field of any tiddler.

The catch is, that there is no requirement that all tiddlers that are 
tagged by a tiddler are listed in its list field. This version will 
populate the field AND sort it:

\define alphasort() <$action-listops $tiddler="HelloThere" $filter=
"[tag[HelloThere]sort[]]"/>

<$button actions=<<alphasort>>>
Sort "HelloThere"
</$button>


It's left as an exercise to the student to turn the code into a generic 
macro that can be used on any tiddler ;-)

-- Mark


On Thursday, February 7, 2019 at 1:40:50 PM UTC-8, talha131 wrote:
>
> Tag macro which is shown at two places.
>
> 1. Tag manager 
> 2. Under the tiddler title
>
> It shows a list of tiddlers. How do I sort them by title? It can be done 
> manually using drag and drop. But can it be done automatically?
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ba13c49c-7867-4eda-84ad-dae450407096%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to