Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Define Page Editor changes having no effect

Define Page Editor changes having no effect

Locked

Views: 1,953

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
7 Jan 2009, 9:52 PM
#1
andymcc77 avatar

andymcc77

New Zenner

Join Date:
Sep 2008
Posts:
20
Plugin Contributions:
0

Define Page Editor changes having no effect

Hi,

I'm using zen 1.3.8 and have the following problem.

I created a new page following thw guide at http://www.zen-cart.com/wiki/index.php/Creating_new_pages

This worked fine but the page was not in the define editor drop down in the admin area, I followed another guide and got the page in the dropdown.

My problem is when I edit via admin, my page looks as it does on the website and I can change it fine, however, regardless of what I change it's not showing up on the actual website.

It looks as though define page is looking at one copy of my page and the actual website is looking at another.

Does anyone have any ideas why this might be ?

Thanks,

Andy

7 Jan 2009, 10:03 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Define Page Editor changes having no effect

Did you add a blank copy in the:
/includes/languages/english/html_includes

so that there is something to override? :unsure:

8 Jan 2009, 6:42 PM
#3
andymcc77 avatar

andymcc77

New Zenner

Join Date:
Sep 2008
Posts:
20
Plugin Contributions:
0

Re: Define Page Editor changes having no effect

Hi,

I have a copy of define_findus.php in

includes\languages\english\html_includes

and also in

includes\languages\english\html_includes\MYTEMPLATE

Regards,

Andy

8 Jan 2009, 6:49 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Define Page Editor changes having no effect

And the one in your template directory is set to 777?

8 Jan 2009, 6:53 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Define Page Editor changes having no effect

Also, when you make the change ... look at the path to the file, what do you see where it says:
Editing File:

8 Jan 2009, 7:13 PM
#6
andymcc77 avatar

andymcc77

New Zenner

Join Date:
Sep 2008
Posts:
20
Plugin Contributions:
0

Re: Define Page Editor changes having no effect

Hi,

I've discovered that admin is updating the following file:-

includes/languages/english/html_includes/MYTEMPLATE/define_findus.php

and the website is showing the content based on:-

includes\templates\template_default\templates\tpl_findus_default.php

Not sure how I link these up correctly.

Regards,

Andy

8 Jan 2009, 7:55 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Define Page Editor changes having no effect

First, test something ...

Edit the: define_privacy.php

Do you see the change in the Catalog?

If you see that change, then it is your files that you cloned ...

If you don't see that change, then it is something else moofed up ...

9 Jan 2009, 7:43 PM
#8
andymcc77 avatar

andymcc77

New Zenner

Join Date:
Sep 2008
Posts:
20
Plugin Contributions:
0

Re: Define Page Editor changes having no effect

Hi,

The editor works fine on the standard pages, that's what I would expect.

I am new to zencart and have created my first new page, so it's no surprise that is where the fault is, I obviously haven't created the page correctly so that it is editable via admin.

Given the two files I have mentioned (incidentally if delete the file tpl_findus_default, the page the editor is altering still doesn't show as the web page) I must have a problem with my files somewhere, the question is where and how do I fix it ?

I wanted to create a new page (contains html to incorporate a google map) and ensure it is available in the admin page edit dropdown, so that the simple text parts of the page are easily editable for others.

I just wanted to create a page which meets the following criteria:-

  1. I can place anything I want in it including PHP/HTML etc (ok)
  2. It can be linked to from other pages (ok)
  3. It is editable via the admin page editor dropdown (problem)

Does anyone have any ideas ? - I would imagine this is a very basic and common requirement for new users.

10 Jan 2009, 2:52 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Define Page Editor changes having no effect

Compare your files to the set for Page 2 ...

/includes/modules/pages/page_2/header_php.php
/includes/templates/template_default/tpl_page_2_default.php
/includes/languages/english/page_2.php
/includes/languages/english/html_includes/define_page_2.php

Check where you stored the defines for the new page, example for page 2 uses:

define('FILENAME_DEFINE_PAGE_2', 'define_page_2');
define('FILENAME_PAGE_2', 'page_2');

Check for the activation key that controls the display, page 2 uses:
DEFINE_PAGE_2_STATUS

Watch for any typos ...

I like Beyond Compare from scootersoftware.com for doing these kinds of comparisons ...

The Developers Tool Kit is also helpful to locate what is on the server ...

15 Jan 2009, 9:21 PM
#10
andymcc77 avatar

andymcc77

New Zenner

Join Date:
Sep 2008
Posts:
20
Plugin Contributions:
0

Re: Define Page Editor changes having no effect

Hi,

I found that the only reason my page looked ok in the browser was that I had put the actual page content into the file tpl_findus_default which I have now corrected.

What happens now is that the web page shows no content, I think the reason must be that the line

 $define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_FINDUS, 'false');
