External TW content for many wikis

Just in case this can give you some ideas: [Idea] Export minimal wiki for iframes - #9 by Charlie_Veniot

And details: [Idea] Export minimal wiki for iframes - #12 by Charlie_Veniot

This reply relates specifically to including content with an iframe. Other answers in this thread are using other approaches. And I raise quite a few above. This is not automatic, but requires interaction, but is one way to improve distribution of content between wikis. Personally my key methods are;

  • Saved bookmarklets containing a package of tiddlers, click to apply
  • Import JSON packages of tiddlers (I have a powerful supporting workflow)

The iframe approach
The iframe will display what ever you ask of course. If the whole wiki is given as the source, or one tiddler within it (with a permalink) the whole wiki is loaded. However like any wiki you view in a regular tab, you can alter what view you get of the wiki, such as a particular tiddler(s) Permalink/Permaview, different default tiddlers, sidebar showing or hidden etc…

  • There are a range of different ways to change what you see when following a link to a tiddlywiki. Starting with a permalink https://tiddlywiki.com/#EditTextWidget that opens the named tiddler.
  • How the wiki is last saved such as hidden sidebar
  • If a “search” parameter is given on the URI, using ?
    (I will try and find example and more details).
  • If there are start up actions that alter the way the wiki starts up

Keep in mind with this load whole wiki method that if you externalise the javascript you will only load your content tiddlers from file (if the javascript is already in the cache)

  • The loading of the whole wiki has a cost, but it also has the benefit of a fully interactive wiki. This enables a lot of smarts to be designed in, in this case inside the iFrame.

If you want only to Load a specific tiddler and not load the whole wiki then that tiddler needs to be “stand alone” there are two obvious ways;

  • Export the tiddler as static HTML and iframe the link to that static tiddler
    • You could write a custom export template to export anything, not just a static tiddler, but that would be more involved.
  • There is a way using a Node Server to have all tiddlers also appear as a “static” tiddler automatically, you just have to address them correctly.
1 Like

Note that with TW 5.30 prerelease, this is now entirely doable with just wikitext:

3 Likes

I have packaged the code for loading tiddlers from one wiki into another:
https://saqimtiaz.github.io/tw5-plugins-sandbox/#ExternalContent

1 Like

Impressive as always! I can see all sorts of possible uses.

Note two minor typos in the “Loading content on demand” sample code:

- <$button actions=<<loadMyWiki>> load content </button>
+ <$button actions=<<loadMyWiki>> > load content </$button>
<!--                              ^                ^    -->
1 Like

Thank you Scott, I will push out a correction later in the day.

1 Like