Jump to content

Failed to repeater on page


kradzcalypse
 Share

Recommended Posts

Hello,

I tried to create something like below but have failed.

Here's what I have done so far but it still didn't work even after following your step by step video tutorial (

) :

1) Created 3 fields :

- Title (text)

- Description (textarea)

- Thumbimage (image)

2) Created 1 repeater field :

- Thumbs

3) Added field from (1) to the repeater field details

4) Went to template "basic-page"

- added field Thumbs (repeater)

5) Created new page called main

- add information into all fields

6) Save and preview the page at  http://localhost:8888/processwire/main/

7) ABSOLUTELY NOTHING appear ??

mainpage.jpg

Link to comment
Share on other sites

Here are the html codes 

<section class="krown-latest-portfolio clearfix alt col-3 full-width-portfolio">
    <div class="portfolio-items clearfix">
        <div class="portfolio-item alt advertising website-design">
            <a href="portfolio/1000-jobs/index.html">
                <img src="
                    <?=$config->urls->templates;?>assets/wp-content/uploads/2015/07/1000-Jobs-218x164.png" width="218" height="164" alt="1000 Jobs" />
                    <div class="alt-hover">
                        <div>
                            <div class="caption">
                                <h3>1000 Jobs</h3>
                                <span class="category">Advertising, Website Design</span>
                                <div class="folio like">
                                    <span class="post-like">
                                        <span>0</span>
                                        <i class="krown-icon-heart-1"></i>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                </a>
            </div>
            <div class="portfolio-item alt branding content-marketing email-2 pr seo website-design">
                <a href="portfolio/optimum-safety-management/index.html">
                    <img src="
                        <?=$config->urls->templates;?>assets/wp-content/uploads/2015/05/Optimum_Thumbnail-218x164.png" width="218" height="164" alt="Optimum Safety Management" />
                        <div class="alt-hover">
                            <div>
                                <div class="caption">
                                    <h3>Optimum Safety Management</h3>
                                    <span class="category">Branding, Content Marketing, Email Marketing, PR, SEO, Website Design</span>
                                    <div class="folio like">
                                        <span class="post-like">
                                            <span>0</span>
                                            <i class="krown-icon-heart-1"></i>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </a>
                </div>
                <div class="portfolio-item alt branding content-marketing ecommerce paid-search seo social-media startup website-design">
                    <a href="portfolio/iconic-shop/index.html">
                        <img src="
                            <?=$config->urls->templates;?>assets/wp-content/uploads/2014/10/Iconic-Shop-218x164.png" width="218" height="164" alt="Iconic Shop" />
                            <div class="alt-hover">
                                <div>
                                    <div class="caption">
                                        <h3>Iconic Shop</h3>
                                        <span class="category">Branding, Content Marketing, Ecommerce, Paid Search, SEO, Social Media, Startup, Website Design</span>
                                        <div class="folio like">
                                            <span class="post-like">
                                                <span>0</span>
                                                <i class="krown-icon-heart-1"></i>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </a>
                    </div>
                    <div class="portfolio-item alt seo social-media website-design">
                        <a href="portfolio/brookside-veneers/index.html">
                            <img src="
                                <?=$config->urls->templates;?>assets/wp-content/uploads/2014/10/Brookside-Veneers-Marketing-218x164.png" width="218" height="164" alt="Brookside Veneers" />
                                <div class="alt-hover">
                                    <div>
                                        <div class="caption">
                                            <h3>Brookside Veneers</h3>
                                            <span class="category">SEO, Social Media, Website Design</span>
                                            <div class="folio like">
                                                <span class="post-like">
                                                    <span>0</span>
                                                    <i class="krown-icon-heart-1"></i>
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </div>
                        <div class="portfolio-item alt advertising branding">
                            <a href="portfolio/fc-lighting/index.html">
                                <img src="
                                    <?=$config->urls->templates;?>assets/wp-content/uploads/2014/10/FC-Lighting-Advertising-218x164.jpg" width="218" height="164" alt="FC Lighting" />
                                    <div class="alt-hover">
                                        <div>
                                            <div class="caption">
                                                <h3>FC Lighting</h3>
                                                <span class="category">Advertising, Branding</span>
                                                <div class="folio like">
                                                    <span class="post-like">
                                                        <span>0</span>
                                                        <i class="krown-icon-heart-1"></i>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </a>
                            </div>
                        </div>
                    </section>
Edited by LostKobrakai
fixed codeblock
Link to comment
Share on other sites

But you're not calling the repeater field anywhere in your template code. I also don't understand why you have all these references to Wordpress paths under your assets directory.

With a repeater field you want to be foreach'ing through each item in the field.

Read the section "Outputting Repeatable Fields" on this page: https://processwire.com/api/fieldtypes/repeaters/

If you still can't get it to work, show us your new code and we'll help you along.

Link to comment
Share on other sites

Yes, I want to know how to call the repeater from within the template.

Forget previous question.

Let say I have a template called /blog and a repeater called Blogposts which have 3 fields nested under it (PostTitle, PostContent, PosImages), how do I call it ?

This codes did not work correctly  :


                                                <?php foreach($page->BlogPosts as $c) { ?>
                                                <?php echo $c->BlogTitle; ?>
                                                <?php echo $c->BlogContent; ?> 
                                                <?php }?>

Please show me how to call the repeater. Thank you.

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
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...