Using tm-open-window with a template

Hi,

I am excited to use the tm-open-window and the new tm-close-window and tm-close-all-windows.

I can already get windows to open, in this case I have designed it to allow all sidebar tabs to open in a separate window.

However I am keen to register the windows opened using the windowID and list open windows in a tab. Simultaneously I need to have a close window button appear in the open window to trigger a close but also De-register the window.

I assumed I could use the template parameter to include a heading, then transclude the original tiddler, and follow this with a close button.

However I just can’t find how to transclude the original tiddler inside the window. That is I can’t have my template and the original tiddler content in the window.

The open external window also allows us to click again and move focus to a windows previously open.

Using tm-open-window, Clicking the open windows a second time will not move focus to the existing window, it simply does nothing. - even with windowsTitle and windowID set.

Any advice Appreciated.

2 Likes

@TW_Tones Did you ever get or work out a solution? I too would like to get this working. Thank you.

Could you please clarify what it is that you want to do, what you have tried and what problem you are running into?

I had trouble following the OP in terms of what the question is, nor was there any sample code provided to illustrate what had been tried, not to mention the confusing unattributed quotes with no context provided… they do not appear to be from the documentation.

For me I have tried the example found in:

https://tiddlywiki.com/static/WidgetMessage%3A%20tm-open-window.html

…which on its own is fine. However, when I add a template parameter it is not working as expected:

<$button>Open Window
<$action-sendmessage 
  $message="tm-open-window" 
  $param="$:/temp/openme" 
  template="footnote template"
  windowTitle="My Window Title"
  width="640"
  height="480"
  something="This is my new window. There are many like it, but this one is mine." />
</$button>

This partially works, in that the template renders my fields as expected, but the TEXT field is not shown in the new window. When I remove the template parameter the text field is displayed as expected.

Perhaps what is wrong is my expectations/understandings. My template does not reference the text field. When the tiddler is viewed in the river I get the text field render as expected, plus the expected behaviour I have in the template… which in my case is simply a footer for the tiddler, which displays a few fields.

When you specify a template, your template controls what is and is not shown. The same is true in the story where the view template controls whether the tags, title and body etc are shown. In this case your footer template is showing additional information apart from what the core view template shows. For the new window though, your template needs to explicitly include everything you want to be shown, you start with a clean slate.

In your template tiddler, add the following where you want to see the text field:


<$transclude/>

When you do not specify a template when opening a new window, the core uses a default template that just shows the text field of the tiddler being open in the new window.

1 Like

@saqimtiaz This is fundamental knowledge that I should know. Thank you.

1 Like

No, I have not progressed on this as their was not reply for over a month, I need to revisit it. IO will now with yours and @saqimtiaz comments.

I seems it may be solved like a previous solution with appropriate templates to allow open in new window for edit. new-windows.json (13.3 KB)

Sorry, but from my perspective @saqimtiaz when quotes are not attributed they are the words of the author of the post OR reply emphasising or making a “quotable quote”.

Has anyone gone down this path yet;?

1 Like

As a reader, I find the spurious use of quote blocks to be jarring and confusing, and an impediment to reading and comprehension. Given that I usually have limited time to answer community questions and such posts require an untoward amount of time to comprehend, they usually get skipped. I find that if one writes clearly and cogently, that is more often that not sufficient to convey emphasis.

That said, I am not in the habit of asking anyone to change how they write and would not have said anything if there had not been a follow up question for which I needed clarification in order to be of any assistance.

I also find the incorrect usage of quotes to be deeply confusing. Quotes have a clear meaning here and trying to subvert that meaning will only get in the way of people understanding what you are trying to say.

@jeremyruston and @saqimtiaz I appreciate you see this differently but may I suggest it is the degree to which you both consider a grey box a quote, even when their is no one referenced as being quoted, that causes your discombobulation. After all there are no actual “quotes” to start with. As I highlight below, Quotes in Discourse, are the same as code blocks. Also grey boxes are not quotes in tiddlywiki!

I must say I feel uncomfortable replying here, but I do sometimes need to represent myself, as you are representing your views.

Notice how the only response was from @clsturgeon who understood and ultimately shared the example, code. I did not expect a reply from anyone who had not experienced the problem I detailed.

I would also argue I use it sparingly and few if no one else complains and I think there is an argument that I am already clear and structured in my communication, but I must say I do feel I am always under a little more scrutiny than others, and from you both.

Well I would hope this is not how you see my posts, I put a lot of effort into clarity, for all the different readers in this forum. But @saqimtiaz are you doing the same thing rather than just in line code see <$transclude/> below ?

I hear you both and will try to take your feedback into account, but could you do the same for me :pray: and hear me saying, “that for whatever reason”, it seems to be the case you do both seem to scrutinise and criticise my activity, more than most people, and you are making me feel paranoid :eyes: > :eyes: < :eyes:

Could it perhaps be that I am in a different time zone to you? and you see me in the first posts of the day, and the last replies from yesterday? :nerd_face:

At least in the default theme and colours, Discourse renders codeblocks (pre) and quotes differently. If that is not the case in dark mode then that is clearly a design flaw and might be contributing to why you do not distinguish between the two.

Screenshot:


As I have mentioned, I do not make it a habit to comment on other people’s writing styles - let alone complain - and would not have said anything here either, except that I was genuinely confused as to what the original post was trying to say and needed clarification in order to answer another user’s question. Had I understood the original post, I would have tried to be of assistance at the time of initial reading a month ago, much as I have with your other questions in the past. Since your question touched upon an area of the code that I have recently worked with, I was keen to be of assistance if I could.

My usual way of thinking is that if something doesn’t work for me then the onus is on me to find a way to cope, and in such situations that usually translates into skipping posts that are difficult to follow and move on. I have rather limited time to answer community questions and tend to focus on the ones that I feel I may be best placed to answer within a reasonable amount of time. If I struggle to understand a post - and especially if it isn’t coming from someone for whom English is not their native tongue - I move along hoping that someone else might have better luck with it.

Everyone’s posts get pretty much the same attention from me, with the exception that I do expect experienced users to be helpful and share their work unprompted, or a detailed description of what they have tried to do, when asking for assistance with concrete and specific problems. I always try to take the view that rather than answering a particular user’s questions, I am answering for the benefit of anyone in the community that may have the same question.

I understood all of what you said in your recent post from your comments earlier as well. I appreciate knowing. And respect your position.

as I do;

I will look at the change between night mode (that I inhabit) and day mode.

I am glad your are not treating me differently :nerd_face: