You are not logged in.
Pages: 1
Hello,
I am trying to create a preview for Module entries but I'm getting
Page Not Found
You've encountered a missing page. Please check the URL you have entered and try again.
This is what I did
Under Developer > Modules > Name of Module > Edit View >Add Custom Action.
What I entered in the fields
Action Name: Preview
Action Image Class: icon_preview
Action Route: I've tried preview and preview.php with no luck
Link Function:
Then I added the preview.php file to custom/admin/modules/directory/ folder
The url i'm getting is http://localhost/admin/directory/preview/2/ and http://localhost/admin/directory/preview.php/2/
Can you let me know what I'm doing wrong?
Offline
That sounds like it would work to me but it's possible that it's colliding with the default preview functionality of a view. To enable that, enter http://localhost/admin/directory/preview/ as the Preview URL when editing the view. That will enable the preview icon in your view as well as the Save & Preview button when adding / editing content in the related form.
/custom/admin/modules/directory/preview.php would be the proper file for that URL.
Offline
Thanks Tim, that worked.
Ill be using the code below but just curious where are the pending changes stored? I tried look at the module tables and couldn't find anything.
BigTreeAutoModule::getPendingItem("directory_table", $bigtree["commands"][0]);
Offline
Pending changes are stored in the bigtree_pending_changes table and are then applied to the module entry via the getPendingItem method.
Offline
Thank you Tim!
Offline
Pages: 1