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 :D
Nick
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);
?>
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 :smile:
Nick
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.
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 :smile:
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>
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.
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']
Re: Adding another text section to homepage
I figured it out. Thanks for all the help.
Re: Adding another text section to homepage
Glad you got it sorted :P
Nick
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.:clap: