DS does not return empty result when required URL param is missing
This is an open discussion with 4 replies, filed under Troubleshooting.
Search
I can never remember, should the syntax in the Required Output Param be $tumblr-id
or {$tumblr-id}
?
This could be a separate issue (or “feature”) whereby a Data Source ignores a filter rule if the filter parameter doesn’t exist. In your DS filter I guess you have this:
{$tumblr-id}
You could change this to something like:
{$tumblr-id:0}
Which means “use $tumblr-id
if it exists, if not fall back to using a value of 0
) — since there will be no entries with an ID of 0
none will be returned. The Required URL Parameter was introduced to prevent having to use this more hacky technique, I think.
That solved it, thanks. (Both solution works, either use {$tumblr-id:0}
or remove the curly brackets from the “Required URL Parameter” field.
The “Sorting and limiting” fieldset sais “Use {$param}
syntax to limit by page parameters.” so I used {$tumblr-id}
. However, when changing it to $tumblr-id
it works as intended, I belive the “hint” in the sidebar should say:
Use
$param
syntax to limit by page parameters.
Thanks again Nick! It’s really a plesure working with Symphony and this community is awsome!
@pertoyra: You are right, this bothered me several times. If you find the time, would you please post this on the bug tracker at Github?
@michael-e: Sure thing, it’s saturday, I got all the time in the world since the girl and dog ain’t in town! ;)
EDIT: Issue added to github.
Create an account or sign in to comment.
I’m having a problem with a data source returning entries from a comments section connected to Tumblr entries.
I have a URL like this: http://example.com/blog/{$tumblr-type}/{$tumblr-id}
The DS
tumblr-comments
is filtering the comments section for comments with an ID of$tumblr-id
. However, when the URL does not contain$tumblr-id
theblog
page should return all entries of a certain$tumblr-type
without including comments.So set the “Required URL Parameter” for the
tumblr-comments
DS to$tumblr-id
and when debugging a URL lacking$tumblr-id
(eg. http://example.com/blog/text) it does still return comments, for all entries. According to the debug/params page the$tumblr-id
is empty.How come? I’m I missing something?