Can we allow iframes to tiddlytalk content and is there problems doing it?

Hi, I just tried to use an iframe to talk.tiddlywiki.org or its content and it is refused like most sites.

Can we allow iframes to tiddlytalk content and is there problems doing it?

It would be nice to have a live reference to talk.tiddlywiki.org because it can make a static tiddlywiki become an interactive one!

It would also allow one to maintain links to live conversations in a tiddlywiki to organise ones work on tiddlywiki, then you need not have to depend on bookmarks or search.

Personally I don’t see much room for misuse as all it does is empower access to out resources, the way tiddlywiki works nothing will touch the server unless the specific tiddler is opened. This allows a whole new world of metadata to be maintained in a wiki as an overlay to content in discourse. For example we could curate “how to” or “plugin” posts in a Wiki.

Sure this is already possible with links but its less interactive and removes you from our “heartland” tiddlywiki.

Alternatively a plugin / api would be nice.

I have found this;

Thanks for doing the research! I checked the box to enable this:

1 Like

Thanks, I can see http://talk.tiddlywiki.org/javascripts/embed-topics.js online.

I am still working on this;

I have a tiddler tagged $:/tags/RawMarkup containing
<script src="http://talk.tiddlywiki.org/javascripts/embed-topics.js"></script>

I have another tiddler where I hope to embed it;

<d-topics-list discourse-url="https://talk.tiddlywiki.org" per-page="6"></d-topics-list>
<iframe src="https://talk.tiddlywiki.org" frameborder="0" scrolling="no" height="175px"></iframe>

The above is not working and I expect wrong. I will continue.

No iframe required from reading the link you tagged – the script tag grabs the content remotely.

The javascript needs to be loaded globally in TW and then where you have that <d-topics-list> the script will replace that with a list of topics.

The example site is simple to view source on: https://embed.eviltrout.com/

This is a typical code pattern that assumes a static HTML file.

Unfortunately, this does not work in TiddlyWiki… The problem is that, even though the javascript is “loaded globally” using $:/tags/RawMarkup, no tiddlers are rendered at that time, so the element <d-topics-list> does not yet exist.

I tried putting the <d-topics-list> element in the same $:/tags/RawMarkup tiddler:

<script src="http://talk.tiddlywiki.org/javascripts/embed-topics.js"></script>
<d-topics-list discourse-url="https://talk.tiddlywiki.org" per-page="6"></d-topics-list>

But that didn’t work. It did show an iframe at the bottom of the page (I think it was generated by the script), but that displayed an error: “talk.tiddlywiki.org refused to connect”, which is a common error message when attempting cross-origin scripting from file://

I also tried using a variation of @Charlie_Veniot’s iframe scripting method by putting the following into a regular tiddler:

\define source()
<head>
   <script src="http://talk.tiddlywiki.org/javascripts/embed-topics.js"></script>
</head>
<body>
   <d-topics-list discourse-url="https://talk.tiddlywiki.org" per-page="6">test</d-topics-list>
</body>
\end
<iframe srcdoc=<<source>> style="width:100%;height:50vh;"></iframe>

But that also didn’t work :frowning:, and didn’t even give any error message, although it did render an iframe.

-e

Sorry, yes, assume zero knowledge of TW parsing flow on my part, I was just pointing out that this code isn’t to be used in tandem with an iframe – it generates iframes as part of script output.

Thanks for trying and clarifying!