Hi ,
I am just new to umbraco ,
i have resource page that contain multiple images and video as shown in image, I want to add drop down list on the top of the page and on the basis of selected value filter image.please help me how can i achieved this functionality and process to
i think the normal approach will be to create the search-logic in a UmbracoApiController (https://our.umbraco.org/documentation/reference/routing/webapi/) and then, as Alex mentioned, use js / js framework to fetch the data and precent them in your view.
currently drop down is static but i want to populate this from Database,value is stored in "cmsDataTypePreValues" table.how can i populate drop down from DB.
second thing while filtering content i am able to apply filter on the basis of the name (pass static name) shown in below code.that print name of content which contains "Hormones" in name display but i want to apply filter on Resource type.
@{
var selection = Umbraco.Content(5551).Children.Where("Visible && Name.Contains(@0)","Hormones").OrderBy("Name");
how to filter page content on drop down selection
Hi , I am just new to umbraco , i have resource page that contain multiple images and video as shown in image, I want to add drop down list on the top of the page and on the basis of selected value filter image.please help me how can i achieved this functionality and process to
Hi Amit
Share code of the page please. What are you using as js framework? Do you want to do AJAX filter?
Thanks,
Alex
Hi Amit,
i think the normal approach will be to create the search-logic in a UmbracoApiController (https://our.umbraco.org/documentation/reference/routing/webapi/) and then, as Alex mentioned, use js / js framework to fetch the data and precent them in your view.
Best regards René
Hi Alex Skrypnyk and René Pjengaard, thanks for reply ,I am not using any js framework. below is back office view please provide way to achieve this.
Hi Amit
You don't need something special, just render dropdownlist with possible values from "Resource Type Sub Heading" datatype. Look at this code:
If you want AJAX page - we need some js framework for switching what resource galleries should be shown.
Amit do you want ajax solution?
Thanks,
Alex
Hi Alex Skrypnyk,
currently drop down is static but i want to populate this from Database,value is stored in "cmsDataTypePreValues" table.how can i populate drop down from DB.
second thing while filtering content i am able to apply filter on the basis of the name (pass static name) shown in below code.that print name of content which contains "Hormones" in name display but i want to apply filter on Resource type.
@{ var selection = Umbraco.Content(5551).Children.Where("Visible && Name.Contains(@0)","Hormones").OrderBy("Name");
}
@foreach (var item in selection){-
@item.Name
}
also perform filter content on the basis of drop down selection and pass selected value to filter. please share your solution.
Thanks, Amit
Hi Amit,
how did you solve this issue in the end?
Thanks
is working on a reply...