Close

Problems adding other links

embryo
12 years ago
#1310 Quote
Avatar
  • 55
Hi-

I'm trying to add a couple of other links to my Categories Header Menu, but can't figure out the correct way to refer to the Home page..
I tried this:

<li><a href="@Url.RouteUrl("Home", new { SystemName = "home" })">@T("Home")</a></li>


....and evidentally "home" isn't the correct system name...what is?



Also, I want to add a link to the forum, and that does work, but it displays in all lower case instead of how I specify it in my code.

<li><a href="@Url.RouteUrl("Boards", new { SystemName = "boards" })">@T("KnowledgeBase")</a></li>


How do I get it to display the word "KnowledgeBase" instead of "knowledgebase" ??


Thanks-
Steve

IvanStoyanov
12 years ago
#1313 Quote
Avatar
  • 269
embryo wrote:
Hi-

I'm trying to add a couple of other links to my Categories Header Menu, but can't figure out the correct way to refer to the Home page..
I tried this:

<li><a href="@Url.RouteUrl("Home", new { SystemName = "home" })">@T("Home")</a></li>


....and evidentally "home" isn't the correct system name...what is?



Also, I want to add a link to the forum, and that does work, but it displays in all lower case instead of how I specify it in my code.

<li><a href="@Url.RouteUrl("Boards", new { SystemName = "boards" })">@T("KnowledgeBase")</a></li>


How do I get it to display the word "KnowledgeBase" instead of "knowledgebase" ??


Thanks-
Steve




Hi Steve,

The correct way to reffer to the Home page is

<li><a href="@Url.RouteUrl("HomePage")">@T("HomePage")</a></li>


For the blog is

<li><a href="@Url.RouteUrl("Blog")">@T("Blog")</a></li>


The best way to find the references is to go to /Views/Common/ and open Menu.cshtml.

To display Knowledge Base instead of Blog. You need to go to the administration of your nopCommerce website. Then go to Configuration => Languages. Click View string resources next to your first language e.g English. You will see all resources for your website.

Now you have two options:
1. To change the value of the Blog resource to Knowledge Base
2. To create new resource KnowledgeBase

To change the value of the Blog resource click on the filrer button for the Resource name, type blog and click Filter. You will have one item. Click the Edit button and replace the Value with Knowledge Base.
Repeat this process for all your languages e.g for German replace the Value with Wissensbasis.

To create new resource, click on the Add new record button. For the Resource name enter KnowledgeBase and for the Value enter Knowledge Base. Click on the Insert button. Repeat this process for all your languages.

If you have chosen the second option you need to change the refference to your blog from

<li><a href="@Url.RouteUrl("Blog")">@T("Blog")</a></li>


to

<li><a href="@Url.RouteUrl("Blog")">@T("KnowledgeBase")</a></li>


Have a great day!

Ivan Stoyanov
Thank you for choosing our products! Your feedback is important to us!
embryo
12 years ago
#1319 Quote
Avatar
  • 55
IvanStoyanov wrote:


Hi Steve,

The correct way to reffer to the Home page is

<li><a href="@Url.RouteUrl("HomePage")">@T("HomePage")</a></li>


For the blog is

<li><a href="@Url.RouteUrl("Blog")">@T("Blog")</a></li>


The best way to find the references is to go to /Views/Common/ and open Menu.cshtml.

To display Knowledge Base instead of Blog. You need to go to the administration of your nopCommerce website. Then go to Configuration => Languages. Click View string resources next to your first language e.g English. You will see all resources for your website.

Now you have two options:
1. To change the value of the Blog resource to Knowledge Base
2. To create new resource KnowledgeBase

To change the value of the Blog resource click on the filrer button for the Resource name, type blog and click Filter. You will have one item. Click the Edit button and replace the Value with Knowledge Base.
Repeat this process for all your languages e.g for German replace the Value with Wissensbasis.

To create new resource, click on the Add new record button. For the Resource name enter KnowledgeBase and for the Value enter Knowledge Base. Click on the Insert button. Repeat this process for all your languages.

If you have chosen the second option you need to change the refference to your blog from

<li><a href="@Url.RouteUrl("Blog")">@T("Blog")</a></li>


to

<li><a href="@Url.RouteUrl("Blog")">@T("KnowledgeBase")</a></li>


Have a great day!

Ivan Stoyanov



Hello Ivan-

Thank you for your quick response and for pointing me in the right direction!!

Steve

IvanStoyanov
12 years ago
#1320 Quote
Avatar
  • 269
embryo wrote:


Hello Ivan-

Thank you for your quick response! Indeed, that was the way to reference the home page. Thank you.

Unfortunately, I don't think I made myself completely clear. I am trying to create a link to the Forum (/Boards/), and I have already edited my language string resources for the forum to say the word "knowledgebase" instead.

Please click this link ...and you'll notice that my category header's first two menu items are:

"home"   and  "knowledgebase"

ALL OF THE LETTERS ARE lower case.

I want them to be   "Home"   and   "Knowledgebase"

..with only the first characters in upper case.

My code is now:


<li><a href="@Url.RouteUrl("HomePage")">@T("Home")</a></li>
<li><a href="@Url.RouteUrl("Boards")">@T("Knowledgebase")</a></li>


Both of the links work correctly, just the case is wrong.

When I try this:


<li><a href="@Url.RouteUrl("HomePage")">@T("HomePage")</a></li>
<li><a href="@Url.RouteUrl("Boards")">@T("Knowledgebase")</a></li>


..it looks like:  "Home page"   and   "knowledgebase"

..automatically putting a space before the second instance of an upper case character, and setting the first character as upper case.

But when I try this:


<li><a href="@Url.RouteUrl("HomePage")">@T("HomePage")</a></li>
<li><a href="@Url.RouteUrl("Boards")">@T("KnowledgeBase")</a></li>


...with uppercase B in Base..it STILL looks like:  "Home page"   and   "knowledgebase"
...no space and no upper case character  (scratching head)

..so I know it is POSSIBLE to make characters be upper case, though it seems to be inconsistent, and I just do not see how to achieve what I want without adding words that I do not even want to appear.

What is the trick??

Thank you again for your help!

Steve



Hi Steve,

If you want your first characters to be upper case you need to change your homepage resource value from Home page to Home Page.

Also change the blog resource from Blog to Knowledge Base.

NOTE: The first character of the resource values need to be upper case.

After that just reffer to them like this:

<li><a href="@Url.RouteUrl("HomePage")">@T("HomePage")</a></li>


<li><a href="@Url.RouteUrl("Blog")">@T("Blog")</a></li>


Have a great day!

Ivan Stoyanov
Thank you for choosing our products! Your feedback is important to us!