Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Форуми / Cotonti / Skins / Sort List Row Desc .tpl

How can i sort my list page by Desc

#1 05.04.2016 20:25

How can i sort my ? 

I am aware how to do it with a link:  index.php?e=page&c=data&s=desc

how can i do this in my .tpl  thank you.


    <!-- BEGIN: LIST_ROW -->
<div   style="margin:10px; width:560px; float:left;">	

    <div   class="row-fluid">
      <div  class="span12" >
      <!-- ENDIF -->
        <!-- IF {LIST_ROW_DESC} --><p>{LIST_ROW_DESC}</p><!-- ENDIF -->
        <!-- IF {PHP.usr.isadmin} --><p>{LIST_ROW_ADMIN} ({LIST_ROW_COUNT})</p><!-- ENDIF -->
          <!-- IF {LIST_ROW_TEXT_IS_CUT} --><br /><a href="{LIST_ROW_URL}" class="btn btn-small btn-primary">{PHP.L.ReadMore}</a><!-- ENDIF -->
      </div><!-- /span12 -->
    </div><!-- /row-fluid -->
    <!-- END: LIST_ROW -->


#2 07.04.2016 02:57

Are you speak about output some UI elements to control pages sorting mode within category list? If so...

  1. Some of the fields had built-in controls accessed ftom TPL by `{LIST_TOP_*}`, where * is field name, like `TITLE`
  2. Description field do not have autogenerated tags, but you can generate if youself, some way like this:

In your TPL:

<a href="{PHP.c|cot_url('page','c=$this&s=desc&w=asc')}" rel="nofollow">{PHP.R.icon_down}</a>
<a href="{PHP.c|cot_url('page','c=$this&s=desc&w=desc')}" rel="nofollow">{PHP.R.icon_up}</a> {PHP.L.Description}

So you get something like this:


By the way — i'd open corresponding issue on github (#1506).
правильный хостинг —
#3 07.04.2016 08:08

Hi thank you for your response, i need to sort the output without any UI . I need to sort the output by default. 

#4 07.04.2016 10:31

You can configure `default sort mode` for certain catagory:  Administration panel → Extensions → Pages → Structure → Catagory → Config, options `Sorting column` and `Sorting direction`.
правильный хостинг —
#5 07.04.2016 17:06

That was exactly what i wanted, thank you!!!!