I need TW to open in the same window but externals in a new window

75 views
Skip to first unread message

ardchoille

unread,
May 10, 2008, 4:51:30 PM5/10/08
to TiddlyWiki
I currently have 10 TiddlyWiki's with 4 of them being around 2
megabytes in size. I tried putting everything into one TW but that
slows everything down considerably. So, I split the various
information into several TW's with a 'Main' TW that links to all of
them. See this page for an example:

http://ardchoille42.googlepages.com/index.html

Each of the items in the left menu are TW's which reside in the same
folder as the index.html file (same theme, plugins, etc.). How can I
get each of them to open in the same tab/window and still have
external links (ie. www.wikipedia.com) open in a new tab/window? Or is
there a better way to do what I am trying to achieve? Is there a
plugin for this type of thing?

I realise this causes a lot of redundant code but I didn't know any
other way to achieve this.

Thanks,
Ian MacGregor

wolfgang

unread,
May 10, 2008, 5:23:47 PM5/10/08
to TiddlyWiki
Hi Ian,

you could for example use IncludePlugin in a main TiddlyWiki - and
include all other TWs into this one:

http://tiddlywiki.abego-software.de/#IncludePlugin

Regards,

W.

On 10 Mai, 22:51, ardchoille <ardchoill...@gmail.com> wrote:
> I currently have 10 TiddlyWiki's with 4 of them being around 2
> megabytes in size. I tried putting everything into one TW but that
> slows everything down considerably. So, I split the various
> information into several TW's with a 'Main' TW that links to all of
> them. See this page for an example:
>
> http://ardchoille42.googlepages.com/index.html
>
> Each of the items in the left menu are TW's which reside in the same
> folder as the index.html file (same theme, plugins, etc.). How can I
> get each of them to open in the same tab/window and still have
> external links (ie.www.wikipedia.com) open in a new tab/window? Or is

ardchoille

unread,
May 10, 2008, 6:33:22 PM5/10/08
to TiddlyWiki
> Hi Ian,
>
> you could for example use IncludePlugin in a main TiddlyWiki - and
> include all other TWs into this one:
>
> http://tiddlywiki.abego-software.de/#IncludePlugin
>
> Regards,
>
> W.
>
I have tried the IncludePlugin and couldn't get it to work after
following all instructions.

Ian MacGregor

Mecha

unread,
May 10, 2008, 5:35:07 PM5/10/08
to TiddlyWiki
If I got you correctly, you can use something like following in your
TW

<html><hide linebreaks>
<!-- extra psuedo-tag from HTMLFormattingPlugin -->
<form target="theFrameID">
<input type=file name=whichfile>
<input type=button value="open"
onclick="var f=this.form;
f.action='file:///'+f.whichfile.value;
try { f.submit(); }
catch(e) { alert(e.description?e.description:e.toString()); }">
</form>
<iframe src="" name="theFrameID" id="theFrameID"
style="background:#fff;width:100%;height:600px">
</iframe>
</html>

I thinks its Eric's or Dave's code and I am using it to view multiple
TW within my main TW.

Regards,
Umar.


On May 11, 1:51 am, ardchoille <ardchoill...@gmail.com> wrote:
> I currently have 10 TiddlyWiki's with 4 of them being around 2
> megabytes in size. I tried putting everything into one TW but that
> slows everything down considerably. So, I split the various
> information into several TW's with a 'Main' TW that links to all of
> them. See this page for an example:
>
> http://ardchoille42.googlepages.com/index.html
>
> Each of the items in the left menu are TW's which reside in the same
> folder as the index.html file (same theme, plugins, etc.). How can I
> get each of them to open in the same tab/window and still have
> external links (ie.www.wikipedia.com) open in a new tab/window? Or is

wolfgang

unread,
May 10, 2008, 7:20:19 PM5/10/08
to TiddlyWiki
Where you got stuck? Did the plugin install properly, and it shows
after a save and reload cycle in the shadowed PluginManager?

Next you would only have to enter:

<<include "TiddlyWiki.html">>

- into the IncludeList shadowed tiddler. Assuming the TW is placed in
the same folder as the main, and with the real name adapted to your TW
to include.
After finishing editing the IncludeList tiddler it always worked for
me.

W.

Eric Shulman

unread,
May 10, 2008, 7:26:02 PM5/10/08
to TiddlyWiki


On May 10, 2:35 pm, Mecha <umari...@gmail.com> wrote:
> If I got you correctly, you can use something like following in your
...snip...
> I thinks its Eric's or Dave's code and I am using it to view multiple
> TW within my main TW.

I'm pretty sure that's some of my code. However, for this particular
use-case, that code is much more complex than what is needed.

As I understand the question, Ian simply wants to insert an external
link into the MainMenu, but change the *target* for that specific link
to be the same browser tab/window, while the target for all other
external links should continue to open a new tab/window (i.e., the
normal default behavior).

Using
http://www.TiddlyTools.com/#InlineJavascriptPlugin
this does the trick:
------------------
[[Other File|example.html]]<script>
place.lastChild.target="_self";
</script>
------------------

enjoy,
-e

ardchoille

unread,
May 11, 2008, 3:16:41 AM5/11/08
to TiddlyWiki
> As I understand the question, Ian simply wants to insert an external
> link into the MainMenu, but change the *target* for that specific link
> to be the same browser tab/window, while the target for all other
> external links should continue to open a new tab/window (i.e., the
> normal default behavior).

Yes, that is exactly what I want to do.

>
> Using
> http://www.TiddlyTools.com/#InlineJavascriptPlugin
> this does the trick:
> ------------------
> [[Other File|example.html]]<script>
> place.lastChild.target="_self";
> </script>
> ------------------
>
> enjoy,
> -e

I did this and it works perfectly!
Thank you, Eric :)

Regards,
Ian MacGregor
Reply all
Reply to author
Forward
0 new messages