Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Amit 3 posts 73 karma points
    Jan 24, 2017 @ 14:33
    Amit
    0

    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

    enter image description here

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Jan 29, 2017 @ 22:04
    Alex Skrypnyk
    0

    Hi Amit

    Share code of the page please. What are you using as js framework? Do you want to do AJAX filter?

    Thanks,

    Alex

  • René Pjengaard 117 posts 700 karma points c-trib
    Jan 30, 2017 @ 08:48
    René Pjengaard
    0

    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é

  • Amit 3 posts 73 karma points
    Jan 30, 2017 @ 15:07
    Amit
    0

    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. enter image description here

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Jan 30, 2017 @ 20:54
    Alex Skrypnyk
    0

    Hi Amit

    You don't need something special, just render dropdownlist with possible values from "Resource Type Sub Heading" datatype. Look at this code:

    Umbraco.DataTypeService.GetPreValuesByDataTypeId()
    

    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

  • Amit 3 posts 73 karma points
    Feb 01, 2017 @ 06:55
    Amit
    0

    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");

    }

    also perform filter content on the basis of drop down selection and pass selected value to filter. please share your solution.

    Thanks, Amit

  • Edgar Rasquin 326 posts 925 karma points
    Jun 07, 2019 @ 10:03
    Edgar Rasquin
    0

    Hi Amit,

    how did you solve this issue in the end?

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft