Hi,
I am getting strange behaviours when I specify &outputSeparator=`` in my call to getResources.
Sometimes it does not render anything, sometimes it does a dump of Arrays for the found resources.
Either way, it is not helpful.
I am using it to generate a menu of the found resources (pretty common use), but the default outputSeparator is a newline "\n".
Browsers render this newline as a space, where I do not want an additional space in between my menu items. It messes with my menu hovers.
To get around this I had to specify &outputSeparator=`<!-- -->`
i.e. an empty comment.
Let me know if you don’t get these issues, and if I am doing something incorrectly.
-
☆ A M B ☆
- 2,213 Posts
I’ve been using this a lot on an upcoming site and noticed there isn’t a no result option.
It would be great if I could have &noresult=`chunk` instead of using If to replicate the function. Any chance of getting this added, or is there a reason this wasn’t added?
-
☆ A M B ☆
- 2,213 Posts
Could I use that to call a chunk? And i’m guessing I would just put everything else after that?
[[getResources:default=`<p>Nada</p>` &depth=`5`....]]
I’m using a template variable to sort with. For a TV of input type text and output type default, this works fine:
[[getResources? &sortby=`[[*Title]]`]]
But if the TV is of input and output type date it fails. I was expecting an output filter to work:
[[getResources? &sortby=`[[*Date:strtotime]]`]]
But it doesn’t. Thoughts?
Thanks for this. I didn’t see &sortbyTV or &sortdirTV documented anywhere; I guess I need to get in the habit of taking a look at the properties on snippets when I upgrade them.
Still, I can’t get it working. I assume that having the empty &sortby=`` in there is important. But whether I include it or not some resources are getting duplicated in the output. Not ALL, of course, and I can’t figure out the logic of which ones are getting duplicated--but which ones are duplicated changes when I change the sort order.
It’s a simple call with just 3 resources at the moment:
[[getResources? &tpl=`getResMainTpl` &parents=`[[*id]]` &sortbyTV=`Title` &sortdirTV=`ASC` &sortby=`` &includeTVs=`1` &processTVs=`1`]]
It actually works perfectly just plugging in the full TV tag in the &sortby property, but as I said I couldn’t get it to work with a date formatted TV.
So is there some sort of interaction between &sortby and &sortbyTV that is tripping me up here? Thanks again!