Jump to content

Implementing repeater into html page


Recommended Posts

<section class="krown-latest-portfolio clearfix alt col-4">
    <div class="portfolio-items clearfix">
        <?php foreach($page->PortfolioRepeater1 as $c)?>
        <?php { ?>
        <div class="portfolio-item alt advertising website-design">
            <a href="">
                <img src="
                    <?php echo "{$c->Portfolio1->url}"; ?>" width="218" height="164" alt="1000 Jobs" />
                    <div class="alt-hover">
                            <div class="caption">
                                    <?php echo "
                                    <p>{$c->PortfolioCaption1}</p>"; ?>
                                <span class="category">
                                    <?php echo "
                                    <p>{$c->PortfolioUrl1}</p>"; ?>
                                <div class="folio like">
                                    <span class="post-like">
                                        <i class="krown-icon-heart-1"></i>
            <?php } ?>
            <?php  ?>


All repeater fields displayed correctly on my portfolio.php page but the problem is when I " Add Item", second item did not appear as second item on portfolio.php instead it replaced the first item.

Currently the portfolio.php looks like http://pesisirbrand.com/portfolio/ , it suppose to look exactly like this : http://www.modernmarketingpartners.com/portfolio/

Can anybody help me fix the code above ? 

Thank you.

Edited by LostKobrakai
Moved out of tutorials
Link to comment
Share on other sites

I'd suggest using this to create the foreach. It's less error prone than using brackets. 

<?php foreach($a as $b) : ?>
<?php endforeach; ?>

The loop itself seems to ok, so maybe take a look at the output of this just before the foreach:

<?php echo $page->PortfolioRepeater1->count(); ?>

Also having <p> tags inside of <span> or <h3> is not allowed by html standards, so maybe correct this. 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...