I’ve got two questions on grouping:
Is it possible to do something like .GroupBy "Param" <param_name>
(rather than using .GroupByParam
)?
.GroupBy
supports the default page variables, .GroupByParam
supports the rest of the user defined variables, but is it possible to do something like .GroupBy "Param" "my_param"
or .GroupBy "Params" "my_param"
rather than using .GroupByParam
?
Because .GroupBy
definetly supports page variables, it definetly does not support nonsensical variables such as “sdfdsfds” or user defined variables (both of which gives you the error message: error calling GroupBy: reflect: Elem of invalid type
), but it seems to hint that it may be able to use “Param” or “Params” given its different error messages:
-
.GroupBy "Param"
–>error calling GroupBy: reflect: Call with too few input arguments
-
.GroupBy "Params"
–>error calling GroupBy: reflect.MapOf: invalid key type map[string]interface {}
-
.GroupBy "sdfdsfds
–>error calling GroupBy: reflect: Elem of invalid type
So is it possible to use Param or Params with .GroupBy? And if so, how? Or am I forced to use .GroupByParam
?
Is it possible to group by a list value?
When I try to group by a parameter that one or more page assigns a list value (e.g. `categories: [“orange”, “purple”]) the grouping function seems to just ignore these pages, so is it true that if I want to group using a list value I have to write my own code?
Expected behavior: pages with more than one value in the list are included in more than one group.