Using URL parameter to pull content matching prevalue of radio button
I am currently using v7 and I am trying to implement some filtering of content using URL parameter.
Setting is as follow:
I have a radio button doc type 'Filter Products' added on each node using composition
a URL parameter 'Product'
On the parent page (list page) Users can select a radio button option and filter content on submit - it then passes the value of the radio button to the URL and reload the page.
Adn add a condition to return content where the URL parameter matches the Radio button on the node:
var brochuresList= Model.BrochureItems.Where(x => x.GetPreValueAsString(x.GetPropertyValue<int>("FilterProducts")) == searchTermProduct);
But no matter what I do I get the following:
Compiler Error Message: CS1593: Delegate 'System.Func<MyWebsite.Models.PublishedContentModels.BrochureItem,int,bool>' does not take 1 arguments
This works:
int searchTermProduct = Request.QueryString["Product"].AsInt();
var brochuresList = Model.BrochureItems.Where(x => x.GetPropertyValue<int>("FilterProducts") == searchTermProduct);
I can get it working using the integer value of the radio button however because I currently have a multi environment setup (dev, staging and prod) those values dont match between environments and as such I would prefer to use the prevalue of the radio button in the condition.
Using URL parameter to pull content matching prevalue of radio button
I am currently using v7 and I am trying to implement some filtering of content using URL parameter.
Setting is as follow:
On the parent page (list page) Users can select a radio button option and filter content on submit - it then passes the value of the radio button to the URL and reload the page.
For example, I end up with the following URL:
From there I pull the query string on page
Adn add a condition to return content where the URL parameter matches the Radio button on the node:
But no matter what I do I get the following:
This works:
I can get it working using the integer value of the radio button however because I currently have a multi environment setup (dev, staging and prod) those values dont match between environments and as such I would prefer to use the prevalue of the radio button in the condition.
Any help or pointer would be much appreciated.
is working on a reply...