Widgets

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 anni tempo fa
Hi experts!!!

I saw the lines of code bellow

1 @Html.Widget("home_page_top")
2 @Html.Widget("home_page_before_categories")
3 @Html.Action("HomepageCategories", "Catalog")
4 @Html.Widget("home_page_before_products")

what is the use of Widget in these lines of code?

I'm asking because I tried to comment line no. 2 and 4 and no effect on the UI. Why there's no effect in UI?
I commented line no. 3 and the Home page categories in the landing page disappeared.

In the case of line no. 1, I commented the it and the vivoSlider disappeared.

What is the differnce between the Widget from no. 1 and the widget from line no. 2 and 4?


Regards,

Archie GJ
6 anni tempo fa
Hi,

1 @Html.Widget("home_page_top")
2 @Html.Widget("home_page_before_categories")
3 @Html.Action("HomepageCategories", "Catalog")
4 @Html.Widget("home_page_before_products")

These all widget are used for placing other content into that widget. So, If you are commenting some widget and some plugins or sliders are not appears because that plugins or widget are placed inside that widget. Generally admin side there is option for where to place content of particular plugin or slider etc.

Hope these will be help you for understanding widget.
6 anni tempo fa
Thank you, I will explore with regards to the admin side in line with widgets.

On the other hand, follow-up question. Why there's no effect in UI when I commented line No. 2 and 4?
6 anni tempo fa
archie748491 wrote:
Thank you, I will explore with regards to the admin side in line with widgets.

On the other hand, follow-up question. Why there's no effect in UI when I commented line No. 2 and 4?


These are used from Widget plugin. If have any plugin that use your commented line No. 2 and 4 then you may see the changes in UI(not always, bcz widget may push only Js i.e Nop.Plugin.Widgets.GoogleAnalytics).

That means widget may use or not.
6 anni tempo fa
There no effect because there is no plugin or Code uses that Widget for placing content.

Try this way

1) Add some plugin and select widget home_page_before_categories or home_page_before_products for render

Now check at front side that this plugins content will display at front side.

2) Now remove that both widget home_page_before_categories or home_page_before_products

Now check at front side that this plugin contents will not displayed at front side.

Thus, you have commented line No. 2 and 4 then also there is no effect at front side or UI side because there no plugins or code uses that widget.

Hope this will help you for understand.

Thanks
6 anni tempo fa
Amazing guys, I highly appreciate these..
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.