Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2011
    Posts
    6
    Plugin Contributions
    0

    Default How do I display EZ-Pages on main page?

    I'm looking to use the EZ-Pages as a way of building very easy to manage content sections. Example: Open up the homepage, and in the center content area various EZ-Pages would be stacked beneath each other. One EZ-Page would be of Youtube videos, then another would be of race event updates (we are a drag racing company). I would just like to avoid managing all this content under define_main_page.php.

    If anyone can tell me if this is possible, as of right now I've only found the way to display certain specific product pages upon opening the home page.

    Thanks!

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: How do I display EZ-Pages on main page?

    Quote Originally Posted by dmcracing View Post
    I would just like to avoid managing all this content under define_main_page.php.
    That's the only way I can think of to do it. There's no built-in facility to display EZ page links on the main page.

  3. #3
    Join Date
    Sep 2011
    Posts
    6
    Plugin Contributions
    0

    Default Re: How do I display EZ-Pages on main page?

    There has got to be a way to modify the tpl_index_default.php file and add a requirement to display an ezpage. I mean if you have the capability to show product categories and sort their order, it stands to reason a savvy PHP guru who is not myself, could make this dream into a reality. I'll keep plugging away at it and share any breakthroughs should there be one.

    Thanks

  4. #4
    Join Date
    Nov 2012
    Posts
    3
    Plugin Contributions
    0

    Default Re: How do I display EZ-Pages on main page?

    Add something like this to tpl_index_default.php:

    Code:
    <?php $my_content = $db->Execute("select * from " . TABLE_EZPAGES . " where pages_id=3"); ?>
    	<h2><?php echo $my_content->fields['pages_title']; ?></h2>
    	<?php echo $my_content->fields['pages_html_text']; ?>
    You'll need to change 'pages_id=3' to match whatever ezpage ID you want to pull the content from.

    If you wanted to have a summary of the content from this page and a link to 'Read More' you'd do something like:

    Code:
    <?php
    $my_content_id = 3;
    $my_content = $db->Execute("select * from " . TABLE_EZPAGES . " where pages_id=$my_content"); ?>
    
    <h2><?php echo $my_content->fields['pages_title']; ?></h2>
    <?php echo zen_trunc_string(zen_clean_html(stripslashes($my_content->fields['pages_html_text'])), 200); ?>
    <div><a href="<?php echo zen_ez_pages_link($my_content_id); ?>">Read more &gt; &gt;</a></div>
    Here I'm setting a var to store the ezpage ID ($my_content_id). You can change the length of the truncated text by setting a different value where it says '200'.
    Last edited by SKWebDev; 16 Nov 2012 at 01:07 PM.

  5. #5
    Join Date
    Nov 2012
    Posts
    3
    Plugin Contributions
    0

    Default Re: How do I display EZ-Pages on main page?

    Correction to the above code (there was an error including the id in the sql query and I improved the HTML slightly):
    Code:
    <?php
    $my_content_id = 3;
    $my_content = $db->Execute("select * from " . TABLE_EZPAGES . " where pages_id=$my_content_id"); ?>
    
    <h2><?php echo $my_content->fields['pages_title']; ?></h2>
    <p>
    <?php echo zen_trunc_string(zen_clean_html(stripslashes($my_content->fields['pages_html_text'])), 200); ?>
    <span style="float:right;"><a href="<?php echo zen_ez_pages_link($my_content_id); ?>">Read more &gt; &gt;</a></span>
    </p>
    Last edited by SKWebDev; 16 Nov 2012 at 03:13 PM.

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

    Default Re: How do I display EZ-Pages on main page?

    Do you absolutely want to use the ez-pages editor to create the content, as opposed to the define pages editor? If you just don't want everything crammed into one define_main_page.php file, you could use Editable Centerboxes from Plugins. This will let you insert up to nine centerboxes which can be styled any way you like, positioned in several locations on the homepage or other pages, and edited in the define pages editor. It also now lets you pull in standard sideboxes and display them in the center column if you want.

 

 

Similar Threads

  1. Display slideshow at main page and hide in other pages like new_products
    By ritesh.shrestha in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 16 Sep 2011, 05:50 PM
  2. How to display categories in main content area of page?
    By hema.s in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 14 Jul 2009, 06:30 PM
  3. How To Display Log In Box on Main Page?
    By scottdev in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 3 Jun 2009, 02:18 AM
  4. how to display my products on main pages like this
    By harz in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 9 Oct 2008, 07:07 PM
  5. How to display all products at main page?
    By Chepster in forum General Questions
    Replies: 3
    Last Post: 7 Feb 2007, 11:27 AM

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