Forums / General Questions / EZ Page title shows but content doesn't

EZ Page title shows but content doesn't

Started by congerman on 4 Sep 2018, 4:05 PM · Views: 2,171

Results 1 to 10 of 10
4 Sep 2018, 4:05 PM
#1
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

EZ Page title shows but content doesn't

Hi, I am trying to add ez pages to my site. When created and I click the link all I get is the page title and even the page footer is missing.. Please see attached images. Also at https://tradefiresafety.co.uk/index.php?main_page=page&id=23&chapter=10 Thanks in advance to the Zen Cart Community

Attachment 18018

Attachment 18019

4 Sep 2018, 5:29 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,130
Plugin Contributions:
56

Re: EZ Page title shows but content doesn't

It would appear that you've got a partial whitepage, implying that there's a debug-log present in the store's /logs directory that identifies the source of the error.

4 Sep 2018, 8:03 PM
#3
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

Re: EZ Page title shows but content doesn't

lat9:

It would appear that you've got a partial whitepage, implying that there's a debug-log present in the store's /logs directory that identifies the source of the error.

does the following point to a resolve?

[04-Sep-2018 20:46:11 Europe/London] PHP Fatal error: Call to a member function RecordCount() on null in /home/tradefiresafety/public_html/includes/templates/theme154/templates/tpl_page_default.php on line 31

here is line 30 through 35

