Thread: page_2 question

Results 1 to 10 of 17

Hybrid View

  1. #1
    Join Date
    Oct 2007
    Location
    Emporia, Kansas
    Posts
    1,762
    Plugin Contributions
    0

    Default Re: page_2 question

    Well will try it on test store anyway for incase I get a wild hair anywhere...LOL

    After seeing the trouble with getting the files to behave she has decided to just make then ezpages then I can just put the links into the sections she wants.

    as for the 3 column sitemap, she claims that her sitemap is already 3 columns, in all browsers i have and my daghters comp I see only 1 long column even sent her a screenshot

    she says she can set hers to 3 columns so will let her tell me how she dood it...even if I can not see it...not even on my site and I have the 3 column mod installed.

    thanks for helping me gain some knowledge.

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,684
    Plugin Contributions
    11

    Default Re: page_2 question

    Here's the things to consider in doing the page_# change.

    Let's take the two lines in the filenames.php for page_2
    define('FILENAME_DEFINE_PAGE_2', 'define_page_2');
    define('FILENAME_PAGE_2', 'Page 2');
    1. define -- This tells PHP that we are going to define a variable.
    2. ( -- denotes the beginning of the thing(s) to define.
    3. ' -- the beginning of a literal item. In this case, the variable itself.
    4. FILENAME_DEFINE_PAGE_2 and FILENAME_PAGE_2 -- here we are creating a variable that will be used wherever we need it in Zen Cart. Note that it is in ALL CAPS and the spaces are always replaced with an underscore.
      • We try to make the define in a way that it will jog our memory when we see it again. Thus, these defines tell us that we are going to be defining the define page and page for PAGE_2.
      • When we go to rename defines after the cart is installed, it's generally a good idea to not mess with the established variables. Especially variables for the PAGE_2, PAGE_3, etc. For example, PAGE_2 is found some 14 times throughout a standard ZC install. By not changing the variable we only have to make 5 changes.

    5. ' -- the end of a literal item. In this case, the variable itself.
    6. , -- the comma-space separates the variable from the name to be assigned to it. NOTE: This is always a comma followed by a space.
    7. ' -- The beginning of a literal item. In this case, the variable's assigned information.
    8. define_page_2 and Page 2 -- These are the actual information that Zen Cart will use whenever it sees the corresponding variable.
      • define_page_2 -- This is telling Zen Cart which file to look for when we want to edit the information on the page. Many variables will not have DEFINE as part of the variable, but the main page, contact us, conditions, etc. will have a DEFINE so that the Define Pages Editor can find them for edit. This is where you would put the define_about_fragrance_faq (used for your case - different for another user). It is lower case as Zen Cart will later use it to find a file for edit and files should at least start with lowercase.
      • Page 2 -- We've finally gotten to some information that the customer will see (If Page 2 is actually turned on). This is where you would put the About Fragrances (used for your case - different for another user). Notice that this looks more like what we would think of when we think of a name. It is often title case, gives a short description to the user, and can be used in a bullet list (like the sitemap) or as the heading to a page or group of information.

    9. ' -- The end of a literal item. In this case, the variable's assigned information.
    10. ) -- The end of the total define information. Inside the opening and closing parentheses, we should see both the variable and its assign. Each should be enclosed in a single quote and separated from each other by a comma space. IMPORTANT: This is where MANY folks make a mistake by accidentally losing one of the single quotes or the comma space. Even if you do NOT want the variable to show information to a customer, it must have the two single quotes. Looks like define('SOME_VARIABLE', '');
    11. ; -- The last character on the define line is the semicolon. It tells PHP to finish processing this line of code before going to the next. EXTRA INFO: You'll find the same semicolon at the end of a line in the stylesheet for the same reason. If the semicolon is missing in either the code or the css, you could get a rather interesting error.
    12. At this point, we have finished with these two lines. Using your variables for PAGE_2, they would now look like:
      • define('FILENAME_DEFINE_PAGE_2', 'define_about_fragrance_faq');
      • define('FILENAME_PAGE_2', 'About Fragrances');



    So, you see, we did not mess with the variable as it's used many places in the cart. We DID change variable information that the cart would need to find the page AND the information the customer would see.

    There are still other places in your_admin and the cart that would need to have the information for the variable change. That's the information inside the second set of single quotes.

    In your_admin, there is the your_admin/includes/languages/english.php and the your_admin/includes/languages/english/define_pages_editor.php.

    In the cart side, you would need to edit the includes/filenames.php (as shown above) and includes/languages/english.php. NOTE: The includes/languages/english.php should be saved to includes/languages/your_template/english.php. If one is already there, make sure to merge the existing includes/languages/your_template/english.php with your changes so you don't lose anything.

    Recap: When the redefine for PAGE_2 is finished, we will have modified a total of five variables' information and modified two files in YOUR_ADMIN and two in the cart.

    For the Super Programmers: Many are not aware that there is an override for certain items in the includes/folder. For example, if we wanted to add a PAGE_905 definition and not have it overwritten on upgrade, we could add the folder includes/extra_datafiles to the cart. In the includes/extra_datafiles folder we would create a page_905_filenames.php. It would look like the includes/filenames.php but would only include the defines for PAGE_905. When it came time to upgrade, those files would not be overwritten. I personally don't recommend this for changing PAGE_2 or other defines in the existing filenames.php until it can be proven that the extras (in this case includes/extra_datafiles/page_905_filenames.php) would overwrite any original settings in includes/filenames.php. Also, changing the PAGE_2 variables along with the variable information would involve 14 changes in 8 files versus the 5 changes in four files method above.

    I felt that I needed to be a little more alert and break this process down step by step for both you and others that stumble upon this post. I've tried to place the information close to the action so as to be better information versus more confusion. This is the way I would do this task but, I am open to any discussion pointing out discrepancies or improvements in the process.
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  3. #3
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,684
    Plugin Contributions
    11

    Default Re: page_2 question

    Of Course, there's something to change/add to the above instructions.

    In the filenames.php file for your example, we created the define for FILENAME_PAGE_2 and set it to About Fragrances -- WRONG!

    First of all, the original should have been defined as page_2 NOT Page 2.

    And... The change we should have made should have been about_fragrances.

    Then, you would go to includes/modules/pages and copy the page_2 folder renaming it about_fragrances.

    Hopefully, I can get the devs or moderator to fix this.

    POBODY'S NERFECT
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  4. #4
    Join Date
    Oct 2007
    Location
    Emporia, Kansas
    Posts
    1,762
    Plugin Contributions
    0

    Default Re: page_2 question

    thanks for the breakdown and it is good for me, should i decide to try on my own store or others that want to do the same.

  5. #5
    Join Date
    Jul 2013
    Location
    Lakewood, California, United States
    Posts
    66
    Plugin Contributions
    0

    Default Re: page_2 question

    Thank you for a most thorough "how-to." Perhaps the best I have read on the subject, and I have been looking!

  6. #6
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,684
    Plugin Contributions
    11

    Default Re: page_2 question

    Quote Originally Posted by DarkAngel View Post
    she says she can set hers to 3 columns so will let her tell me how she dood it...even if I can not see it...not even on my site and I have the 3 column mod installed.
    Perhaps she is saying that she see the three columns already presented in a standard ZC site map page?
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

 

 

Similar Threads

  1. Rename page_2 on url
    By longstockings in forum General Questions
    Replies: 0
    Last Post: 31 Jan 2011, 11:26 AM
  2. Extra Pages i.e. Page_2
    By val-ent in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 2 Feb 2009, 05:08 PM
  3. Page_2 Hyperlink
    By kikboxr777 in forum Basic Configuration
    Replies: 0
    Last Post: 24 Jan 2009, 08:58 PM
  4. A question about Page_2 etc
    By ginginca in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 14 Dec 2006, 11:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg