iframe Redirect

By James KanjoJames Kanjo

Description

Although Wikidot's Redirect Module is useful, it doesn't allow you to use variables (via includes or the ListPages module) within it. In such times, you may want to iframe this special JavaScript redirect.

Attributes

attribute required allowed values default description
url yes valid URL or website address none Specifies the URL to redirect the user to
mode no default, advanced default Specifies method of iframe generation

“Advanced Mode” merely uses Wikidot's HTML block to generate the iframe Redirect. This might be required for certain use cases. The iframe Redirect is incompatible within Wikidot modules when used in “Advanced Mode”, and therefore “Advanced Mode” is not recommended.

/noredirect/t

If you don't want the page to redirect elsewhere, simply add /noredirect/true to the URL, and you won't be redirected.

Code

[[include :snippets:redirect
|url=https://wikidot-proxy.obscurative.ru
]]

In action

Random Snippet (as described in the “alternative” here)

Alternative Method

Alternatively, you may like to code the iframe redirect manually:

[[iframe https://files.snippets.obscurative.ru/local--code/code:iframe-redirect#URL ]]

Where the word URL is where you would place the URL of your destination page… the page you want the user to be redirected to.


Thanks to tsangk for this great snippet: conditional-blocks


text above inserted with:

[[include :snippets:if START |unique=1|type=equal|var1=%%name%%|var2=conditional-blocks]]
**##red|Thanks to tsangk for this great snippet:##** [[[code:conditional-blocks]]]
[[include :snippets:if END]]



Other snippets posted by James Kanjo


Rate this solution

If you think this solution is useful — rate it up!

rating: +4+x
Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License