@saqimtiaz When I implemented this suggestion by @EricShulman to add a <<qualify>>
macro to the reveal
widget I used, the keyboard shortcut aren’t working.
This is the code I used.
Any suggestions ?
@saqimtiaz When I implemented this suggestion by @EricShulman to add a <<qualify>>
macro to the reveal
widget I used, the keyboard shortcut aren’t working.
This is the code I used.
Any suggestions ?
Anyone knows what’s going wrong here
Someone can please help?
@arunnbabu81 I think you would benifit from using some debugging techniques to break down your problem further. Place extra text in your output to show which parts are active. Perhaps use dumpvariables or varname=<<varname>>
in places to see intermediate values. Use a freebstanding qualify macro to see the title. Keep in mind qualify is sencitive to the current tiddler variable.
We are all volenteers here and whilst we all like to help the more time consuming it is to even read the question the more you ask us to do.
It will help if you have a bundle of tiddlers that if dropped on tiddlywiki.com replicate your problem then we can see the real and comprehencive code. You may find as I do when preparing such an example 50% of the time I solve it myself.
You are asking an aweful lot of the community and often, which is good but if you could do more to learn including more debug techniques and to help us help you. We will be able to help you even more.
I will put a Json file once I am back home.
I ask questions here in the forum when I am sure that I can’t solve it myself. Even though I have been using tiddlywiki for last 2 years, I am still in the beginner stage when it comes to code stuff. Not that I haven’t tried to read, it’s not easy to understand especially since I don’t have any programming knowledge. I am a working doctor and I do tiddlywiki things when I am free. I am actually proud of whatever I have done with my tiddlywiki (it’s really beautiful and functional) with my limited knowledge - mostly by asking here or in the GitHub (for the plug ins I use)
Hi @arunnbabu81 thanks for sharing the background. I’m not always fast enough to respond to your questions, but appreciate being able to see over your shoulder as you grapple with TiddlyWiki. The highest goal of the project is to let ordinary people exercise the kind of autonomous power that is usually the domain of experienced software developers.
@arunnbabu81 I understand your position. And your use of tiddlywiki is impressive. however I am making suggestions that should save you time, let us respond quicker and reduce your overall effort. I expect you could find parallels in your own field of medicine, however we often need to look at things differently when acting outside our established knowledge.
I have uploaded my test wiki into tiddlyhost.
https://arsheth.tiddlyhost.com/
I have included the relevant tiddlers in the homepage.
Press “Alt+z” to reveal and hide the sidetabs
(seen on the right side of tiddler body). The problem is that all tiddlers with reveal button show and hide the sidetabs
simultaneously when we click the reveal button or use the keyboard shortcut on any of the tiddler. To overcome this Eric suggested to use qualify macro here
But after using the qualify macro, the keyboard shortcut doesn’t work. That is my current problem.
@arunnbabu81 I am trying to reverse engineer you wiki to see where this all happens. I must admit I am unfamiliar with the horizontal layout.
I observe this reverses the value found in $:/state/SampleReveal2
[{$:/state/SampleReveal2}match[hide]then[show]else[hide]]
Alt-Z toggles the content of $:/state/SampleReveal2
Since this uses a state tiddler of a fixed name it will always toggle everywhere this state tiddler is in use.
ALt-Z is a global shortcut so it seems hard to determine if it would respond differently if used when different tiddlers are active. ie if you used state-tiddler=<<qualify string>>
I am trying to find tiddler containing the button that is visible on tiddlers that toggles the sidebar inside tiddlers. I believe this is the one you want to be active only on the current tiddler? Buttons/Sidetabs?
I will keep looking
braintemplate without pagecover by Mat
This tiddler is responsible for that button
I also noticed that. I saw it after including the editor
also in the sidetabs. Didn’t investigate it further. Will have to find the cause after this issue is settled.
How would you choose which tiddler to open the reveal widget in?
Tiddlywiki needs to know it, but it doesn’ know with extra javascript/plugin for detecting with events in ViewTemplate, without button click. (I don’t know if the core of tiddlywiki has this functionality)
So if I have to you the keyboard shortcut, I will have to avoid using the qualify macro. Only problem is that all the tiddlers with reveal widget will get revealed when I use the shortcut. But it not a big problem since I will maximum have two tiddlers filling the screen space with my settings. So its a workable compromise.
If you look at this demo wiki - https://arsheth.tiddlyhost.com/
@Alvaro I have used some keyboard shortcuts based on BTC’s http://tiddlywiki-keyboard.tiddlyspot.com/
For example, if you use Alt+M
shortcut , the focused tiddler will go into maximized state and vice versa. Can such a method be used to create a keyboard shortcut to open the reveal widget of the focused tiddler only .
This was my first question in any of the tiddlywiki community groups. Also this was my first interaction in any of the software community groups. Due to lack of prior experience, I tagged you while asking that question. But you were kind enough to reply me. Interestingly that was also your last comment in discord server.
Discord isn’t yet part of my regular online routine, but I’m happy to be tagged there, and always enjoy poking around when I do visit.
With the focus you have solved the half of problem, now you only should follow the hints about the qualify macro and how triggering actions. You have a working example of triggering action(but with button) together a qualify macro in the info button, see the variable tiddlerInfoState
https://tiddlywiki.com/#%24%3A%2Fcore%2Fui%2FViewTemplate:%24%3A%2Fcore%2Fui%2FViewTemplate%20%24%3A%2Fcore%2Fui%2FButtons%2Finfo
You will have to do the equivalent in shortcut triggering of button widget
<$button set=<<tiddlerInfoState>> setTo=
…
It is possible to select the focused tiddler:
<$reveal type=“match” state="$:/HistoryList!!current-tiddler" text=<<currentTiddler>>
>
place sidebar here
</$reveal>
Thank you @Alvaro and @buggyj for your suggestions. I must admit that its little tough for me to solve this with my current TW skills. I will read about your suggestions and will revisit this thread once I am near some solutions
I was using this code to create a keyboard shortcut for a reveal widget as mentioned in this discussion for invoking a sidetabs to the right side of the tiddler body.
Today, based on this discussion, I changed the code for the reveal widget as mentioned here. Code used is given below.
<$let stateID={{{ [[$:/temp/abc/]addsuffix{!!title}addsuffix<qualify>] }}}>
<$reveal type="nomatch" state=<<stateID>> text="show">
<$button set=<<stateID>> setTo="show" class="mybutton" >
{{$:/core/images/info-button}}
</$button>
</$reveal>
<$reveal type="match" state=<<stateID>> text="show">
<$button set=<<stateID>> setTo="hide" class="mybutton" >
{{$:/core/images/info-button}}
</$button>
<$list filter="[all[current]!is[system]!is[shadow]!tag[$:/tags/SideBar]!tag[Journal]!tag[$:/tags/ViewTemplate]!tag[$:/tags/Stylesheet]!tag[tweaks]!TheBrain[no]!has[page-cover]]">
<div class="rightside">
{{||Bottom Tabs for viewtemplate - without folding}}
</div>
<style>
[data-tiddler-title='{{!!title}}'] .tc-tiddler-body {
border:1px solid transparent;
width:50%;
}
[data-tiddler-title='{{!!title}}'] .rightside {
border:1px solid transparent;
width:50%;
position: relative;
float:right;
right:0;
}
</style>
</$list>
</$reveal>
<style>
.mybutton {float:right}
.mybutton {margin-top: -25px}
</style>
So now the keyboard shortcut have stopped working.
As mentioned before by @EricShulman in one of the earlier post
I wil have to use a filter with [prefix[StateTiddlerTitle]]
to modify the code used for keyboard shortcut.
How to modify the code given below to include the prefix
part ?
<$action-setfield $tiddler="$:/state/SampleReveal2" text={{{ [{$:/state/SampleReveal2}match[hide]then[show]else[hide]] }}}/>