Jose,

Not one to discourage experimentation, you are trying to jump in the deep 
end.

Lets try something different
Lets look at the manager first

The regular manager lets you select to filter by tag? But it has no value 
by default.

Searching through the tag manager we find the line 
<<lingo Controls/FilterByTag/Prompt>> <$select 
tiddler="$:/config/Manager/Tag" default="">

This is a select widget that stores the value of the selected tag in 
$:/config/Manager/Tag with a default of ""

If you use the tag filter then close the manager you will discover on 
reopening it remembers the last tag you filtered on. So all we need to do 
is to set that tiddler to what we want, then open the manager.

This is my custom button tiddler $:/PSaT/Button/OpenManagerHere
<$button tooltip="open Tiddler Manager for items tagged here">
<$action-setfield $tiddler="$:/config/Manager/Tag" text=<<currentTiddler>>/>
<$action-navigate $to="$:/Manager"/>
{{$:/core/images/list}}
</$button>


Then in any tiddler I can include
{{||$:/PSaT/Button/OpenManagerHere}}
Which gives a button you click to open the manager filtered by the tags here

I have then added a class for a simple icon
class="tc-btn-invisible" 
and tagged my custom button tiddler $:/tags/ViewToolbar

Now the button appears on every tiddler and clicking it will open the 
manager with the items tagging the current tiddler

However most tiddlers may not be a tag to other tiddlers, so I wrapped my 
custom button code in the following
<$list filter="[tag<currentTiddler>]" variable="null">
button code here
</$list>
Now the icon will only appear in tiddlers that are actually tagging another 
tiddler
 
In $:/core/ui/ControlPanel/Toolbars/ViewToolbar  
<http://127.0.0.1:8088/Instances/TiddlyWiki5.html#%24%3A%2Fcore%2Fui%2FControlPanel%2FToolbars%2FViewToolbar>you
 
can change its order
There is a little more effort to make this look the same as other buttons, 
just have a look at them and set some appropriate fields

I have attached the button tiddler here for your convenience.

The best way to learn is teaching
Regards
Tony


On Saturday, July 14, 2018 at 3:26:50 PM UTC+10, Jose Eduardo Mares 
Dominguez wrote:
>
> I've only been using Tiddlywiki for a couple days and I don't know how to 
> code, but I have been messing around with code for the Tiddler Manager to 
> try and create a customized version.
>
> I want to get it so that the when you create the custom manager it only 
> shows tiddlers that are tagged with the title of the current tiddler, but 
> every time I do it gives me a recursive error. Any help would be 
> appreciated!
>
> \define lingo-base() $:/language/Manager/
>
> \define list-item-content-item()
> <div class="tc-manager-list-item-content-item">
> <$vars state-title="""$:/state/popup/manager/item/$(listItem)$""">
> <$reveal state=<<state-title>> type="match" text="show" default="show" 
> tag="div">
> <$button set=<<state-title>> setTo="hide" class="tc-btn-invisible 
> tc-manager-list-item-content-item-heading">
> {{$:/core/images/down-arrow}} <$transclude tiddler=<<listItem>> 
> field="caption"/>
> </$button>
> </$reveal>
> <$reveal state=<<state-title>> type="nomatch" text="show" default="show" 
> tag="div">
> <$button set=<<state-title>> setTo="show" class="tc-btn-invisible 
> tc-manager-list-item-content-item-heading">
> {{$:/core/images/right-arrow}} <$transclude tiddler=<<listItem>> 
> field="caption"/>
> </$button>
> </$reveal>
> <$reveal state=<<state-title>> type="match" text="show" default="show" 
> tag="div" class="tc-manager-list-item-content-item-body">
> <$transclude tiddler=<<listItem>>/>
> </$reveal>
> </$vars>
> </div>
> \end
>
> <div class="tc-manager-list">
> <$list filter="[all[current]tagging[]]"/>
> <$vars transclusion=<<currentTiddler>>>
> <div style="tc-manager-list-item">
> <$button popup=<<qualify "$:/state/manager/popup">> 
> class="tc-btn-invisible tc-manager-list-item-heading" 
> selectedClass="tc-manager-list-item-heading-selected">
> <$text text=<<currentTiddler>>/>
> </$button>
> <$reveal state=<<qualify "$:/state/manager/popup">> type="nomatch" text="" 
> default="" tag="div" class="tc-manager-list-item-content tc-popup-handle">
> <div class="tc-manager-list-item-content-tiddler">
> <$list 
> filter="[all[shadows+tiddlers]tag[$:/tags/Manager/ItemMain]!has[draft.of]]" 
> variable="listItem">
> <<list-item-content-item>>
> </$list>
> </div>
> <div class="tc-manager-list-item-content-sidebar">
> <$list 
> filter="[all[shadows+tiddlers]tag[$:/tags/Manager/ItemSidebar]!has[draft.of]]"
>  
> variable="listItem">
> <<list-item-content-item>>
> </$list>
> </div>
> </$reveal>
> </div>
> </$vars>
> </div>
>
>
>

-- 
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/576b7214-bbf9-4da8-b211-d24468f79aa2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: $__PSaT_Button_OpenManagerHere.tid
Description: Binary data

Reply via email to