LUCY offers different possibilities to redirect a user to a predefined pages in certain scenarios: ===== Redirect a user in a hyperlink based scenario ===== A hyperlink-based scenario has no landing page involved. Instead, the user just gets a message (mail or SMS) with some content and possibly a hyperlink. If the message template contains a link (using the **%link%** variable in order to create a user-specific URL) you can tell LUCY where the user will be redirected when the user clicks that link. This can be done in the redirect field within the scenario settings. {{ scenario_settingy_hyp.png?600 }} ===== Redirect a user in a form field before he clicks the submit button ===== This can be done using some javascript code as described [[special_landing_page_that_redirects_user_before_submitting_a_password|here]]. ===== Time based redirect a user on a landing page in a web based scenario ===== You can use the redirect value as well on landing pages. Left mouse click anywhere your landing page (1), then select **Insert Redirect** within the **Visual Editor** (2) and then define the redirect link (3) using a syntax like "http://www.example.com". As a result, the user will be redirected within 5 seconds to the desired web page. {{ redirect_landingpage.png?600 }} If you want to use a **static link** to an **external** Intranet/Wiki page even if you have a separate link 'per language' you can place this redirect in the header: ===== Add a redirect script when a form gets submitted or when a link/button gets clicked ===== **Variation A** (no data gets send to LUCY): Just add an onclick event to the button or link, or onsubmit event to a form within the source of the code and the user will get redirected to the site defined in %redirect%. Please note: since you are redirecting the user to another site LUCY won't be able to Trigger successful form submits anymore and no data input from LUCY will be recorded. Example form:
Example Button: Example Link: Submit **Variation B** (record data input and trigger success Status): please create a second page called account.html, then insert the Redirect via the Redirect button (see screenshot). Next change the timeout from 5000 to 0. Lucy is designed that any form based submit action automatically opens a second page with the name account.html if not programmed differently in the html code. The moment the user submits some form data (the login form should use a POST method and either point to the same page having an empty action attribute or having an action set to "?login" so the form action would look like this: ) on the index.html page, Lucy opens the account.html page where the user will get redirected now. {{ redirect12.jpg?600 }} Here is an example of a possible html code for the account.html page: Redirect Page

===== Redirect a user to an awareness page (eLearning) ===== Among the many [[variables_you_can_use_in_lucy|variables]] that may be used in LUCY, there is one called **%awareness%**. You can place that in the **Redirect URL** input field described above (hyperlink-based or web-based). It will redirect the user automatically to the eLearning content when a link is clicked or data is submitted. =====Redirect a user in a file based scenario to an awareness page (eLearning)===== This is achievable using some javascript coding. Lets assume you have a file based template with a download button. Instead of using a direct link on that button you can have an javascript function: onclick="downloadAndRedirect('%static%/file.exe?track', '%redirect%');" attribute set. And download and redirect code which you should place inside the head tag could be: if you like to use a **'static link' to an external site** at the download button you may use this script, you can use this also for a distinct **link for each language**! ===== Remove the Redirect Script ===== You can click on "view source code" button in the landing page editor and delete at the bottom of the code the line