[TW5] Show field from story tiddler within list widget

634 views
Skip to first unread message

Michael

unread,
Jan 19, 2015, 8:52:35 AM1/19/15
to tiddl...@googlegroups.com
Hi,

When I use the list-widget I can display the contents of fields from the called tiddlers, since within the list they are associated with the "currentTiddler" variable (that's how I understand it).

However, I would like to create a list that displays both, the contents of fields of the called tiddlers, but also the content of a field of the calling tiddler. I guess I need to somehow use the storyTiddler widget variable, but I do not understand how.

Thanks for your help,
Michael

Michael

unread,
Jan 19, 2015, 10:19:47 AM1/19/15
to tiddl...@googlegroups.com
After playing around a bit with my use case, I feel that I need to explain my question a bit better:

Within the list widget, I can evoke field contents using the view-widget:
<$view field="xwz"/>
This displays by default the content of field xwz of the called tiddler, since it is the currentTiddler.

I can, of course, within a list call the content of field xwz from a tiddler abc outside the list like this:
<$view tiddler="abc" field="xyz"/> or
{{abc!!xyz}}

In my use case however, since I use transcluded templates for creating the lists, the tiddler "abc" is always the calling tiddler (storyTiddler), and the field name "xyz" is specified by a dedicated field in tiddler abc.

Does this clarify my question??

Thanks,
Michael

Tobias Beer

unread,
Jan 19, 2015, 12:35:21 PM1/19/15
to tiddl...@googlegroups.com
Have a look at the ListWidget documentation...


The variable parameter is what you're after.

Best wishes, Tobias. 

francois godard

unread,
Sep 12, 2015, 8:49:39 AM9/12/15
to tiddl...@googlegroups.com
Hi everyone,

Thanks Tobias for the link, it did help
 I used this tips for my case. The syntax is 
<$list  filter="..." variable=Cat ><$view tiddler=<<Cat>> field="title"/></$list>
(I must say it took me a while)

Now I have a sublist that needs both filtering on the story tiddler and on the <<Cat>>
<$list filter="[is[current]tagging[]] +[tag[<<Cat>>]]" variable="Rec">

saddly the run +[tag[<<Cat>>]] is not understood

What would be the syntax ? 

Evolena

unread,
Sep 12, 2015, 9:05:38 AM9/12/15
to tiddl...@googlegroups.com
Le samedi 12 septembre 2015 14:49:39 UTC+2, francois godard a écrit :
Now I have a sublist that needs both filtering on the story tiddler and on the <<Cat>>
<$list filter="[is[current]tagging[]] +[tag[<<Cat>>]]" variable="Rec">

saddly the run +[tag[<<Cat>>]] is not understood

What would be the syntax ? 

 
<$list filter="[is[current]tagging[]] +[tag<Cat>]" variable="Rec">

Message has been deleted

francois godard

unread,
Sep 17, 2015, 10:25:17 AM9/17/15
to TiddlyWiki

How could I miss that ! Thanks !!

Tobias Beer

unread,
Sep 17, 2015, 11:59:03 AM9/17/15
to TiddlyWiki
Hi François,

With all the nested cross examination going on,
xlist might possibly be doing what you're after already...

http://tobibeer.github.io/tw/xlist

Best wishes,

— tb

francois godard

unread,
Sep 18, 2015, 4:27:34 PM9/18/15
to tiddl...@googlegroups.com
Hi Tobias,

Thanks !
This is a great macro; I like it. I like the fact that only the non-empty groups are listed. I feel however limited by the template. I understand that it applies only on the item and not on the group.

So a bit more on the background of what I am doing:
  • it's a recipe repository, 
  • each recipe has many tags and most tags are categorized (via tags)
    • for example you would get italian recipe , or yiddish , or french etc.. those tags who be tagged with "Origine" (I am french , so the tags are in french)
    • then those recipe would also be categorized by Catégorie (desert, main, starter)
    • and categorized by Qualité (benefits) : cheap, easy ,fast, vegan (some would argue here :-)) etc...
  • I have fields to keep the total time and the preparation time 
  • so I want to display recipe by origine, category and display their benefits
Here is the result (excuse my french ), using the vertical tabs of tiddlywiki.com and my macro


So I like the display though some categories are not used and still displayed
You xlist solve this, but I somehow lose the table , because of the category that are not formatted to be in the table


Or do you have a solution for this ?

To summarize my tries. 
  • xlist would need for me to work a lot on template / css to clean the display, but would achieve the best result (please confirm)
  • my macro does the job, but list all categories (I put my macro at the end for reference). The ugly part of the macro is that I need to repete the origin of the recipe. it is not contextual to the tiddler.
  • I could not use the format tag[<Cat>] in my filter list , somehow it is not working (I put the code after the macro, if anything obvious)

macro used :

\define CatRecetteTableVTab(Org:Alsace)

<table>
    <tr>
       <th>Recette $Org$ </th>
       <th>Temps total</th>
       <th>Préparation</th>
        <th>Qualité</th>
    </tr>
     <$list  filter="[tags[]sort[title]tag[Catégorie]]" >
        <tr><th colspan="4" align="left"><$view field="title"/> </th></tr>
        <$list filter="[is[current]tagging[]] +[tag[$Org$]]" >
        <tr>
            <td><$link to={{!!title}}><$view  field="title"/></$link></td>
            <td><$view field="temps_total"/></td>
            <td><$view  field="temps_preparation"/> </td>
            <td><$list filter="[all[current]tags[]tag[Qualité]sort[title]![Recette]]  " template="$:/core/ui/TagTemplate" /></td>
       </tr>
   </$list>
</$list>
</table>


\end

The code that failed :

<table>
    <tr>
       <th>Recette</th>
       <th>Temps total</th>
       <th>Préparation</th>
        <th>Qualité</th>
    </tr>
     <$list  filter="[tags[]sort[title]tag[Catégorie]]" variable=Cat >
        <tr><th colspan="4" align="left"><$view tiddler=<<Cat>> field="title"/> </th></tr>
        <$list filter="[is[current]tagging[]] +[tag[<Cat>]]"  variable=Rec>
        <tr>
            <td><$link to={{!!title}}><$view tiddler=<<Rec>> field="title"/></$link></td>
            <td><$view tiddler=<<Rec>> field="temps_total"/></td>
            <td><$view tiddler=<<Rec>>  field="temps_preparation"/> </td>
            <td><$list filter="[all[current]tags[]tag[Qualité]sort[title]![Recette]]  " template="$:/core/ui/TagTemplate" /></td>
       </tr>
   </$list>
</$list>
</table>

Tobias Beer

unread,
Sep 18, 2015, 5:46:39 PM9/18/15
to TiddlyWiki
Hi François,

I like the layout of your recepe table-tabs. ;-)

Try... +[tag<Cat>] ...notice one less pair of square brackets.

Bonne chance,

— tb
Reply all
Reply to author
Forward
0 new messages