// create a table of contents for chapter when more than 1 page in the TOC
if ($pages_listing->RecordCount() > 1 and EZPAGES_SHOW_TABLE_CONTENTS == '1') {?>

<div id="navEZPagesTOCWrapper"> <h2 id="ezPagesTOCHeading"><?php echo TEXT_EZ_PAGES_TABLE_CONTEXT; ?></h2> <div id="navEZPagesTOC"> <ul>
4 Sep 2018, 8:29 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,130
Plugin Contributions:
56

Re: EZ Page title shows but content doesn't

That log's indicating that the** $pages_listing **variable isn't set. What version of Zen Cart are you running?

Note that for Zen Cart 1.5.5, that **$pages_listing->RecordCount() **element reads **sizeof($toc_links) > 1 **for the default template version.

4 Sep 2018, 8:56 PM
#5
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

Re: EZ Page title shows but content doesn't

version 1.5.5 f

I do not know code so the rest is double dutch to me. Can you help me fix it?

4 Sep 2018, 9:20 PM
#6
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: EZ Page title shows but content doesn't

Congerman:

does the following point to a resolve?

[04-Sep-2018 20:46:11 Europe/London] PHP Fatal error: Call to a member function RecordCount() on null in /home/tradefiresafety/public_html/includes/templates/theme154/templates/tpl_page_default.php on line 31

here is line 30 through 35

// create a table of contents for chapter when more than 1 page in the TOC
if ($pages_listing->RecordCount() > 1 and EZPAGES_SHOW_TABLE_CONTENTS == '1') {?>

<div id="navEZPagesTOCWrapper"> <h2 id="ezPagesTOCHeading"><?php echo TEXT_EZ_PAGES_TABLE_CONTEXT; ?></h2> <div id="navEZPagesTOC"> <ul>

Seems to indicate that the template file being used is from pre-Zen Cart 1.5.3 and that changes have possibly been made such as an upgrade to a newer version but not everything about the template has been updated to reflect the new way of coding.

Suggest comparing your template file against the template_default or responsive_classic version as applicable for your version of Zen Cart.

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

4 Sep 2018, 9:31 PM
#7
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

Re: EZ Page title shows but content doesn't

below is the content of my template. I do not want to screw anything up. Can you see any issue with it?

<?php /** * Page Template * * This is the template used for EZ-Pages content display. It is named "tpl_page_default" instead of ezpage for friendlier appearance * * @package templateSystem * @copyright Copyright 2003-2012 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version GIT: $Id: Author: DrByte Sat Oct 6 16:09:44 2012 -0400 Modified in v1.5.2 $ */ ?> <div class="centerColumn" id="ezPageDefault"> <h1 id="ezPagesHeading"><?php echo $var_pageDetails->fields['pages_title']; ?></h1> <?php if (EZPAGES_SHOW_PREV_NEXT_BUTTONS=='2' and $counter > 1) { ?> <div id="navEZPageNextPrev"> <a href="<?php echo $prev_link; ?>"><?php echo $previous_button; ?></a> <?php echo zen_back_link() . $home_button; ?></a> <a href="<?php echo $next_link; ?>"><?php echo $next_item_button; ?></a> </div> <?php } elseif (EZPAGES_SHOW_PREV_NEXT_BUTTONS=='1') { ?> <div id="navEZPageNextPrev"><?php echo zen_back_link() . $home_button . '</a>'; ?></div> <?php } ?> <?php // vertical TOC listing // create a table of contents for chapter when more than 1 page in the TOC if ($pages_listing->RecordCount() > 1 and EZPAGES_SHOW_TABLE_CONTENTS == '1') {?> <div id="navEZPagesTOCWrapper"> <h2 id="ezPagesTOCHeading"><?php echo TEXT_EZ_PAGES_TABLE_CONTEXT; ?></h2> <div id="navEZPagesTOC"> <ul> <?php while (!$pages_listing->EOF) { // could be used to change classes on current link and toc (table of contents) links if ($pages_listing->fields['pages_id'] == $_GET['id']) { ?> <li><?php echo CURRENT_PAGE_INDICATOR; ?><a href="<?php echo zen_ez_pages_link($pages_listing->fields['pages_id']);?>"><?php echo $pages_listing->fields['pages_title']; ?></a></li> <?php } else { ?> <li><?php echo NOT_CURRENT_PAGE_INDICATOR; ?><a href="<?php echo zen_ez_pages_link($pages_listing->fields['pages_id']); ?>"><?php echo $pages_listing->fields['pages_title']; ?></a></li> <?php } $pages_listing->MoveNext(); } ?> </ul> </div> </div> <?php } ?> <div><?php echo $var_pageDetails->fields['pages_html_text']; ?></div> </div>
4 Sep 2018, 9:35 PM
#8
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

Re: EZ Page title shows but content doesn't

temporary fix was to rename the overriding template so as the master took over. But it would be nice to know what needed changing in the override one.

12 Sep 2019, 3:05 AM
#9
jonasrullo avatar

jonasrullo

New Zenner

Join Date:
Sep 2009
Posts:
27
Plugin Contributions:
0

Re: EZ Page title shows but content doesn't

Great find. I finally came across your post after searching high and low.

The solution is to make sure the template files for the version of Zencart you're using are the same. If you setup template files for a site years ago and upgraded the base install over time, the way the templates are coded has changed. They don't use the same functions in the same way on newer versions of the cart. The old templates were written one way, but the new style is different.
Although the whole site isn't broken, the instances where things are different enough fail.

I had an old template file from the original 1.3 or 1.4 ZC install. The installed version of ZC is 1.5.5f, which apparently is incompatible.
In my case, I copied the template file from an untouched 1.5.5f .zip (tpl_page_default.php in my case) into the current install. The functions that were failing as shown in the myDEBUG file are now not being used, so no more errors. And the page displays as expected.

Thanks mc12345678

16 Oct 2021, 4:23 PM
#10
zapme1 avatar

zapme1

Zen Follower

Join Date:
Jan 2011
Location:
Ohio
Posts:
114
Plugin Contributions:
0

Re: EZ Page title shows but content doesn't

jonasrullo:

Great find. I finally came across your post after searching high and low.

The solution is to make sure the template files for the version of Zencart you're using are the same. If you setup template files for a site years ago and upgraded the base install over time, the way the templates are coded has changed. They don't use the same functions in the same way on newer versions of the cart. The old templates were written one way, but the new style is different.
Although the whole site isn't broken, the instances where things are different enough fail.

I had an old template file from the original 1.3 or 1.4 ZC install. The installed version of ZC is 1.5.5f, which apparently is incompatible.
In my case, I copied the template file from an untouched 1.5.5f .zip (tpl_page_default.php in my case) into the current install. The functions that were failing as shown in the myDEBUG file are now not being used, so no more errors. And the page displays as expected.

Thanks mc12345678

Thanks so much!
This thread just helped me a lot! :D

I'm upgrading from 1.3.9h to 1.5.7c and (3) of my EZ-Pages only displayed the title!
I used the tpl_page_default.php file from the "default template", and modified my 'old' tpl_page_default.php with the updated code!
Worked GREAT!

Thanks again.... :cool: