Jump to content

Repeater field - clarification needed


Manfred62
 Share

Recommended Posts

Hi

continued working on my testpage. Now created tables with the help of the repeater module. So far no problem. Got all, what I expected.

Create needed fields, create repeater, include fields in repeater. Then I created a template repeater_namexx.php.

My first construct was (call in page template):

<?php foreach($page->namexx as $beilage) {
    echo $beilage->render();
    }  ?>

my template 'repeater_namexx.php' looks like this:

      <?php
        echo "<tr><td>{$page->beilage_menu}</td>";
        echo "<td>{$page->woche_menu}</td>";
        echo "<td>{$page->woche_preis}</td></tr>";  
       ?>

But what confused me: the repeater_ template ist not visible in the admín template area??

Then I worked on and changed the call in the page template:

      <?php foreach($page->beilagen as $beilage) {
        echo "<tr><td>{$beilage->beilage_menu}</td>";
        echo "<td>{$beilage->woche_menu}</td>";
        echo "<td>{$beilage->woche_preis}</td></tr>";  
      } ?>

so I can call this snippet with a simple include into the page. Also I deleted the repeater_template.php. All running fine so far.

But under the admin - repeaters - name... settings I can still see/choose the repeater_name.. templates?

Also I always have 3 unpublished empty entrys. After deleting them, they always return to stay.

post-1027-0-11027100-1361535411_thumb.jp

Could someone explain all this behaviours? Did I mixed up something in working order?

thanks in advance

Link to comment
Share on other sites

But what confused me: the repeater_ template ist not visible in the admín template area??

You can see it if you click "filter > show system templates". There's a reason why it's hidden as a system template though, so it's not good to change the settings of a repeater template. 

But under the admin - repeaters - name... settings I can still see/choose the repeater_name.. templates?

A template is a data type. A template-file is a file, related to the data type. If you delete the template-file, it doesn't delete the template. 

Also I always have 3 unpublished empty entrys. After deleting them, they always return to stay.

Those are called "ready pages". If you don't want it to keep ready pages, you can set the ready pages to "0" in the your repeater field's settings. 

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

×
×
  • Create New...