#1 July 26, 2018 2:47pm

doon.mok
Member
Registered: May 6, 2015
Posts: 96

Module Preview - Page Not Found

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

#2 July 26, 2018 8:03pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 932

Re: Module Preview - Page Not Found

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

#3 July 27, 2018 11:06am

doon.mok
Member
Registered: May 6, 2015
Posts: 96

Re: Module Preview - Page Not Found

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

#4 July 28, 2018 11:38am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 932

Re: Module Preview - Page Not Found

Pending changes are stored in the bigtree_pending_changes table and are then applied to the module entry via the getPendingItem method.

Offline

#5 July 30, 2018 9:09am

doon.mok
Member
Registered: May 6, 2015
Posts: 96

Re: Module Preview - Page Not Found

Thank you Tim!

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.