Close

Additional Links Not Working

Slotraccoon
10 years ago
#6216 Quote
Avatar
  • 7
Hi

I am using nopCommerce 3.30 and nop Categories Header Menu 3.3. My additional links are not working although they are identical to those used with nopCommerce 3.2 and Header Menu 3.2

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

The text appears in the menu but the link does not work. Plasecan someone suggest what I am doing wrong.

Regards

Rob
iliyan.tanev
10 years ago
#6218 Quote
Avatar
  • 347
Hi Rob,

The UrlRecord helper needs valid route name to work. The "Topic" route name is not valid in this case, the example comment is not updated, sorry for that.

The simplest thing you could do in this case is to write something like:
<li><a href="/Search engine friendly page name">@T("Some resource")</a></li>

Hope this helps!

Regards
Regards,
Iliyan Tanev
Nop-Templates Dev Team
Slotraccoon
10 years ago
#6221 Quote
Avatar
  • 7
Hi

So has this changed since version 3.2? It all worked fine then.

Regards

Rob
Support
10 years ago
#6222 Quote
Avatar
  • Moderator
  • 1044
Slotraccoon wrote:
Hi

So has this changed since version 3.2? It all worked fine then.

Regards

Rob


Hi SLOTRACCOON,

Yes there was a change in nop 3.30 with the way links are built for topics. Now the links to the topic using the route name is as follows:

<a href="@Url.RouteUrl("Topic", new { SeName = Html.GetTopicSeName("topic_se_name") })">Topic Title</a>

Best Regards!
Slotraccoon
10 years ago
#6230 Quote
Avatar
  • 7
So what was:

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

Should now be:

<li><a href="@Url.RouteUrl("Topic", new { SeName = Html.GetTopicSeName("HomePageText") })">Home</a></li>

Is that right as I get an error?
Support
10 years ago
#6231 Quote
Avatar
  • Moderator
  • 1044
Slotraccoon wrote:
So what was:

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

Should now be:

<li><a href="@Url.RouteUrl("Topic", new { SeName = Html.GetTopicSeName("HomePageText") })">Home</a></li>

Is that right as I get an error?


Hi,

Yes this is why you get this error. The correct will be

<li><a href="@Url.RouteUrl("Topic", new { SeName = Html.GetTopicSeName("HomePageText") })">Home</a></li>

where HomePageText is the Search Engine Name which you can see from the administration of the topic. This is not the same as the System Name of the topic. So replace HomePageText with the SE name of the topic with system name HomePageText.

Hope that makes sense!
Slotraccoon
10 years ago
#6232 Quote
Avatar
  • 7
I must be doing something wrong. So my code is now

<li><a href="@Url.RouteUrl("Topic", new { SeName = Html.GetTopicSeName("homepagetext") })">Home</a></li>

I have checked that the Search Engine Friendly page name is homepagetext but I am still getting the same error. What am I missing?
Boyko
10 years ago
#6237 Quote
Avatar
  • 1570
Slotraccoon wrote:
I must be doing something wrong. So my code is now

<li><a href="@Url.RouteUrl("Topic", new { SeName = Html.GetTopicSeName("homepagetext") })">Home</a></li>

I have checked that the Search Engine Friendly page name is homepagetext but I am still getting the same error. What am I missing?


Hi ,

Can you check if you can open the topic with its SeName like this: yourstorename.com/homepagetext ?

Thanks
Regards,
Nop-Templates.com Team