Adding filtered list into shortcode Help (works in template)

I was wondering if someone can point me in the right direction. I have the following filtered list (based on type, and param) working fine. I am wanting to add this to a shortcode, so I can change “testee” to a variable.

  {{ range where (where .Data.Pages "Type" "google-ranking-factors") ".Params.rftype" "!=" "testee"}}
  {{ .Render "summary"}}
  {{ end }}

I get the following error:

ERROR 2017/06/15 20:03:05 error processing shortcode “shortcodes/ranking-factor-list” for page “google-ranking-factors\”: template: shortcodes/ranking-factor-list
.html:1:27: executing “shortcodes/ranking-factor-list” at <.Data.Pages>: can’t evaluate field Data in type *hugolib.ShortcodeWithPage

Any ideas where I might be going wrong? Is this even possible?

Shortcodes don’t work like that. Read the Docs:

Try $.Site.Pages

Although you’ll need to do more than to pass in the variable…