[SOLVED] Navigate from Detail page directly to another Detail page?

I have a list for users to select records which display in Detail view. If they want to view another record, they must use the menu to go back to the list and select again. For a better user experience, I would like users to be able to navigate to the list from within the Detail view.

I don't want to put the list into a module in a side panel as I don't want to lose any of the display. Neither do I want to embed the list into the Detail view intro (or outro) as it could be a long list. And I don't want the list (or the Detail views) to display in a modal popup. (Yes, I know I'm making it difficult for myself!)

Ideally, I'd like the list to be displayed in a dropdown at the top of the Detail view page. I experimented with a copy of the list with a dropdown filter and hiding the actual list, but of course the filter only filters the list, it doesn't take you directly to the Detail view.

I'd appreciate any ideas or advice. Thanks.
 
I could imagine:
Create a form (no need to save to DB) with a dbjoin element to your list, a redirect plugin to the details view of the selected record and some JS to submit the form on select, there should be a WIKI or a thread for how to do (without JS you'll have to hit the Save button).
Then you can include this form in your details intro.
 
Thanks @troester.

I've not tried the JS yet, but that works great as a standalone form; however, when I put it into the Details intro, it opens the requested record in a modal popup. I can't see I've got anything set up as Ajaxify so not sure how to prevent this.
 
Hmm, with a content plugin it's ajaxfied.
I didn't test. There's an option in the redirect plugin, try "Content Redirect"= Same page
 
Hi again @troester

I've searched the wikis and various threads but I can't find the JavaScript on how to submit the form on select.
I found this post https://fabrikar.com/forums/index.php?threads/submit-form-on-dropdown-selection.51444/#post-268692 but I don't understand the instructions:
At Javascript On Click event you can add new ajax call to update the value on dropdown element or you can call $('.fabrikActions [type="submit"]').click(); to autosave the form after dropdown selected.

Sorry.
 
JavaScript:
jQuery("#your_form_id").submit();
should do in your databasejoin element javascript (event: change).
 
Last edited:
Thanks @juuser, but not sure I've done this correctly. With a form id of 23, I've tried this:
JavaScript:
jQuery("#form_23").submit();
But I get a long error message:
{"msg":"","url":"index.php?option=com_fabrik&view=details&formid=1&rowid=1&isMambot=1","baseRedirect":false,"rowid":"","suppressMsg":true,"redirect_how":"samepage","width":0,"height":0,"x_offset":0,"y_offset":0,"title":"Array","reset_form":true}
 
OK, Fabrik seems to append row id to form id (you see it when you check your form tag with browser inspect tool). So you can try:
JavaScript:
jQuery("form[id^='form_23']").submit();

And make sure "23" is the id of the form where you have your databasejoin element, not the id of the "details view" form.
 
Last edited:
Nope, I get the same error message. The formid and rowid in the error message are correct so why is it not working?
Interestingly, if I access the form only from a menu item (rather than embedded in the detail view), it works! But of course then we're back to the embedded view and it doesn't work again.
So Fabrik is getting confused about which form? o_O
 
OK, didn't test this with content plugin which seems to redirect differently.

I haven't got a proper testing setup, but it seems to work if you replace form redirect plugin with PHP-form plugin (onAfterProcess) and the code for redirecting:
PHP:
$myapp = JFactory::getApplication();
$myapp->redirect("https://your-url-to-redirect-to");
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top