The Latest Created Tiddlers in x Days

Do you like to have a slider on the home tiddler (or default tiddlers: means when you open TW or refresh your TW in browser) to show the latest created tiddlers (e.g. change in last seven days)?

Use Shiraz and it do it for you!

Example

  1. go to Shiraz 2.4.3 — create stylish contents in Tiddlywiki
  2. create a new tiddler, I call it Home (name it what you like)
  3. add the below TW script.
<$macrocall $name=slider 
   label="Latest Change" status=open 
    src="""

<<list-links "[all[tiddlers]!is[system]days:created[-7]!sort[created]]" type:"ol">>

"""/>
  1. save it and see the result
  2. add your new Home tiddler to default Tiddlers, so when you open your TW, you see this tiddler

NOTE: You can add this script to any tiddler like the one you use now as your home tiddler. Make sure you have installed Shiraz on you TW.

img_506_%pn

Remarks:

  • the script uses Shiraz slider macro to show the content on demand
  • the status is set to open to see the content of slider on open TW, you can set status to closed and manually open the slider on demand!
  • the text in src parameter is a list-links macro with a filter to show all tiddlers are not system tiddlers and created in last seven days! change it to what ever you like! e.g. change to modified,…
2 Likes

I have created a similar functionality with standard tiddlywiki. it does not set a limit for how old are the most recent post but for the number of posts to be displayed (from all those selected by the filter, that you could modify like that of the examples of the previous post, and you can select your filter from a dropdown list (a parameter in my case, but you could easily have it for à whole filter).

Here it is in a single standard tiddler.

<$vars modif="[get[modified]]">

!!! les {{!!max}} changes from younger to older within <tt>//{{!!beg}}//</tt>

<nav>
<label>maximum number of articles for display
<$select field=max default=10>
<$list filter="5 10 20 50 100 1000" variable=limit>
<option value=<<limit>>><<limit>></option>
</$list>
</$select>
</label>
<label>prefix for selecting tiddlers
<$select field=beg default=10>
<$list filter="$:/user/ $:/user/eva/ $:/user/eva/data/" variable=beg>
<option value=<<beg>>><<beg>></option>
</$list>
</$select>
</label>
</nav>

<ul>
<$list variable=art filter="[prefix{!!beg}sortsub:date<modif>reverse[]limit{!!max}]">
<li><$view tiddler=<<art>> field=modified format=date template="0DD-0MM-YYYY 0hh:0mm:0ss"/> : <$link to=<<art>>/> ;</li>
</$list>
</ul>
</$vars>

One benefits of using code block ``` is others can simply click on top left copy to clipboard button and quickly paste into their Tiddlywiki!

1 Like

@jypre thanks for sharing this. Could you make it a little more flexible documenting how to add prefixes or edit it. I tried “!prefix[$:/]” in an attempt to list all “non-system tiddlers”. Ideally you could edit the above code in your post to reflect this, and perhaps we (@Mohammad or you?) can then delete @EricShulman and My replies once they have being incorporated. This simplifying this “How to” thread.

6 posts were split to a new topic: About: Deleting posts from a thread

How to change the list filter to show

  • list of all
  • list of system tiddlers only (eg “$:/”)
  • list of non system tiddlers only

Thanks
Stefan

I am not the author of the code. I think you want to direct your question to Jean-Pierre (@jypre)

-e

@Sts You have to change my code too. One simple way to do it is to have a hash of your filters and have its keys as the value of the droplist. Then in the code, you’ll get the filter from the hashtable via the key given by the droplist.

in tw, an handy hashtable is a dictionary tiddler!

for instance if I want to check for json tidlers:

<ul>
<$list filter="all sys notsys" variable=phil>
   <$set name=philter select=0 filter="[[$:/user/hashtable]getindex<phil>]">
   <li>''<<phil>>'' AS <tt><<philter>></tt> GIVES {{{ [subfilter<philter>count[]] }}} tiddlers
   <ul>
     <$list variable=jsontid filter="[all[]subfilter<philter>field:type[application/json]sortan[]]">
       <li><<jsontid>></li>
     </$list>
   </ul>
   </li>
   </$set>
</$list>
</ul>

and in $:/user/hashtable dictionary the text is:

all: [all[]]
sys: [is[system]]
notsys: [!is[system]]

@jypre Thanks for feedback - but sorry, I didn’t get ist :frowning:
I’d like to have a dropdown to display tiddler

  • all
  • sys
  • non-sys

<!-- Änderungen am System auflisten -->

<$vars modif="[get[modified]]">

<span style="color: rgb(255,201,102); font-size: 1em">

<nav>
   <label>Änderungen der letzten 
      <$select field=max default=5> 
         <$list filter="5 10 20 50 100 200 500" variable=limit>
            <option value=<<limit>>><<limit>></option>
         </$list>
      </$select>
      Tiddler eingeschränkt auf 
      <$select field=beg default=10>
         <$list filter="[all[]] [is[system]]" variable=beg>
            <option value=<<beg>>><<beg>></option>
         </$list>
      </$select>
</label>
</nav>

<ul>
   <$list variable=art filter="[prefix{!!beg}sortsub:date<modif>reverse[]limit{!!max}]">
    <li>
         <span style="color: rgb(150, 204, 255);font-size: 0.75em">
            <$view tiddler =<<art>> field=modified format=date template="0DD. MMM YYYY um 0hh:0mm Uhr"/> : 
         </span>
         <span style="font-size: 0.9em">
            <$link to=<<art>>/>
         </span>
      </li>
   </$list>
</ul>

</span>

</$vars>

See my example: You have a list on top of it. Just use it to fill your drop down list, and everything else is about the same. You know how to do it and I know you know that. :slight_smile:

PS : any way to avoid those nasty picures when I set a fair smiley in text? :o) I like this one as it much like : -) but does not get translated!

@jypre: I tried to adapt the code - but no result list is shown…
What is wrong / missing?

grafik

grafik

> <$vars modif="[get[modified]]">
> 
> <span style="color: rgb(255,201,102); font-size: 1em">
> 
> <nav>
>    <label>Änderungen der letzten 
>       <$select field=max default=5> 
>          <$list filter="5 10 20 50 100 200 500" variable=limit>
>             <option value=<<limit>>><<limit>></option>
>          </$list>
>       </$select>
>       Tiddler eingeschränkt auf 
>       <$select field=beg default=10>
>          <$list filter="all sys notsys" variable=phil>
>             <option value=<<phil>>><<phil>></option>
>          </$list>
>       </$select>
> </label>
> </nav>
> 
> <ul>
> <$list filter="all sys notsys" variable=phil>
>    <$set name=philter select=0 filter="[[$:/user/hashtable]getindex<phil>]">
>    <li>''<<phil>>'' AS <tt><<philter>></tt> GIVES {{{ [subfilter<philter>count[]] }}} tiddlers
> <ul>
>   <$list variable=art filter="[all[]subfilter<philter>sortan[]]">
>     <li>
>          <span style="color: rgb(150, 204, 255);font-size: 0.75em">
>             <$view tiddler =<<art>> field=modified format=date template="0DD. MMM YYYY um 0hh:0mm Uhr"/> : 
>          </span>
>          <span style="font-size: 0.9em">
>             <$link to=<<art>>/>
>          </span>
>       </li>
>    </$list>
> </ul>

Please, how could I change this to display only the last tiddlers created that start with a certain character?

<<list-links "[all[tiddlers]!is[system]prefix[U]days:created[-365]!sort[created]]" type:"ol">>`

Something like this can replace the list-links macro in the original post. It would find all non-system tiddlers starting with U, created in last 365 days, with most recently created tiddlers listed first.

1 Like