Where to edit view_list var in item controller #673
Replies: 2 comments 3 replies
-
I have done some smart redirection in projects, but I would need to take time to check how I solved it back then. But there are very creative ways to deal with front-end redirection. Will get back to you 👍 |
Beta Was this translation helpful? Give feedback.
-
Okay it seems like I used the return value in any link I wanted to return to a page, and if your link has a return value JCB will hide some of the buttons to ensure you will return after editing the page by either clicking save & close or cancel. To build a return value look at the member manger front-end over here. ps. Sorry for the delay in replying to you... |
Beta Was this translation helpful? Give feedback.
-
Hi there,
I'm having issues with the redirection when saving/cancelling an item on the frontend of my component. To illustrate:
I have a page called 'Platformlist', it lists all the active platforms. On these items i have an edit link that links to the edit page e.g "&view=platform&layout=edit&id=1&". Now I know there's a redirect field in the form i can edit, but that triggers on all buttons, and i want it to only redirect to my list page when it's supposed to.
There is the postSaveHook that i can use to manually redirect after saving, but there is something in the controller that would make it far easier. In the constructor of the controller there is a var created called '$this->view_list'. If i put this to platformlist everything works exactly as intended. But i can't find a way to get to this part of the code in JCB, so everytime i compile and install my codechanges are gone.
I understand it's possible (and maybe even fair) to just use the postSaveHook but it feels a bit silly having to add to the postSaveHook when i can just edit the $this->view_list and it working exactly as i want it to.
I've tried adding
$this->view_list = "platformlist"
in the postSaveHook but that doesn't work. Is there a better way to do this?Beta Was this translation helpful? Give feedback.
All reactions