Ok, I'll explain: The macro *doesn't *get called first.
first the currentMonth and currentYear variables are defined. Then the filter [all[tiddlers]!has[draft.of]!sort[created]get[created]removeprefix<currentYear>removeprefix<currentMonth>limit[3] does: 1: all tiddlers not currently open 2: !sort[created] ... sort by creation date but in reverse order - so the last created are on top of the list. Now the filter shows the creation dates of the tiddlers, not the names. The creation dates have the form: 20171205<hour><minute><seconds><nanoseconds?> 3: removeprefix<currentYear> ... removes the prefix "2017" from the creation dates. if the prefix is not 2017 the tiddler doesn't pass the filter. removeprefix<currentMonth> then removes the prefix "12" . Every tiddler that doesn't have "12" as prefix at that point doesn't pass. then limi[3] chooses the last three. 4. now you have the last three creation dates but without 201712 at the beginning. Just <hour><minute><seconds><nanoseconds> 5. <<getTiddlerTitle>> now calls the macro that is defined on top (macros have to be defined on top of the tiddler). 6. the filter [all[tiddlers]field:created[$(currentYear)$$(currentMonth)$$(currentTiddler)$]] now filters all tiddlers with creation date $(currentYear)$$(currentMonth)$$(currentTiddler)$ ... currentYear=2017 currentMonth=12 currentTiddler=the filter result from the removeprefix-filter. that is just the creation date without year and month. This filter makes a puzzle. Am Dienstag, 5. Dezember 2017 20:36:15 UTC+1 schrieb Lost Admin: > > I understand some of what is going on there. You define a macro that > prints the titles of all tiddlers with a creation date that matches 3 > variables (currentYear, currentMonths, and currentTiddler). > > Then you define currentYear and currentMonth to be (as the name suggests) > the current year and current month. > > The last filter loses me bit. It starts out building a list of all non > draft (not being edited) tiddlers, all[tiddlers]!has[ > draft.of] > > Then, I think it sorts by the created field (so I get most recent at the > top of the list). The removeprefix loses me. > The limit[3], I understand. That says only give the first three results. > > I'm not sure how this works for notices that went up on say the 30th of > the previous month when it is the 1st. Those would be less than a month old > but aren't in the current month. > > > > > On Tuesday, December 5, 2017 at 12:17:02 PM UTC-5, BurningTreeC wrote: >> >> \define getTiddlerTitle() >> <$list >> filter="[all[tiddlers]field:created[$(currentYear)$$(currentMonth)$$(currentTiddler)$]]"> >> >> {{!!title}} >> >> </$list> >> \end >> >> <$vars currentMonth=<<now MM>> currentYear=<<now YYYY>>> >> >> <$list >> filter="[all[tiddlers]!has[draft.of]!sort[created]get[created]removeprefix<currentYear>removeprefix<currentMonth>limit[3]]"> >> <<getTiddlerTitle>> >> </$list> >> >> </$vars> >> >> Am Montag, 4. Dezember 2017 18:00:28 UTC+1 schrieb Lost Admin: >>> >>> Hi all, >>> >>> I started using TiddlyWiki as a tool to quickly make a small website. I >>> would like to make an announcements/news section. I figured using the >>> Journal tiddler technique would make a good way to generate a news list. It >>> sorts by date and I can easily use the table-of-contents macro to generate >>> a page listing all the news tiddlers. >>> >>> I would also like to have a subset of the most recent news show up on >>> the default tiddler (transcluding them). I can't figure out how to make a >>> filter to generate the list of tiddlers to transclude. Is there an easy way >>> to do this? I'm thinking something like: >>> >>> All journal tiddlers that were created in the last month. Possibly >>> further filtered by only displaying the most recent 3 in that list if there >>> are more than 3 entries in that list. >>> >> -- 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. 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/2d61603b-60b2-4aaf-9dae-ec237a8f5f73%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.