On Saturday, April 24, 2021 at 3:16:22 AM UTC-7 ludwa6 wrote:
> PS to my last: have fixed part of the problem: by adding the suffix clause
> back into macro (as below), it now pulls not a system-level error msg, but
> the error msg from wikipedia.org site itself, which seems to be objecting
> to the .html extension only... yet i can't find a way to remove that w/o
> reverting to the lower-level error msg. Any insight about this problem
> would be appreciated!
Try this in a tiddler named "ShowWikipediaFrame":
\define AddTopic(topic) <option value={{{
[[$topic$]encodeuri[]addprefix[https://en.wikipedia.org/wiki/]]
}}}>$topic$</option>
<$select field="curr-topic">
<<AddTopic "TiddlyWiki">>
<<AddTopic "WikiWikiWeb">>
<<AddTopic "Project Xanadu">>
</$select> <a href={{!!curr-topic}} title="Open web page in a
separate window/tab" target="_blank">link</a>
<iframe src={{!!curr-topic}} height="500" width="100%"></iframe>
Notes:
* The filter in AddTopic needed a closing "]]". Also, the filter uses
"encodeuri[]" rather than "split[ ]join[%2520]". This handles all special
URI characters, not just space.
* The target tiddler for storing the $select widget value is the *current
tiddler*, rather than "Wikipedia" (or {{Wikipedia!!title}}) and the
corresponding <a href=...> and <iframe src=...> params simply fetch
{{!!curr-topic}} (i.e., from the current tiddler). This allows you
transclude the above content as a template (e.g., {{||ShowWikipediaFrame}})
and each transcluded instance can be used to show a different selected
topic.
enjoy,
-e
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/5a5a7dd6-4724-4a03-ae29-09931f8d9a74n%40googlegroups.com.