Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
hi. I'm from Brazil, I am in college web site design created repeatable regions to cade series of menu that carreca the PDF tasks, and my doubts.
the added lines are not sorted by creation they are lastly more I need that they are at the top for the students to see the last task more repeatable posted the region does not order by post.
the administrator the option to add line is always in low I need her in the top to add a line for that are many pdf that the client will load.
someone would have a way to help me am new on the couch.
thank

my menu page


<?php require_once( 'admin/cms.php' ); ?>
<cms:template title='tarefas' clonable='1' group='teste' nested_pages='1'>
<cms:repeatable desc='Faça seu upload aqui' label='tarefas em pdf' order='dec' name='tarefas'>
<cms:editable
name='tarefas'
label='tarefas em pdf'
type='file'/>

<cms:editable
type='nicedit'
label='Descrição'
name='descricao' />

<cms:editable
type='nicedit'
label='professor'
name='professor' />

<cms:editable
type='nicedit'
label='disciplina'
name='disciplina' />

<cms:editable
type='nicedit'
label='turma'
name='turma' />

</cms:repeatable>
</cms:template>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta name="description" content="jQuery Easy Accordion Plugin - A highly flexible timed horizontal slider able to show any kind of content" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title></title>

<cms:embed "css.php" />
<cms:embed "jscriptb.php" />

</head>
<body>
<div style="width:900px;height:auto;display: inline-block;position: relative;">
<form id="form1" runat="server">
<center>
<div style="width:900px;"><cms:embed 'menu.html' /></div>
</div>

<div style="width:900px;display: inline-block;position: relative;">


<cms:show_repeatable 'tarefas'>

<div class="CSSTableGenerator" style="padding-top:20px;width:900px;height:auto;overflow-x:hidden;display: inline-block;position: relative;">
<table >
<tr>
<td >
<p><cms:show descricao/></p>
</td>
</tr>
<tr>
<td >
<p><cms:show turma/></p>
</td>
</tr>
<tr>
<td >
<p><cms:show professor/></p>
</td>
</tr>
<tr>
<td >
<p><cms:show disciplina/></p>
</td>
</tr>
<tr>
<td>
<a href="<cms:show tarefas/>" class="_contentlinks">link para download</a>
</td>
</tr>
</table>
</div>

</cms:show_repeatable>




</br></br>
</div>
</div>
</center>
<!-- INICIO DO RODAPÉ -->

<!-- FIM DO RODAPÉ -->

</form>
</body>
</html>
<?php COUCH::invoke(); ?>
Hello and welcome, Marcus :)

Repeatable-regions, I'm afraid, only support manual reordering by drag-n-drop in the admin-panel.

That usually works fine as repeatable-regions are really not meant to hold too many rows.
Your problem seems to stem from the fact that you are trying to put in too many rows which soon becomes unwieldy.

My suggestion to you would be to use cloned pages instead - use a clonable template (say named 'uploads.php'), define all the editable regions in that you currently have within the repeatable block.

Now for each upload you can create a new cloned page and add all the data.

With this approach you can have potentially any number of upload records in the system. Also it'd be much easier to display them on the front-end as you like using cms:pages tag (e.g. can order, limit etc.).

Hope this helps.
So, can we make the order of the repeatable results that shows in html sorted 'descending' or 'ascending' automatically?
No. The show_repeatable tag loops through the items only in their order on the back end. I suppose you could figure out how to use the startcount parameter together with k_count and k_total_records to reverse the order, but it would be very convoluted.

Use a clonable template instead for more advanced features.
@Tim: How? I really need to reverse the order of my repetable-ed elements shown in the front-end.

In addition, I suggest Couch should consider advancing repeat tag feature. Yes cloning page is useful, particularly for cloning pages. But, when it comes to cloning elements in a page, repeat tag is the handier one.
I think this should work for descending order:
Code: Select all
<cms:show_repeatable 'my_repeatable'>
    <cms:capture into='my_repeatable_content'>
        <h2><cms:show my_repeatable_title/></h2>
        <img src="<cms:show my_repeatable_image/>"/>

        <cms:show my_repeatable_content/>
    </cms:capture>
</cms:show_repeatable>

<cms:show my_repeatable_content/>
6 posts Page 1 of 1