```is not pulling in the correct page for some reason

I did find where constant FILENAME_DEFINE_FINDUS is defined and it's in includes/extra_datafiles/findus.php which is as I was told to do according to the guide at [http://www.zen-cart.com/wiki/index.php/Creating\_new\_pages](http://www.zen-cart.com/wiki/index.php/Creating_new_pages)

The file define_findus.php contains some text and exists in both
 includes/languages/english/html includes and also
 includes/languages/english/html includes/MYTEMPLATE

Something is still amiss somewhere, I notice there are no equivalents in the extra_datafiles directory for main_page, page_2 etc. which I thought was a bit odd.

Any ideas ?

Andy
15 Jan 2009, 9:35 PM
#11
andymcc77 avatar

andymcc77

New Zenner

Join Date:
Sep 2008
Posts:
20
Plugin Contributions:
0

Re: Define Page Editor changes having no effect

I should have added the findus.php file in the includes/extra_datafiles directory simply contains:-

define(FILENAME_FINDUS, 'findus');

The above is as per the wiki guide, however as the constant FILENAME_DEFINE_FINDUS is used in the header.php file I also altered the FILENAME_FINDUS constant to read FILENAME_DEFINE_FINDUS, the difference when I changed this was I got a 404 error rather than simply no content.

16 Jan 2009, 12:28 PM
#12
andymcc77 avatar

andymcc77

New Zenner

Join Date:
Sep 2008
Posts:
20
Plugin Contributions:
0

Re: Define Page Editor changes having no effect

Hi,

Thanks for the help, I've now managed to solve this.

My problems where:-

I initially placed textual content for the page in tpl_findus_default, instead of just copying what is in an existing page, e.g. tpl_page_2_default

I then realised that to see the main content from the file in the html_includes directory the page status must be switched on via page status settings. When creating a new page the status is off by default, so you see no content.

In summary if you want to create a new page and be able to edit it via the admin panel, I would recommend basing all files on page_2 (or any existing page really), the three steps involved can be summarised as:-

  1. Follow instructions at http://www.zen-cart.com/wiki/index.php/Creating_new_pages
  2. Create content file at includes/languages/english/html_includes/YOURTEMPLATE/define_pagename.php
  3. Switch on the page using define page status section of the admin area, you must first insert a new entry in the configuration database or your new page will not show up in the define page status list, SQL required is
INSERT INTO `configuration` ( `configuration_title`, `configuration_key`, `configuration_value`,
`configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`,
`set_function`)
VALUES ('Define Page_5', 'DEFINE_PAGE_5_STATUS', '1', 'Enable the Defined Page 5 Link/Text?<br />0=
Link ON, Define Text OFF<br />1= Link ON, Define Text ON<br />2= Link OFF, Define Text ON<br />3= Link
OFF, Define Text OFF', 25, 100, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3''),');

Change pagenames above, as appropriate

Thanks,

Andy
:smile:

21 Mar 2009, 3:42 PM
#13
wambat avatar

wambat

New Zenner

Join Date:
Mar 2009
Posts:
17
Plugin Contributions:
0

Re: Define Page Editor changes having no effect

I can´t believe I´ve been grappling with this for DAYS!
And how is a mere mortal supposed to figure out the SQL commands that Andy has found to solve this problem?

Can someone tell me how to Quote : ¨you must first insert a new entry in the configuration database¨

Is this done with MyPhpAdmin ?