I am sure that the above code won't work as it is right now. I have some basic experience with HTML but have no real clue about Razor and how to use the Umbraco Aliases etc.
I know what the above will build a nav bar on my landing page what I want. So that's fine. Only issue I have is that I don't know what to code to use in "" here: href="" to fetch the category tags instead of using a URL for a landing page which is not what I want and also not the ID of a property as I do not have an ID for each tag??? Or where may I find an ID of the tags I create on the content like shown on the screenshots below?
How can I fetch the category tags for the nav bar
Would really appreciate some help as I am no developer
Adding some screenshots to show what I am trying to use:
As mentioned before, I am no developer so might need to share some more info to get the guidance I need. So if anybody would be willing to help but wants/needs to see some more code please just let me know what to share and I'll be happy to share what might be needed.
the tags in the datatype have configuration to group the repository.
The default name is "default". You can change if you want. This is so that every time the user in the backoffice adds a new tag it is saved in that repository. You can create repositories of different tags.
I created that code to explain to you how the tag system works. the tag link I directed to the product page by query string. On this products page you need to have a programming that will filter the products passed by parameter in the query string.
I know you said you're not a programmer, but you're really in need of one.
I don’t need a developer just someone you is willing to help and guide the way. If that is not you fine.
Everybody started coding some when. So needed to gain experience and learn.
As I’m new to Razor and Umbraco I need to learn so need someone to teach.
I find a way to achieve what I want. As this is just like a hobby to me and not urgent as I am building the whole website on my own without a programmer it will need some time. But that is fine.
So if anybody out there in the community is willing to help and guide me the way would really be appreciated.
using category tags in a nav bar on landing page
I have build a landing page to show case recipes using the product and products document types from Umbraco starter kit.
On the single recipes I put some category tags for the purpose to make them appear in a nav bar on the landing page.
I would like to use some code similar to this
I am sure that the above code won't work as it is right now. I have some basic experience with HTML but have no real clue about Razor and how to use the Umbraco Aliases etc. I know what the above will build a nav bar on my landing page what I want. So that's fine. Only issue I have is that I don't know what to code to use in "" here:
href=""
to fetch the category tags instead of using a URL for a landing page which is not what I want and also not the ID of a property as I do not have an ID for each tag??? Or where may I find an ID of the tags I create on the content like shown on the screenshots below?How can I fetch the category tags for the nav bar
Would really appreciate some help as I am no developer
Adding some screenshots to show what I am trying to use:
As mentioned before, I am no developer so might need to share some more info to get the guidance I need. So if anybody would be willing to help but wants/needs to see some more code please just let me know what to share and I'll be happy to share what might be needed.
I have updated the initial post on my question so it hopefully gets more clear what I try to achieve.
I would really appreciate some help here as I am no developer
Hi,
the tags in the datatype have configuration to group the repository.
The default name is "default". You can change if you want. This is so that every time the user in the backoffice adds a new tag it is saved in that repository. You can create repositories of different tags.
https://our.umbraco.com/Documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Tags
In the code you can render with razor the tags of a content like this:
To get all tags from the group tag, this is the code:
helper https://our.umbraco.com/documentation/reference/querying/umbracohelper/#tagquerygetalltagsstring-taggroup
So now I have the following situation.
For the product template which I use for the recipes this is the actual code:
@{ //Current Content Id //Property name //Tag group name var tags = Umbraco.TagQuery.GetTagsForProperty(Model.Content.Id, "category", "category");
}
@Model.Content.ProductName
and for the products template which is the overview landing page for the recipes I use this code:
@using ContentModels = Umbraco.Web.PublishedContentModels; @{ Layout = "Master.cshtml"; } @Html.Partial("~/Views/Partials/SectionHeader.cshtml")
But when I now click on the nav bar on the overview page on one of the buttons where I already have tags for it it breaks the page
I created that code to explain to you how the tag system works. the tag link I directed to the product page by query string. On this products page you need to have a programming that will filter the products passed by parameter in the query string.
I know you said you're not a programmer, but you're really in need of one.
I don’t need a developer just someone you is willing to help and guide the way. If that is not you fine.
Everybody started coding some when. So needed to gain experience and learn.
As I’m new to Razor and Umbraco I need to learn so need someone to teach.
I find a way to achieve what I want. As this is just like a hobby to me and not urgent as I am building the whole website on my own without a programmer it will need some time. But that is fine.
So if anybody out there in the community is willing to help and guide me the way would really be appreciated.
OK. I'm sorry if I was offensive, but I thought you needed to go to work, something urgent.
We do so, show the code of the full page of products that showed how the product filter would work through the navigation link
So this is the full code from the template of the products page including the nav link:
@using ContentModels = Umbraco.Web.PublishedContentModels; @{ Layout = "Master.cshtml"; } @Html.Partial("~/Views/Partials/SectionHeader.cshtml")
I am not using the Nav bar code as it is not working so not filtering the "products" on that page.
is working on a reply...