Scott,

You can see in marks example that lists within lists are quite simple. 
indentations are helpful to make it obviouse

Example 3 levels of nesting
<$list
   <$list
      <$list

      </$list>
   </$list>
</$list>

In this we see one list wrapping two lists, in this case one "inner list" 
list may respond to "has a field or tag value" and the other "NOT has a 
field or tag value"
<$list
   <$list filter="[is[current]has[fieldname]]"

   </$list>
   <$list filter="[is[current]*!*has[fieldname]]"

   </$list>
</$list>

So you can see there are possibly infinite variations of nesting lists. All 
you need to do is keep track of the open and close of each list.

Of course the content of any lists filter can be very sophisticated so the 
selective logic is often contained in the filter. 

A couple of other key features of using lists include


   - By default the filter will generate a list of (tiddler) titles, and 
   the content inside the list widget will step through each tiddler in that 
   set, basically changing the "current tiddler value for each item.
   - However if on a list widget you specify <$list filter="filter" 
   "variable="myvar"> inside the list widget the current tiddler title changes 
   in <<myvar>>, and the current tiddler remains the same.
   - You can write list filter that have no result, in which case you can 
   use EmptyMessage to return a value in this no result case.

Enjoy
Tony


On Monday, June 25, 2018 at 5:55:25 AM UTC+10, Scott Kingery wrote:
>
> Thanks Mark I'll see what I can do with this.
>
> On Sun, Jun 24, 2018 at 9:03 AM 'Mark S.' via TiddlyWiki <
> [email protected] <javascript:>> wrote:
>
>> This is a start. You'll need to weave back in the classes you want. I've 
>> changed some filter names.
>>
>> \define locationfilter()
>> [blurb[$(blurb)$]location[$(location)$]sort[title]]
>> \end
>> \define blurbfilter()
>> [location[$(location)$]each[blurb]get[blurb]sort[]]
>> \end
>>
>>
>> <$set name="location" value={{!!title}}>
>>
>> <$list filter=<<blurbfilter>> variable="blurb">
>>
>> <div class="tc-menu-list-item">
>> <<blurb>> 
>> </div>
>>
>> <div class="tc-menu-list-subitem">
>> <$list filter=<<locationfilter>>>
>>
>> <$transclude field="subtopic"/>
>>
>>
>> <$link to={{!!title}}><$view field="title"/></$link>
>>
>> <$transclude field="location-help"/>
>> </$list>
>> </div>
>>
>> </$list>
>> </$set>
>>
>> General advice -- give fields, filters and other objects meaningful 
>> names. This will make things a lot easier as your application gets bigger. 
>> In this case I've changed the variable passed from "MyTag" to "location" 
>> and given the filters corresponding names. If it was me, I would also 
>> change "blurb" to "vendortype" or something that designates what it does.
>>
>> HTH!
>>
>> -- Mark 
>>
>> On Saturday, June 23, 2018 at 9:58:00 PM UTC-7, Scott Kingery wrote:
>>>
>>> Here's what I want to do...
>>>
>>> I have a tiddlers that represent restaurants and stores. So those 
>>> tiddlers will be like:
>>>
>>> Title: name of restaurant or store
>>> Location is a field that indicates where the restaurant is located
>>> Blurb is a field that is some info about the place
>>>
>>> There is a subtopic field that is either Restaurant or Store.
>>>
>>> My goal is to have another tiddler that had a title of a location and 
>>> lists all the restaurants or stores in that location.
>>>
>>> I want it to group the restaurants and stores together. Like this:
>>>
>>> Restaurant
>>>    Joes Bar
>>>    Mikes Burgers
>>> Shops
>>>    Toys n More
>>>    Wizard of Books
>>>
>>>
>>>
>>> I'm almost there. I know I need a filter with in a filter but I cant get 
>>> that syntax right.
>>>
>>> Here is what I have:
>>>
>>> \define MyFilter()
>>> [location[$(MyTag)$]sort[title]]
>>> \end
>>>
>>>
>>> <$set name="MyTag" value={{!!title}}>
>>> <$list filter=<<MyFilter>>>
>>> <div class="tc-menu-list-item">
>>> <$transclude field="subtopic"/>
>>> </div>
>>> <div class="tc-menu-list-subitem">
>>> <$link to={{!!title}}><$view field="title"/></$link>
>>> <div class="tc-menu-list-subitem">
>>> <$transclude field="blurb"/>
>>> <div class="tc-menu-list-subitem">
>>> <$transclude field="location-help"/>
>>> </div></div></div></$list></$set>
>>>
>>>
>>> And that gives me more like:
>>>
>>> Restaurant
>>>    Joes Bar
>>> Restaurant
>>>    Mikes Burgers
>>> Shops
>>>    Toy n More
>>> Shops
>>>    Wizard of Books
>>>
>>>
>>>
>>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "TiddlyWiki" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/tiddlywiki/gEWSkUL-l1M/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> 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/19a58ff3-ee44-4a48-8ee3-3db7c7c70f32%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/tiddlywiki/19a58ff3-ee44-4a48-8ee3-3db7c7c70f32%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/ee5a7bf9-6aa4-4138-bfad-adc4de1e72ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to