Mark In my attempt to create the hierarchical list of books by author I only concentrated on the my-toc-selective-expandable macro that Jed provided, since that seemed like it would produce the desired outcome. Initially I ignored the other part of his post on the other macros. In trying those I am able to produce, a linear checklist of all Authors and all Books not a checklist showing Parent (author)/child (book) with checkboxes next to each child.. My programming skills are not very good. Perhaps you could show me what you did to produce your results.
Thank you for taking the time to look into my situation and responding. Charles On Sunday, February 18, 2018 at 9:46:43 PM UTC-5, Mark S. wrote: > > Are you sure you got the different pieces of macros from the 2 threads > together correctly? > > When I try it, I get a checkbox both at the parent and the child level. I > also get everything enumerated which might mean that I need a different CSS > tiddler. It looks to me like you would like Jed's code tweaked so that it > no longer shows a checkbox at the parent level. I'm thinking this might > require marking the parent tiddlers with a "Parent" tag (or maybe there is > already an "Author" tag which would be the same thing) > > -- Mark > > On Saturday, February 17, 2018 at 5:05:08 PM UTC-8, [email protected] > wrote: >> >> Jed: >> >> I came across this post while searching for a solution to my current >> situation. >> >> I have a TW5 wiki that contains my book collection. I have tiddlers for >> each author, and tiddlers for each book by that author. I have used the toc >> macro: toc-selective-expandable to create my nested listing. What I am >> wanting to do is add a checkbox to each book in my list, so that when I >> have completed reading it I can check it off, >> give it a status of "Read" and strike through the title. >> >> Your code gave me a start but since I am not a programmer I do not >> understand how to get a checkbox next to each book title. This code only >> places a checkbox next to >> the authors name. >> >> Example of what I am trying to achieve: >> >> > Douglas Preston & Lincoln Child >> [ ] The Relic >> [ ] Riptide >> >> > James Rollins >> [ ] Ice Hunt >> [ ] Excavation >> >> What I have today: >> >> [ ] > Douglas Preston & Lincoln Child >> The Relic >> Riptide >> >> [ ] > James Rollins >> Ice Hunt >> Excavation >> >> How would your code be modified to do what I want? >> >> Thank you in advance for your time. >> >> Charles >> >> On Tuesday, May 19, 2015 at 9:37:40 PM UTC-4, Jed Carty wrote: >>> >>> For the first one: >>> >>> Looking at the code I gave you now I am a bit embarrassed. The checkbox >>> state has no persistent storage, so anytime the toc is refreshed the state >>> would be reset like you are seeing. This shouldn't have that problem. It >>> may have other problems I haven't seen. Also it is only adding one line to >>> the default toc macro: >>> >>> \define >>> my-toc-linked-selective-expandable-body(tag,sort:"",itemClassFilter) >>> <$set name="toc-state" value=<<qualify >>> "$:/state/toc/$tag$-$(currentTiddler)$">>> >>> <$set name="toc-item-class" filter="""$itemClassFilter$""" >>> value="toc-item-selected" emptyValue="toc-item"> >>> <li class=<<toc-item-class>>> >>> <$checkbox tiddler="""$(currentTiddler)$""" tag='done'/> >>> <$link> >>> <$list filter="[all[current]tagging[]limit[1]]" variable="ignore" >>> emptyMessage="<$button >>> class='tc-btn-invisible'>{{$:/core/images/blank}}</$button>"> >>> <$reveal type="nomatch" state=<<toc-state>> text="open"> >>> <$button set=<<toc-state>> setTo="open" class="tc-btn-invisible"> >>> {{$:/core/images/right-arrow}} >>> </$button> >>> </$reveal> >>> <$reveal type="match" state=<<toc-state>> text="open"> >>> <$button set=<<toc-state>> setTo="close" class="tc-btn-invisible"> >>> {{$:/core/images/down-arrow}} >>> </$button> >>> </$reveal> >>> </$list> >>> <<toc-caption>> >>> </$link> >>> <$reveal type="match" state=<<toc-state>> text="open"> >>> <$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> >>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/> >>> </$reveal> >>> </li> >>> </$set> >>> </$set> >>> \end >>> >>> This will give the the tag 'done' when the box is checked. If you don't >>> want to put the tag on the tiddler itself but still have a persistent state >>> replace """$(currentTiddler)$""" with >>> <<toc-state>> >>> And you can of course change the checkbox to use a field or another tag. >>> >>> I am not sure exactly what you are asking for the second one. Do you >>> want a checklist that when each item is checked it gets tagged with the >>> current tiddler? >>> If so you could make a macro like this (this also adds the answer to the >>> third part): >>> >>> \define makeChecklist(filter) >>> <$set name='taggingTiddler' value=<<currentTiddler>>> >>> <$list filter='$filter$'> >>> <$checkbox tiddler=<<currentTiddler>> tag=<<taggingTiddler>>><$view >>> field='caption'><$view field='title'/></$view></$checkbox><br> >>> </$list> >>> </$set> >>> \end >>> >>> Put this in a tiddler, tag that tiddler with $:/tags/Macro and then in >>> any tiddler you put <<makeChecklist '[tag[something]]'>> (replace >>> [tag[something]] with the filter you want to use to make the checklist) and >>> it will create the list in that tiddler. >>> If you want to click on the caption/title and open the tiddler instead >>> of toggling the checkbox than you would replace the checkbox widget with >>> this: >>> <$checkbox tiddler=<<currentTiddler>> tag=<<taggingTiddler>>/><$link >>> to=<<currentTiddler>>><$view field='caption'><$view >>> field='title'/></$view></$link><br> >>> >>> For the third one the answer is easy enough: >>> >>> <$list filter=<<whateverfilteryouusetomakeyourlist>>> >>> <$checkbox tiddler='somestatetiddler' field=somefield >>> checked=checkedvalue unchecked=uncheckedvalue><$view field=caption><$view >>> field='title'/></$view></$checkbox> >>> </$list> >>> >>> or you can have the checkbox linked to a tag or whatever. The <$view >>> field='caption'><$view field='title'/></$view> is the important part. If >>> what you tell a view widget to display exists than anything between <$view> >>> and </$view> is ignored, but if what you tell it to display doesn't exist >>> whatever is inside the tags is displayed instead. >>> >>> Like I said, I am a bit embarrassed that I missed that problem before. >>> Sorry about that. >>> >> -- 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/2eeae0f9-80b5-42f3-be9a-9a92ba54eddd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

