Customizable interwiki links similar to AliasPlugin necessary

6 views
Skip to first unread message

Mammut

unread,
Mar 10, 2009, 1:03:01 PM3/10/09
to TiddlyWiki
Hello,

i´d like to handle (often used) very large hyperlinks easily within my
TW. With AliasPlugin i thought i found a solution, but ...

Problem is that I have a changing variable (see V_A_R_I_A_B_L_E) in
the middle of the hyperlink, so it seems I can´t use the substitution
marker. That´s right?

For example:
http://10.20.30.4/search?q=V_A_R_I_A_B_L_E&
entqr=0&output=xml_no_dtd&sort=date& ...



Anybody an idea how to solve this challenge?

Thanks for any advice, help or reference.
Mammut

Eric Shulman

unread,
Mar 10, 2009, 1:14:05 PM3/10/09
to TiddlyWiki
> i´d like to handle (often used) very large hyperlinks easily within my
> TW. With AliasPlugin i thought i found a solution, but ...
>
> Problem is that I have a changing variable (see V_A_R_I_A_B_L_E) in
> the middle of the hyperlink, so it seems I can´t use the substitution
> marker. That´s right?
>
> For example:http://10.20.30.4/search?q=V_A_R_I_A_B_L_E&
> entqr=0&output=xml_no_dtd&sort=date& ...
>
> Anybody an idea how to solve this challenge?

AliasPlugin supports use of javascript substitution markers (%0
through %9). Thus, if you define an alias (e.g., "SearchLink"), like
this:

<<alias searchLink "http://10.20.30.4/search?q=%0&entqr=0...">>

You can then invoke it like this:

<<searchLink "V_A_R_I_A_B_L_E">>

where the parameter value is automatically inserted in place of the
%0, and is then rendered as if the original content was:
http://10.20.30.4/search?q=V_A_R_I_A_B_L_E&entqr=0...

You can even make things look nicer by using a PrettyLink in the alias
definition:

<<alias searchLink "[[search for %0|http://10.20.30.4/search?q=
%0&entqr=0...]]">>

which will display the external link using the text "search for
V_A_R_I_A_B_L_E" instead of a big long ugly URL.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

Mammut

unread,
Mar 10, 2009, 4:10:43 PM3/10/09
to TiddlyWiki
...again, Eric you´re right!

Thanks a lot for your example, I had a mistake in my previous alias
definition, therefore it did´nt work.

You are great!
Mammu
Reply all
Reply to author
Forward
0 new messages