Forums / Templates, Stylesheets, Page Layout / Trying to create a new pages - Done this with EZPages, but how do I link to it?

Trying to create a new pages - Done this with EZPages, but how do I link to it?

Started by joecooper on 18 Mar 2015, 2:08 PM · Views: 1,479

Results 1 to 11 of 11
18 Mar 2015, 2:08 PM
#1
joecooper avatar

joecooper

Zen Follower

Join Date:
Aug 2011
Posts:
122
Plugin Contributions:
0

Trying to create a new pages - Done this with EZPages, but how do I link to it?

I first tried to create a define page, but this is such an over complicated process for something that should be simple.

So trying to use the EZPages for this instead. It just has to be a basic HTML page, with header and footer.

I have created this, but what would be the hyperlink generated? I don't have it set to display on any sideboxes or in the footer.

Thanks

18 Mar 2015, 2:39 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Trying to create a new pages - Done this with EZPages, but how do I link to it?

If the id of the EZ page is 5, for example, the link would be http://www.yoursite.com/index.php?main_page=page&id=5

18 Mar 2015, 3:24 PM
#3
joecooper avatar

joecooper

Zen Follower

Join Date:
Aug 2011
Posts:
122
Plugin Contributions:
0

Re: Trying to create a new pages - Done this with EZPages, but how do I link to it?

I tried this with the correct id (2)

I get this: "Sorry, the page you were attempting to access cannot be found."

18 Mar 2015, 3:52 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Trying to create a new pages - Done this with EZPages, but how do I link to it?

That suggests that there is no EZ page with the id of 2, so I'm not sure what to tell you.

18 Mar 2015, 5:12 PM
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Trying to create a new pages - Done this with EZPages, but how do I link to it?

What version of ZC and what are the various setting on the EZ page, including sort order for each.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

18 Mar 2015, 5:14 PM
#6
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Trying to create a new pages - Done this with EZPages, but how do I link to it?

joecooper:

I tried this with the correct id (2)
I get this: "Sorry, the page you were attempting to access cannot be found."

Q1. If you go to the EZ-pages and activate your ezpage to show in the header, sidebar or footer (it must have an 'order' setting >0) can you then access and view the page using the links that will have appeared?

If the answer is 'no', then do whatever needs to be done until these links do work.

Great, so the EZPage is now working using the links in the header, sidebar or footer. If not, go back to #1

Now try the 'direct' link as suggested by stevesh in post#2.
Q2. Does it work? (It should). If it doesn't check that you have the correct pageID.

Now go back to the EZ-pages and de-activate the header, sidebar & Footer links setting, that is unless you want to keep one (or more of them). In which case, problem solved.

OK, so you don't want the links in the header, sidebar or footer, but when you try the direct link it no longer works, correct? If it does work, get outa here, your done. Problem solved.

Still here huh?

Please load the file
/includes/modules/pages/page/header_php.php into a text editor.

Lines #28-30 should read like:

$sql = "select * from " . TABLE_EZPAGES . " where pages_id = " . (int)$ezpage_id;
// comment the following line to allow access to pages which don't have a status switch set to Yes:
$sql .= " AND (status_toc > 0 or status_header > 0 or status_sidebox > 0 or status_footer > 0)";

I guess you can see what needs to be done? No? Change the last line (above) so it reads

// $sql .= " AND (status_toc > 0 or status_header > 0 or status_sidebox > 0 or status_footer > 0)";

Save the file, and you'll find that the 'direct' link will now work :-)

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

18 Mar 2015, 5:26 PM
#7
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Trying to create a new pages - Done this with EZPages, but how do I link to it?

mc12345678:

What version of ZC and what are the various setting on the EZ page, including sort order for each.

Ran out of time to edit, but:
While may still help others that have the same issue to answer the above questions I posed, rodg's post above basically covers the entire solution. :) and I mean, covers it all...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

19 Mar 2015, 9:26 AM
#8
joecooper avatar

joecooper

Zen Follower

Join Date:
Aug 2011
Posts:
122
Plugin Contributions:
0

Re: Trying to create a new pages - Done this with EZPages, but how do I link to it?

Hi,

Thanks for your reply. Very in depth!

Following what you said, I set the orders all to 1, and enabled header, sidebox and footer.

Attachment #15071

I don't need the links to appear on the page, I have modified the header and footer heavily, so these wont be displayed anyway.

I can now browse directly to the page, however, only the header and the page are being displayed, the footer is not.

I'm a PHP developer, I could do this in a different way altogether, but the client would need to be able to modify the pages from time to time. I am changing the text editor to a HTML editor for this. Just trying to save time with the functionality that is already there.

19 Mar 2015, 9:46 AM
#9
joecooper avatar

joecooper

Zen Follower

Join Date:
Aug 2011
Posts:
122
Plugin Contributions:
0

Re: Trying to create a new pages - Done this with EZPages, but how do I link to it?

There is an error in the log that says:

[19-Mar-2015 09:45:54 Europe/London] PHP Fatal error:  Call to a member function RecordCount() on a non-object in \includes\templates\shopfast\templates\tpl_page_default.php on line 33

I'll work on this now and update you.

19 Mar 2015, 9:56 AM
#10
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Trying to create a new pages - Done this with EZPages, but how do I link to it?

joecooper:

Following what you said, I set the orders all to 1, and enabled header, sidebox and footer.

Any one of those would have done. No harm done by enabling all three though.

joecooper:

I don't need the links to appear on the page,

It was suggested only because the links would give an easy way to test/check the EZ-page.

joecooper:

I can now browse directly to the page,

That's a start. This has confirmed that you need to comment out the line of code as per my previous reply.
You can also disable the header, sidebox and footer activation settings, which were only needed to prove a point/theory (which it has).

joecooper:

however, only the header and the page are being displayed, the footer is not.

This is probably caused by a syntax error in the EZ-page, OR, it could be a result of your modified pages not playing nice with the header, sidebox or footer links being activated, so I'd suggest deactiving these, applying the code change as previously indicated and seeing if the footer problem persists.

Check your error log for clues.

joecooper:

I'm a PHP developer, I could do this in a different way altogether, but the client would need to be able to modify the pages from time to time. I am changing the text editor to a HTML editor for this. Just trying to save time with the functionality that is already there.

The EZ-pages were made for this sort of thing.

Although you can get similar results with the define pages as you have noticed, they take a little bit more work to setup. You can do a whole lot more with the define pages though.

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

19 Mar 2015, 11:03 AM
#11
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Trying to create a new pages - Done this with EZPages, but how do I link to it?

In case you feel like going back to the Define Pages option, I found this plugin very useful

http://www.zen-cart.com/downloads.php?do=file&id=566

I've used it up to v1.51 but it should be ok to v1.54

Simon