• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: LISE – orderby not working with action="category"?
PostPosted: Tue Jan 07, 2020 10:18 pm 
Offline
Translator
Translator

Joined: Tue Jan 22, 2008 9:57 am
Posts: 178
Trying to sort LISE items by creation date but nothing changes whatever I do.

\$1:
{LISEDownloads action='category' category='example1,example2' show_items=1 orderby='item_created|DESC'}


Is there something I’m missing?


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: LISE – orderby not working with action="category"?  Topic is solved
PostPosted: Tue Jan 07, 2020 11:41 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 987
Location: Victoria, BC
As it's using the category array and not the item array, I don't think you can achieve this using parameters in a single module call. You could probably add a summary call to each category in the category template and apply the sorting there.

So your category template would be something like:
\$1:
<!-- categories -->
<ul>
{foreach from=$categories item=category}
  <li class="category-{$category->alias}">
    <a class="category-name" href="{$category->url}">{$category->name} ({$category->items|count})</a>
    {if $category->items|count > 0}
    <ul>
      {LISEtest category=$category->alias orderby='item_created|DESC' template_summary='list'}
    </ul>
    {/if}
  </li>
{/foreach}
<ul>
<!-- categories //-->


with the module call being:
\$1:
{LISEtest action='category'}


Then create a summary template something like:
\$1:
{if $items|@count > 0}
  {foreach from=$items item=item}
    <li>{$item->title}</li>
  {/foreach}
{/if}

_________________
Not getting the answer you need? CMSMS support options


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: LISE – orderby not working with action="category"?
PostPosted: Wed Jan 08, 2020 9:07 am 
Offline
Translator
Translator

Joined: Tue Jan 22, 2008 9:57 am
Posts: 178
Oh man, that’s more complicated than I expected. So, my category template looks like this:
\$1:
<!-- categories -->
<div class="downloads">
{foreach $categories as $category}
   {*$category|@print_r*}
   <!-- start loop{$category@iteration} -->
   {if $category->depth == 1}
      {if $category->prevdepth > 1 && $category@iteration != 1}
      </ul>
   </div>
   <!-- end category -->
      {/if}
   <div class="kategorie depth{$category->depth} prevdepth{$category->prevdepth}" id="{$category->alias}">
      <h3>{$category->menutext}</h3>
      {if $category@last}
      <div class="mitteilung hinweis">Momentan gibt es nichts zum Herunterladen.</div>
   </div>
         {continue}
      {/if}
      <ul>
   {else}
      <li class="depth{$category->depth} prevdepth{$category->prevdepth}">
      {if !empty($category->datei)}<a href="{uploads_url}/downloads/{$category->datei}">{/if}
         {$ext=$category->datei|pathinfo:$smarty.const.PATHINFO_EXTENSION|lower}
         {if $ext == 'jpg' || $ext == 'jpeg' || $ext == 'png' || $ext == 'gif' || $ext == 'tif' || $ext == 'tiff'}
            {CGSmartImage src="{uploads_url}/downloads/{$category->datei}" filter_resize="w,150" quality="86"}
         {/if}
         {$category->menutext}
      {if !empty($category->datei)}</a>{/if}
      {if !empty($category->beschreibung)}<div class="beschreibung">{$category->beschreibung}</div>{/if}
      {if !empty($category->datum)}<div class="datum">{$category->datum}</div>{/if}
      </li>
      {if $category@last}
         </ul>
      </div>
      <!-- last -->
      {/if}
   {/if}
<!-- end -->
{/foreach}
</div>
<!-- categories //-->

and this is what it looks like in reality:
https://tinyurl.com/yhdqqrma

(the two columns are two separate module calls; the important one is the one in the left column which calls several categories)

I’ve also defined a few custom fields. Basically what I need is sorting by date (specified in custom field) in descending order. ???


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: LISE – orderby not working with action="category"?
PostPosted: Wed Jan 08, 2020 3:13 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 987
Location: Victoria, BC
I don't think it's as complicated as you might think. Just don't use show_items in the module tag, and add a module call (with default action, category, and your sort parameter) into your category template where you want to show items.

_________________
Not getting the answer you need? CMSMS support options


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: LISE – orderby not working with action="category"?
PostPosted: Thu Jan 09, 2020 3:28 pm 
Offline
Translator
Translator

Joined: Tue Jan 22, 2008 9:57 am
Posts: 178
Thanks, it’s not quite as I hoped to achieve it but it works nicely.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Hosting Nation - Managed CMSMS Hosting