Thread: page_2 question

Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Oct 2007
    Location
    Emporia, Kansas
    Posts
    1,762
    Plugin Contributions
    0

    Default page_2 question

    Is there a way to rename these pages t suit the content. I know to go to enlish files/page_xx and change name there inside then also in the define pages to add content but

    how to rename the file to something else.php so that it will come up in location bar as that name instead of pag_xx

    does that make sense

    same for ezpages...if I use and external link then I do not get the store decor and have to do all that in editor but using ezpages with no external link and they create on also give you the pagexx in the location bar.

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

    Default Re: page_2 question

    Quote Originally Posted by DarkAngel View Post
    Is there a way to rename these pages t suit the content. I know to go to enlish files/page_xx and change name there inside then also in the define pages to add content but

    how to rename the file to something else.php so that it will come up in location bar as that name instead of pag_xx

    does that make sense

    same for ezpages...if I use and external link then I do not get the store decor and have to do all that in editor but using ezpages with no external link and they create on also give you the pagexx in the location bar.
    Once you've decided on the name, you'd go to includes/filenames and define the new name. It has to be done in two places. Around line 63 and 111.

    Then, you will need to change the page_2.php in includes/languages/english or the appropriate override file.

    Same for tpl_page_2_default in your override template's templates folder.

    Those three files should fix it.
    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
    Oct 2007
    Location
    Emporia, Kansas
    Posts
    1,762
    Plugin Contributions
    0

    Default Re: page_2 question

    Quote Originally Posted by dbltoe View Post
    Once you've decided on the name, you'd go to includes/filenames and define the new name. It has to be done in two places. Around line 63 and 111.

    Then, you will need to change the page_2.php in includes/languages/english or the appropriate override file.

    Same for tpl_page_2_default in your override template's templates folder.

    Those three files should fix it.

    thanks so very much

    another question was just asked of me...sitemap: is it possible to make it be 3 columns vs the one long one I figured out how to arrange it this way but client would like to possibly have 3 columns.

    I tried to get her to understand that most likely the categories/products part stays as is since it doesn't seem to look like it can be "butchered" (rearranged) in any way.


    Attachment 12881
    Last edited by DarkAngel; 11 Aug 2013 at 06:09 AM.

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

    Default Re: page_2 question

    When doing a three-column div output like Zen Cart is out of the box you have to set the divs and the css to a particular sequence in order to have the columns show up in the browser as left, middle, and right. It's one of the reasons things can get so screwed up if someone tries to "delete" a column in a php file and why the geniuses at ZC have set up switches to turn columns on and off at will.

    Now, all you need to do for the client is set up that particular sequence inside the original middle column without messing up any of the wonderfulness that is Zen Cart. But that's not all. You'll need to accurately tell Zen Cart exactly what goes in ALL the new columns.
    For an extra degree of difficulty, let's make sure that the columns are even. Easy in Word, right? Not so easy in the sitemap when we are using a lot of code to pull data in.

    Worst of all..... One bad bit of code and the confused SE is not going to bother with reading the sitemap.

    I would advise the customer that putting lipstick on this pig would require the purchase of Revlon AND Maybelline. I would venture to say that most customers use search and seldom even glance at the sitemap.

    If it's their way or the highway, Google three column div layout and take a look at some of the examples. One of the best is http://matthewjamestaylor.com/blog/perfect-3-column.htm.
    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.

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

    Default Re: page_2 question

    Did I do this right:

    includes/filenames.php and changed to this ...

    define('FILENAME_DEFINE_PAGE_2', 'define_about_fragrance_faq');
    define('FILENAME_DEFINE_PAGE_3', 'define_ordering_information');

    and

    define('FILENAME_PAGE_2', 'about_fragrance_faq');
    define('FILENAME_PAGE_3', 'ordering_information');


    do I need to add the extension?

    then went to includes/english/over-rides folder and changed the actual names of the files to
    ...
    about_fragrance_faq.php
    ordering_information.php

    went to templates/my template/tpl_page_2_default.php and the one for page 3 and changed their names approriately also but when I go to sitemap I get a page not found.

    what did I do wrong?

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

    Default Re: page_2 question

    UPDATE: tried this way too:


    includes/filenames.php:
    define('FILENAME_DEFINE_ABOUT_FRAGRANCE_FAQ', 'define_about_fragrance_faq');
    define('FILENAME_DEFINE_ORDERING_INFORMATION', 'define_ordering_information');

    define('FILENAME_ABOUT_FRAGRANCE_FAQ', 'about_fragrance_faq');
    define('FILENAME_ORDERING_INFORMATION', 'ordering_information');

    in english/my-template folder/english.php is now:
    define('BOX_INFORMATION_ABOUT_FRAGRANCE_FAQ', 'About Fragrance FAQ');

    in templates folder have renamed the tpl_page_2_default file to tpl_about_fragrance_faq_default.php as well as page_3.php in there

    includes/english/html_includes/my-template/page_2 and 3 files are also named accordingly


    I then go to the sitemap and the page shows correct names -- hovering shows /index.php?main_page=about_fragrance_faq
    but when clicked still leads to the page not found.

    I know I probably did something terribly wrong somewhere so please be kind and tell me what I dood wrong.

    in tpl_site_map_default the code is now:
    <li><?php echo '<a href="' . zen_href_link(FILENAME_ABOUT_FRAGRANCE_FAQ) . '">' . BOX_INFORMATION_ABOUT_FRAGRANCE_FAQ . '</a>'; ?></li>
    <?php } ?>

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

    Default Re: page_2 question

    Think my brain was not if full gear for this. Let's regroup. Be sure and think override where appropriate.

    YOUR_ADMIN english.php around line 168 -- change 'Page 2' to 'About Fragrances' or whatever is appropriate. Do a similar change for 'Page 3' on the next line. This is BOX_TOOLS_DEFINE_PAGE_#

    YOUR_ADMIN
    define_pages_editor.php around line 36 -- change 'Page 2' to 'About Fragrances' or whatever is appropriate. Do a similar change for 'Page 3' on the next line. This is TEXT_INFO_PAGE_#

    english.php around line 149 -- change 'Page 2' to 'About Fragrances' or whatever is appropriate. Make sure this is done to the english.php in your override of includes/your_templae/english.php. Do the same for 'Page 3' on the next line. This is BOX_INFORMATION_PAGE_#

    filenames.php would be what you did before so you shouldn't have to touch them and you don't add the .php to them. Since the includes/filenames.php will be overwritten on upgrade, you will need to keep a record of your changes. I don't think anything would be gained here by breaking out the page_2 and page_3 entries into includes/extra_datafiles/extra_filenames.php. A lot of work when you can copy the changed filenames.php to a storage folder for future reference.

    Also, the rename of the page_#.php files in the english directory was correct BUT you will want to move them into the override (english/your_template/) so they won't be lost in an upgrade.

    I should NOT have told you to change the tpl_page_#_default.php as they need to remain as they were.

    You've renamed the actual files already so that should do it. Of course, if the more_information.php is not turned on in the Layout Boxes Controller, you won't see any of it.

    Sorry for the glitch. Let me know if this works.

    Off to bed as the grands will be up early wanting to be fed.
    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.

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

    Default Re: page_2 question

    ok, will redo and add newer files you posted to the mix...

    right now put all back to the way they were...lol

    will mess with it later and keep you posted

    thanks so very much for this help, am learning

  9. #9
    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.

  10. #10
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,682
    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.

 

 
Page 1 of 2 12 LastLast

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