How to create a sidebar, which shows back-linked lists?

Recap: See screen shot further up this thread.

Hi Arunnbabu81, Sorry for the delay in replying. I have been trying to find the original forum posting ( it was before this current forum ). I think the best thing I can do is send you the code as it is now. I am sure experts on the forum will spot things that should be improved - the current situation is a combination of original help supplied by others and my own additions.

As far as I can remember you only need to create a tiddler as specified and you will have the functionality with the exception that if you want the random feature, blink feature or star rating feature then you will need two short plugins written by tobibeer and also the Blink back links plugin. Be prepared to either remove the associated buttons ( Random, Blink↑, Blink↓, ★↑ and ★↓ ) or ensure that you have these plugins installed.

You might want to carefully delete some parts to remove functionality you do not want.

  • The title for my Tiddler is AT - this will appear as the title of a tab called AT in the sidebar - you would give your tiddler a title according to your preferences.
  • I have buttons to show tiddlers ranked by number of backlinks (Blink) and also by star rating - I am using the rating plugin by tobibeer
  • I have a random button to show N random tiddlers - you would need the random plugin by tobibeer to make this work.
  • The example includes my way of filtering out tiddlers I do not ordinarily wish to see by assigning them the tag “z hidden” - I have to explicitly click on the tag pill ‘z hidden’ to see these - it is probably fine to leave this in place and simply choose to use the same system or simply choose not to use a tag “z hidden”.
  • In most cases Journal entries are not displayed unless I specifically click on the “Journal” button.
  • The selector labelled “sort by” ( created or modified ) does not change the story river until you perform an action that will populate the story river, so as an example you might select “created” and then click on say “All tiddlers” so see tiddlers sorted by date of creation. I think a nice enhancement here would be that the date that is actually displayed in the tiddler would reflect which setting had been chosen.

When you have created a tiddler to hold the following content you will need to assign it the tag

$:/tags/SideBar

In addition I have a field called

‘sorttype’ with value ‘modified’

I cannot see where this field (sorttype) is used in the code, it is perhaps a relic of an experiment or earlier version but I suggest at least to begin with you also add this field to your version - you can always delete it later - its simply one field in this single tiddler.

I hope I have not forgotten anything - please let me know if not although I am sure there are much more capable people on this forum who will also help.

\define sub() [backlinks[]count[]]

<$vars limit={{{ [[$:/state/limit]is[tiddler]then{$:/state/limit}else[10]] }}} stype={{{ [[$:/state/stype]is[tiddler]then{$:/state/stype}else['created']] }}}>

<label>sort by</label>
<$select tiddler="$:/state/stype" default='created'>
<option value='created'>created</option>
<option value='modified'>modified</option>
</$select>

<$range tiddler="$:/state/limit" min="10" max="400" default="10" increment="5"/><br>
limit: <$text text=<<limit>>/> tiddlers

<div class="tc-tags-wrapper">
<!-- Note that !sort reverses order of sorting this gives us most recent first -->
<!-- Changed All Tiddlers to sort on modified not created to give recently updated tiddlers a chance of being seen -->

<$macrocall $name="tag-pill" tag="All tiddlers" element-tag="$button" actions="""<$wikify name="filteredList" text="<$list filter='[!is[system]!tag[z hidden]!sort<stype>limit<limit>]'><$text text='[['/><$text text={{!!title}}/><$text text=']] '/></$list>"><$action-setfield $tiddler="$:/StoryList" list=<<filteredList>>/></$wikify>"""/>

<$macrocall $name="tag-pill" tag="Untagged" element-tag="$button" actions="""<$wikify name="filteredList" text="<$list filter='[!is[system]!tag[z hidden]!is[image]untagged[]!sort<stype>limit<limit>]'><$text text='[['/><$text text={{!!title}}/><$text text=']] '/></$list>"><$action-setfield $tiddler="$:/StoryList" list=<<filteredList>>/></$wikify>"""/>

<$macrocall $name="tag-pill" tag="Random" element-tag="$button" actions="""<$wikify name="filteredList" text="<$list filter='[!is[system]!tag[z hidden]random<limit>limit<limit>]'><$text text='[['/><$text text={{!!title}}/><$text text=']] '/></$list>"><$action-setfield $tiddler="$:/StoryList" list=<<filteredList>>/></$wikify>"""/>

<$macrocall $name="tag-pill" tag="Blink↑" element-tag="$button" actions="""<$wikify name="filteredList" text="<$list filter='[!is[system]!tag[z hidden]!tag[Journal]!sortsub:integer<sub>limit<limit>]'><$text text='[['/><$text text={{!!title}}/><$text text=']] '/></$list>"><$action-setfield $tiddler="$:/StoryList" list=<<filteredList>>/></$wikify>"""/>

<$macrocall $name="tag-pill" tag="Blink↓" element-tag="$button" actions="""<$wikify name="filteredList" text="<$list filter='[!is[system]!tag[z hidden]!tag[Journal]sortsub:integer<sub>limit<limit>]'><$text text='[['/><$text text={{!!title}}/><$text text=']] '/></$list>"><$action-setfield $tiddler="$:/StoryList" list=<<filteredList>>/></$wikify>"""/>

<$macrocall $name="tag-pill" tag="★↑" element-tag="$button" actions="""<$wikify name="filteredList" text="<$list filter='[!is[system]!tag[z hidden]has[rating]!sort[rating]limit<limit>]'><$text text='[['/><$text text={{!!title}}/><$text text=']] '/></$list>"><$action-setfield $tiddler="$:/StoryList" list=<<filteredList>>/></$wikify>"""/>

<$macrocall $name="tag-pill" tag="★↓" element-tag="$button" actions="""<$wikify name="filteredList" text="<$list filter='[!is[system]!tag[z hidden]has[rating]sort[rating]limit<limit>]'><$text text='[['/><$text text={{!!title}}/><$text text=']] '/></$list>"><$action-setfield $tiddler="$:/StoryList" list=<<filteredList>>/></$wikify>"""/>

<$macrocall $name="tag-pill" tag="Journal" element-tag="$button" actions="""<$wikify name="filteredList" text="<$list filter='[!is[system]!sort[created]tag[Journal]limit<limit>]'><$text text='[['/><$text text={{!!title}}/><$text text=']] '/></$list>"><$action-setfield $tiddler="$:/StoryList" list=<<filteredList>>/></$wikify>"""/>
<hr>

<$list filter="[tags[]!is[system]sort[title]] -Journal" variable="tagItem">
<$macrocall $name="tag-pill" tag=<<tagItem>> element-tag="$button" actions="""<$wikify name="filteredList" text="<$list filter='[!is[system]!sort[modified]tag<tagItem>limit<limit>]'><$text text='[['/><$text text={{!!title}}/><$text text=']] '/></$list>"><$action-setfield $tiddler="$:/StoryList" list=<<filteredList>>/></$wikify>"""/>
</$list>

</div>

</$vars>