Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1
    Join Date
    Apr 2008
    Location
    Nottingham, UK
    Posts
    46
    Plugin Contributions
    1

    Default Adding another text section to homepage

    Hello,

    One of my clients wants an editable section of text adding to the bottom of his Zencart homepage for SEO purposes. I am thinking that maybe I could use an EZPage for this task, and just not have it show up on any menus.

    So I will need to pop in a bit of PHP to pull the page content from the database and display it on the page. I tried this:

    Code:
    <?php 
    $seo_text = "SELECT pages_html_text FROM ezpages WHERE pages_title='SEO'"; 
    print($seo_text); 
    ?>
    but it just displayed the text of the query, not the EZpage contents. Sorry for being a n00b, but what would i need to add to make this work?

    thanks

    Nick

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Adding another text section to homepage

    I'm not a mySQL expert, but this adapted from other database queries might work:
    PHP Code:
    <?php 
    $seo_text_query 
    "SELECT pages_html_text FROM ezpages WHERE pages_title='SEO'"
    $seo_text $db->Execute($seo_text_query);
    ?>

  3. #3
    Join Date
    Apr 2008
    Location
    Nottingham, UK
    Posts
    46
    Plugin Contributions
    1

    Default Re: Adding another text section to homepage

    Hi Glenn,

    Thanks for your quick reply, your comments put me on the right track and this code pulls out the EZPage content onto the page:

    Code:
    <?php 
    $page_query = $db->Execute("SELECT pages_html_text FROM ezpages WHERE pages_title='SEO'");
    $seo_text = $page_query->fields['pages_html_text'];
    echo $seo_text;
    ?>
    Cheers for your help

    Nick

  4. #4
    Join Date
    Jun 2008
    Posts
    12
    Plugin Contributions
    0

    Default Re: Adding another text section to homepage

    I'm trying to do the exact same thing for one of my clients. Can you tell me which file you edited with the new seo_text code to make the text appear on the home page? Thanks.

  5. #5
    Join Date
    Apr 2008
    Location
    Nottingham, UK
    Posts
    46
    Plugin Contributions
    1

    Default Re: Adding another text section to homepage

    Hi,

    I put it in right at the bottom of my tpl_main_page.php that is in my skin file template over-ride folder. The EZ-Page is called SEO. The code/page content could go anywhere I suppose, but my client wanted it off the bottom of the page. Hope this helps

    Nick

    Code:
    <div id="seo_content">
    	<?php 
        $page_query = $db->Execute("SELECT pages_html_text FROM ezpages WHERE pages_title='SEO'");
        $seo_text = $page_query->fields['pages_html_text'];
        echo $seo_text;
        ?>
    </div>
    
    </body>

  6. #6
    Join Date
    Jun 2008
    Posts
    12
    Plugin Contributions
    0

    Default Re: Adding another text section to homepage

    Thanks for the reply. I'm gradually figuring out how this whole cart is assembled. Can you help me find where to post the other piece of code (SELECT code)? Thanks.

  7. #7
    Join Date
    Jun 2008
    Posts
    12
    Plugin Contributions
    0

    Default Re: Adding another text section to homepage

    Actually, I got past the question in my previous post but keep getting this error:

    1146 Table 'mikoncor_mainstore.ezpages' doesn't exist
    in:
    [SELECT pages_html_text FROM ezpages WHERE pages_title='SEO']

  8. #8
    Join Date
    Jun 2008
    Posts
    12
    Plugin Contributions
    0

    Idea or Suggestion Re: Adding another text section to homepage

    I figured it out. Thanks for all the help.

  9. #9
    Join Date
    Apr 2008
    Location
    Nottingham, UK
    Posts
    46
    Plugin Contributions
    1

    Default Re: Adding another text section to homepage

    Glad you got it sorted

    Nick

  10. #10
    Join Date
    Dec 2004
    Posts
    1,031
    Plugin Contributions
    0

    Default Re: Adding another text section to homepage

    WOW. This is what I have tried to do for some time. Have tried to do it with the defines pages.

    I like this solution a lot better. With EZpages you can format the text the way you want and don't need to hard code the whole html into a file like others suggested. I love it. Thank you very much.
    Live and learn... the Zen way.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Copying a Section (category) of my Store to Another Site
    By shags38 in forum General Questions
    Replies: 2
    Last Post: 29 Feb 2012, 06:38 AM
  2. Adding text to homepage
    By gamenet in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 11 Oct 2010, 08:07 AM
  3. New Products for (Month) section on homepage
    By zidain in forum General Questions
    Replies: 5
    Last Post: 27 Dec 2009, 07:13 PM
  4. Adding text to homepage listing of products
    By webmiss in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 1 Nov 2008, 04:55 PM
  5. adding new section on homepage -
    By keylesslocks in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 25 Jan 2008, 06:46 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR