Close

Profile: embryo

Avatar

User posts

11 years ago

Hello-

I've been trying to edit my CategoryMenuTemplate.WithoutPictures.cshtml to have it display my categories in columns with their subcategories listed under them...but I'm not having any luck with it.

I see it is possible because Yves accomplished it on his site at www.usnautic.com


I actually thought that's what it would do by default, but not.
I think this would be a great addition to a future update of the NopMegaMenu.

In the meantime, can anyone share how this can be accomplished for me and other developers?

Thanks,
Steve

11 years ago

Boyko wrote:

Hi Steve,

As Ivan already explained there is no way to add dynamic content within a topic. Topics are stored in the database as a plain text and then they are retrieved from the database when required. They are not compiled at runtime as the Razor views (.cshtml) file. So simply put there is no way around this.
Mixing topic content with some dynamic content could not be achieved without some hacky javascript exercises, which I wouldn't recommend.

Best Regards,
Nop-Templates Support Team



OK. But I still do not understand completely.

I do now understand that fetching data from the database as the megamenu topic page is loading isn't possible, but I do not understand why having client-side scripting, like javascript, embedded in my topic content wouldn't render and function. Is it just a problem with the encoding?

I'm sorry if I seem obtuse, but I've been programming with ASP for about 14 years and rarely ever find a coding obstacle that cannot be worked-around. I guess I assumed .NET was gonna be even more flexible.

Steve

11 years ago

IvanStoyanov wrote:
Hello-

I'm trying to add a tag cloud to my topic content, but not having any luck.

While editing my content topic in the admin area, I'm just including the following line of code in the table cell where I want the tag cloud to appear:

@Html.Action("PopularProductTags", "Catalog")



Is there something preventing razor syntax from executing when it's dynamically retrieved from a database column? Or do I just need to reference some other assembly from the TopicBlock.cshtml or MegaMenu.cshtml views? If so, which one, and how/where?

Thanks for your assistance!

Steve



Hi Steve,

You can not add
@Html.Action("PopularProductTags", "Catalog")

in a topic content, because it is not compiled in razor. If you want to add a tag cloud to the Mega Menu, you need to open the MegaMenu.cshtml view that is located in /Plugins/SevenSpikes.Nop.Plugins.MegaMenu/Views/MegaMenu/.
Once you have opened the view add the following code, on the place where you want the menu to appear:

<li>
<a href="#">@T("Products.Tags.Popular")</a>
@Html.Action("PopularProductTags", "Catalog");
</li>


Have a great day!

Ivan Stoyanov


Hmmm....

That's not quite what I had in mind..I do not want the tag cloud to be a menu item on my megamenu. Rather, I want it as part of the content on my topic page. Is there really no way around this hurdle?

What about this??

Is it possible for me to just create an HTML form with a select field storing all the popular tags as options, and use javascript to change the location (URL) based on the user's selection. This would also need to be inside the content of my topic page. Can javascript be included within a topic page?

If so, and because my site is on IIS, can I also use inline ASP/VBScript in the topic page content to retrieve a recordset of the popular tags and iterate them within my select field?

This will allow me to configure "symptoms" and "conditions" as tags and associate each of my products with the conditions they are useful for treating, or the symptoms that the products help to alleviate.


Thanks,
Steve

11 years ago

Hello-

I'm trying to add a tag cloud to my topic content, but not having any luck.

While editing my content topic in the admin area, I'm just including the following line of code in the table cell where I want the tag cloud to appear:

@Html.Action("PopularProductTags", "Catalog")



Is there something preventing razor syntax from executing when it's dynamically retrieved from a database column? Or do I just need to reference some other assembly from the TopicBlock.cshtml or MegaMenu.cshtml views? If so, which one, and how/where?

Thanks for your assistance!

Steve

11 years ago

Support wrote:
Hi Steve,

You can show the topic from the Mega Menu in full width by adding the fullWidth css class to the view. You can do this by editing the ~/Plugins/SevenSpikes.Nop.Plugins.MegaMenu/Views/MegaMenu/TopicBlock.cshtml file in a text editor and edit it as shown below:

line 12: <div class="dropdown fullWidth">


the class in bold is the one that you should add.

Hope that helps!


Hmmm...
I'm not having the result I expected. I have two topics in my menu:
Medically Guided Shopping (using the built-in "MegaMenuTopic"), and a new topic I created named "Knowledgebase"

I did as you said, and edited the TopicBlock.cshtml accordingly, expecting both of the topics to drop down at fullwidth. I also went back into the mega menu styles.css and changed the width value I set at 100% back to 200px.

Because I also want my categories to drop down at full width, I also opened and edited the CategoryMenuTemplate.WithoutPictures.cshtml and found the dropdown...and added the fullwidth class to it, like with the topics.


When viewed in a browser, the default topic item (Medically Guided Shopping) reverted back to a 200px drop down...not fullwidth.....and the other topic still looks exactly the same...not full width, but also not at 200px.

The category drop down did get a little wider, but it is also not shown at fullwidth.

See it here

What am I missing?


EDITED
I just noticed that the W in fullWidth is uppercase. I fixed that on both views and it is now appearing differently...though not exactly what I expected or desired.

The categories didn't change at all, but the topics do drop down at full width, although the content inside the topic dropdown is squished into 200px..

So I just tried changing back the width set on the box class to 100% instead of 200px, and now the topics do display correctly...but the categories are back to 200px...how do I get them to be full Width as well?

OK..nevermind...I figured out that there were two dropdown divs on the CategoryMenuTemplate.WithoutPictures.cshtml. It looks perfect now-


Thanks-
Steve


11 years ago

Hello-

I'm wanting my drop downs to be the full width of the menu itself so that all the page content beneath it is hidden...from one side to the other.

I see the following item in the styles.css:


}
.mega-menu .dropdown.fullWidth {
  left: 0;
  width: 950px;
  margin-left: -1px;
  border-radius: 5px;
}


But I'm not sure that's the right code, because I don't see a way to reference it from the admin area...and I wouldn't know exactly where to reference it from anyway...

Here's my site.

Click on Medically Guided Shopping in the menu. I've edited the topic area of the stylesheet and tried setting it to 100% width, but as you can see, it only expands to the right edge of the content area...how do I get it, and the categories item (Foot Care Products) to drop down at 100% menu width?

Thanks!

Steve

11 years ago

Hello-

I followed Ivan's advice and re-downloaded the electronics theme and replaced it on my site, except for the /themes/electronics/content/styles.css

I disabled the categoryheadermenu and set the mega menu as active. I edited the mega menu settings a little and edited the mega menu content topic.

The categoriesheadermenu no longer appears, but the mega menu still doesn't appear on my site.... it's just showing the standard header buttons...
You can see my site here.

I can't figure out what I'm missing...

Thanks for your help!
Steve

11 years ago

mwoffenden wrote:
In the Admin panel, navigate to Plugins / Nop Electronics Theme / Settings and check "Enable default category navigation".


Right, but it disables the Seven Spikes categoriesheadermenu when you do that. I want to enable the categories in the left menu, and also keep the categoriesheadermenu intact. What's the trick?

Also, should I decide to purchase and implement the Seven Spikes mega menu, will it still be possible for me to enable the default categories menu in the left column?

Thanks for your quick response!

Steve

11 years ago

Hello again-

I'm wondering how to enable the categories widget that appears on the left column on the default nopcommerce theme, but doesn't appear now with the electronics theme. I know it is possible to enable it because I see it on Yves' site, and he is using the electronics theme as well.

Can somebody tell me how to turn it back on please?

Thanks,
Steve

11 years ago

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