Forums

redirect plugin

prince25 25 Jan, 2019
Hi,
I would like to implement a redirect in time ... can I enter a code in the "Event" box of the redirect plugin?
Thank you
GreyHead 25 Jan, 2019
Hi prince25,

Again, I don't fully understand your question.

You can use an Event Switcher - or Custom PHP - to use different redirects depending on the form data if that is what you need.

Bob
prince25 25 Jan, 2019
Sorry ......
I created a registration form for joomla with verifying the email address with User activation.
In the success option I have added a message box .... I would like the user to be redirected to a page of the site.
I do not know if you can insert a module rendirect and give it as an event once or need a php ... but with which code?
Thank you for your time
healyhatman 26 Jan, 2019
Just use the redirect action, and put the alias of the menu item you want in the redirect url like
/store
for example to be redirected to yoursite.com/store
healyhatman 26 Jan, 2019
Just be aware that anything AFTER the redirect action WILL NOT be processed.
GreyHead 26 Jan, 2019
Hi prince25,

The ReDirect action will redirect the user to the url you set there.

But in that case the message will not be shown, you can use a System Message instead which will be shown on the page you redirect the user to.

Bob
prince25 28 Jan, 2019
Hi,
I thank Bob and healyhatman, but the translation with Google has created errors. . .sorry.
So, I would like to do a time redirect (after x sec) to insert after a field_message. (see fig)
The redirect event is sending the message ...
Can I perform this function with redirect plugins? or I have a PhP module instead.
You can help me?
In both cases with which code syntax?
Sorry, I'm very unsure.
Thank you very much

healyhatman 28 Jan, 2019
you'll have to do that in JavaScript.
GreyHead 28 Jan, 2019
Hi prince25,

There is code in this FAQ to do a delayed redirect. It was written for CFv4 but I think it will still work with later versions.

Bob
prince25 28 Jan, 2019
Ok .... I try and let you know
prince25 28 Jan, 2019
It poses a bug problem.
Can you tell me if it resolves with the proposed version?
prince25 28 Jan, 2019
this is the FAQ text
"This FAQ will be used to create an HTML" meta refresh "header to redirect the user after a specified number of seconds.
There is a Joomla! bug in some versions that adds a charset definition if you use setMetaData (), see the last section for a workaround for this problem. "
GreyHead 31 Jan, 2019
Hi Prince 25,

I expect that it is fixed now - if not then "see the last section for a workaround for this problem".

Bob
healyhatman 31 Jan, 2019
\GApp::document()->addHeaderTag("<meta blahblahblahblahblah/>"); 
To add a named meta tag:
\GApp::document()->meta("tag name", "content");
prince25 01 Feb, 2019
So .... the alternative solution of the HTML header "meta refresh" proposed by the FAQ is really ok ... it works great.
It is not clear to me your syntax where I should insert it and what are "name" and "value".
This is the FAQ solution
<?php
$jdoc=\JFactory::getDocument()
$jdoc->addCustomTag('<meta http-equiv?"refresch"
content="5;url=http://example.com/index.php" />')
healyhatman 01 Feb, 2019
Answer
1 Likes
Sorry, in a PHP block (for CFv6)
\GApp::document()->addHeaderTag('<meta http-equiv="refresh" content="5;url=http://example.com/index.php" />');
Difference being that should work in Joomla AND WordPress versions of CF.
This topic is locked and no more replies can be posted.