Hi:
I’ve imported a site from EVO to REVO and i’m migrating Ditto to GetResources.
Snippets works fine, but I need to sort by TV from this values: 10, 9.5, 9, 8.5, etc.
Using DITTO: &orderBy=`numbers DESC` (this paremeters works fine)
Using GetResources: &sortbyTV=`numbers` &sortdirTV =`DESC` (9.5, 9, 8.5, 10) Number 10 is in the end of the list.
What should I do? (Sorry for my english)
Cheers
Hi,
Think I may have found a bug in getResources. The problem involves &showUnpublished, &showHidden and &showDeleted.
I am using the following call:
[[!getResources? &parents=`[[*slider-id]]` &resources=`[[*slider-resource]]` &showUnpublished=`0` &limit=`10` &sortby=`menuindex` &sortdir=`ASC` &hideContainers=`1` &includeTVs=`1` &processTVs=`1` &tpl=`slideshow-getr-temp`]]
When just &parents is used, unpublished, hidden and deleted resources are removed from the output, which is correct. However, when &resources is used and &parents is blank, unpublished, hidden and deleted resources are still in the output. They are are only removed when the deleted resources are purged from the manager.
Has anyone else experienced this or know of a solution?
If it is a bug where should it be logged?
Thanks
I want to display the latest 2 news articles on my hope page, the problem is article 1 and article 2 uses different templates. I can display the latest article by:
[[!getResources? &parents=`10` &limit=`1` &tpl=`article1` &includeContent=`1` &includeTVs=`1` &processTVs=`1`]]
is there a way to exclude latest article and display the second latest. I know that i can use "&resources=`-[id]`" but don’t know how to find latest articles id, it should be something like this:
[[!getResources? &parents=`10` &limit=`1` &tpl=`article2` &resources=`-[id of the latest article]` &includeContent=`1` &includeTVs=`1` &processTVs=`1`]]
Thanks for any help.
Quote from: OpenGeek at Mar 19, 2011, 10:41 AM
I have asked the submitter to resubmit.
Updated already.
This is the web: the only thing you know about who will come is that you don't know who will come.
I have an issue with template chunk’s output, which I guess comes from caching. I want to use 3 chunks to provide templates for `tpl`, `tplFirst` and `tplLast`.
tpl = res.list
...
tplFirst = res.list-first
Some content before the list...
[[$res.list]]
tplLast = res.list-last
[[$res.list]]
Some content after the list...
The idea is to use a single chunk for list items (`tpl`) and add custom content before and after the list. For easier maintenance a single `tpl` is used and called from other template chunks.
The problem is that both `tplFirst` and `tplLast` templates return output for the same resource. That means the first resource is repeated as the first and last item on the list. If used with getPage this happens on every page. I played with uncached calls to `$res.list` but either got no output or no change.
How to solve it?
This is the web: the only thing you know about who will come is that you don't know who will come.
I have also another issue, similar to the previous one, when I want to output a descriptive content type for a resource being listed. In the `tpl` chunk I call the Rowboat snippet like this:
[[!Rowboat@content-type?where=`{"id:=":"[[+content_type]]"}]]
Which I expect to fetch a proper value in the `name` column from `modx_content_type` table and output it to a placeholder `[[+content-type]], which I then put somewhere in the `tpl` chunk.
It works, however the same value from first list item is applied to all resources being listed. Again, I played with uncaching chunk calls but to no avail.
Again, how to solve it?
This is the web: the only thing you know about who will come is that you don't know who will come.