Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have a page in my site in which I need to list out product items. Each item has image, link and description.
On left side of the page, I listed out the product categories. Now I need to list out corresponding product items on the right side when I choose one category. How can I achieve this. I attached an image for reference only.
We need to know a little bit more about how your site is set up before we can really help you.
Please don't double post as it can become very confusing for yourself but also for those trying to help you out keeping track of suggestions etc. - If it's been a while since the last answer on a post then try bumping it up or tweeting using the #umbraco hash-tag if someone has time to provide some hints - The original post is in here https://our.umbraco.org/forum/developers/razor/61821-How-to-list-out-contents-based-on-specific-categories- :-)
I explained here what i did so far in my page for listing product items.
Under 'Developer' section, I created a data type called 'category' with 'dropdown list' as property editor.
Under 'Settings' section, I created a document type called 'Marketplace' without properties.Then I create 'MarketPlaceItem' doc. type under ' MarketPlace'. Now
'MarketPlace' acts as its master. MarketPlaceItem has name, image, category type as its properties. I assigned 'Category' data type to 'category type' property.
Under 'Content' section, I create a node called 'MarketPlace'.Under which, I created item1,item2,item3 as child nodes with different categories.
I listed out categories in page. But I stuck up here to list out corresponding nodes when I clicking particular category.
So what you should do, is to tack the category onto the URL as a QueryString parameter (e.g. "?category=tools"), and then find them like this:
<!-- Grab the Home node -->
<xsl:variable name="siteRoot" select="$currentPage/ancestor-or-self::*[@level = 1]" />
<!-- Find the MarketPlace node -->
<xsl:variable name="marketPlace" select="$siteRoot/MarketPlace" />
<!-- Grab the picked category from URL -->
<xsl:variable name="category" select="umbraco.library:RequestQueryString('category')" />
<!-- Find nodes with this category -->
<xsl:variable name="selectedNodes" select="$marketPlace/MarketPlaceItem[category = $category]" />
<!-- Process the picked nodes -->
<xsl:apply-templates select="$selectedNodes" />
<!-- Template for rendering a MarketPlaceItem -->
<h1><xsl:value-of select="@nodeName" /></h1>
<!-- etc. -->
Thanks for the solution.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted