Forums

Redirect-Function Problem

Fredolino 20 Jul, 2019
Hi,

under the tab "Functions / Basic" is the function "Redirect".

My redirect function:
Name: redirect_from_edit
Page: empty
Redirect URL: {url: event = view}
Parameter: empty
Time: 5

How does it work? I have this feature z. Example under events "delete" in content:
{Fn: delete_beob}
{success: The species was successfully deleted from the list.}
(Fn: redirect_from_edit}

But it does not work. And that's also shown to me in the frontend:
(Fn: redirect_from_edit}

What do I have to do?

Have i this,  is ok:
{redirect:/index.php/mein-bereich?conn=beobachtungsliste&article_id=642&event=view}
But in the Function not.


F.
healyhatman 21 Jul, 2019
{url:event_name} NOT {url:event = name}

So if you want to redirect to the 'foo' event, you would use {url:foo}

It works in your {redirect:} short tag because you're giving it a valid URL
Fredolino 21 Jul, 2019
OK, you're right.

I changed the URL to "{url:view}" now.
What parameters do I have to enter if I want to return to this goal?

.../mein-bereich?conn=beobachtungsliste&article_id=643&event=view

the article_id-number can be different. It depends on which record I want to change.

Here are 3 screens to view.
1. I edit the record
2nd record was saved but I am shown the seconds until redirect dates (in red box)
3. I am not at the right destination, the table is still empty.

<a href="[url=https://www.sommerfugl.de/_adat/screen_b1.jpg">screen1>[br]<a href="[url=https://www.sommerfugl.de/_adat/screen_b2.jpg">screen2>[br]<a href="[url=https://www.sommerfugl.de/_adat/screen_b3.jpg">screen3>
healyhatman 21 Jul, 2019
Just put the URL shortcodes and such you want in a custom code or html block and play around with it until it looks right. Using {url:event} though will only work if the event exists in the form you're using the shortcodes in.
Fredolino 22 Jul, 2019
Hi,
So I can use the redirect function for a new record.

For example:
Name: redirect_from_new
Redirect URL: {url: index.php}
URL parameters: conn=beobachtungsliste&article_id={data:article_id}&event=view

With {data: article_id} I return to the correct page after saving, which displays a list of the records:
... index.php/mein-bereich?conn=beobachtungsliste&article_id=643&event=view
If I want to edit a single record on this page, then I click on the edit line icon in the record row and come to a page where I only get the one record I want to edit.

For example:
index.php/mein-bereich?conn=beobachtungsliste&article_id=1003&event=edit
article_id = 1003 is the number of the record.

I have created a redirect function:

Name: redirect_from_edit
Redirect URL: {url: index.php}
URL Parameter: conn=beobachtungsliste&article_id={data:article_id}&event=index

I tried it first with the URL "... &event=view". This does not work because the view page is a list (table) of records from the subtable.

index page
{data: article_id} has the number 642
{data: article_id} has the number 643
---------
For example, the view page: ... conn=beobachtungsliste&article_id=643&event=view
Main table: {data: article_id} has the number 643
Under 643, sub records are displayed in tabular form:
- {data: article_id} has e.g. 1003
- {data: article_id} has e.g. 1004
- etc.
------
or, the view page: ... conn=beobachtungsliste&article_id=642&event=view
Main table: {data: article_id} has the number 642
Under 643, sub records are displayed in tabular form:
- {data: article_id} has e.g. 904
- {data: article_id} has e.g. 905
- etc.

So I can only
... & event = index
and
... & event = edit
use.
I have not come up with any other solution so far.
:-)
healyhatman 22 Jul, 2019
Why are you using a redirect function at all and not just linking directly to the page you want?
Fredolino 22 Jul, 2019
:-)

As you write it sounds easy.

But I do not know how that works.
It probably has to be a PHP script. Maybe in the event tab "Save".
But I have too little knowledge.
I also tried a redirect function with the _self URL. But I did not come back to the right view page with the respective list of records.
Fredolino 22 Jul, 2019
… or must i have JavaScript?
Example:
history.back(); //Go to the previous page
history.forward(); //Go to the next page in the stack
history.go(index); //Where index could be 1, -1, 56, etc.
healyhatman 22 Jul, 2019
No I just don't understand what the problem is.

You don't have to have everything in between the shortcodes if you're using a redirect action by the way. Can just do {url:event}&param=value
Fredolino 22 Jul, 2019
sorry, I think I'm standing in the woods ...

So I create a redirect function:
Redirect URL: {url:view}&article_id={data:article_id}
URL Parameter: empty
healyhatman 22 Jul, 2019
Well you can leave {url:view} as the URL and put article_id={data:article_id} in the parameter
Fredolino 22 Jul, 2019
I have tried this several times and did not work .... wait of pm....
healyhatman 22 Jul, 2019
A bunch of your URLs and parameters were in there incorrectly. I've fixed those. Have a look now.
Fredolino 22 Jul, 2019
Did it work for you?
For me it is synonymous with the URLs as before ...
This topic is locked and no more replies can be posted.