I just started learning Umbraco, and need some help with the last bit on my website. I have made some kind of of product page / blog, since I am saying it is a blog too is that you only can watch the products, but not add them to the cart (for the moment, will perhaps be added in the future). So the concept is nearly like a blog system, just that each blog post will act like a product :)
So far each item has these properties. image, type:Upload bodyText, type:Richtext editor Featured, type: True/false
and then lastly a custom property category, Type:Category Where the category is where I have the problem, it is acting like a Dropdown List. And I can then add prevalues, for each of the categories.
As you can see on the picture, the categories work. But I need to make a partial view with a unordered list with the categories, and when you click on for example Surf, it will only show all thepost with that nametag/category. I have no idea how to do this, hopefully you guys can help me out! :)
As I understand it you need a Partial View that lists the prevalues from your Data Type and when clicked will filter the items on the page to show only items that have the prevalue, this will all occur on the same page?
It is DropDown List, should I use DropDownList Pubblicishing keys instead?
Exactly, if will then filter the items based on the prevalue you click on. I am actually not sure if it should be on the same page or an external, dont I need to create a AJAX call if it needs to be on the same?
Also I am filtering nodes that are the children of the root node, CurrentPage.AncestorOrSelf(1).Children you should change this for your own existing collection.
Sort by custom category: dropdown list
Greetings Umbraco and friends,
I just started learning Umbraco, and need some help with the last bit on my website. I have made some kind of of product page / blog, since I am saying it is a blog too is that you only can watch the products, but not add them to the cart (for the moment, will perhaps be added in the future). So the concept is nearly like a blog system, just that each blog post will act like a product :)
So far each item has these properties.
image, type:Upload
bodyText, type:Richtext editor
Featured, type: True/false
and then lastly a custom property
category, Type:Category
Where the category is where I have the problem, it is acting like a Dropdown List. And I can then add prevalues, for each of the categories.
As you can see on the picture, the categories work.
But I need to make a partial view with a unordered list with the categories, and when you click on for example Surf, it will only show all thepost with that nametag/category. I have no idea how to do this, hopefully you guys can help me out! :)
Hi Daniel,
Welcome to Our!
Couple of questions:
Jeavon
Greetings Jeavon,
Hi Daniel,
Simplest solution would be to use a querystring variable link and page reload, I think DropDown is fine for this.
I will post you some code shortly.
Jeavon
Thanks for the quick reply! :)
Ok here we go, a couple of things you need to adjust:
-
Also I am filtering nodes that are the children of the root node,
CurrentPage.AncestorOrSelf(1).Children
you should change this for your own existing collection.Any problems, please post your code :-)
Thanks alot Jeavon, your code is working like a charm. Only had to modify a littlebit.
In case anyone needs my version, here it is.
The partial view
The page showing all the items, and the filtered
again thank you, you was a big help! :)
You're welcome!
Hi Jeavon and Daniel,
Is there a way to filter more than one dropdown list using this method do you know?
For example, the above code filters using one property alias; I'm looking to filter using four.
Thank you, Cheralyn
is working on a reply...