NopCommerce Widget Details Cs Code

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Hello
I using a nopcommerce 3.90 , problem is how to learn widget details ,
Example "blogpost_page_before_body" where is this code in .cs files ?
According to what "blogpost_page_before_body" ? How to change this code my blogpost before body ?
Thanks for help.
5 years ago
Hi @hakansaks,

Hope you are doing well.

I am interested. Please connect me here [email protected] or add me on Skype: cis.am4 so that we can discuss further.

Looking forward for your response.

Regards,
Hayden
5 years ago
Hi

please see this post it can helpful to you list of all widgets and which page it used :

https://www.nopcommerce.com/boards/t/49713/list-widgets-zones-in-390.aspx
5 years ago
ilyaspatel wrote:
Hi

please see this post it can helpful to you list of all widgets and which page it used :

https://www.nopcommerce.com/boards/t/49713/list-widgets-zones-in-390.aspx


Thanks , How to use this ? Please one example
5 years ago
hakansaks wrote:
Hi

please see this post it can helpful to you list of all widgets and which page it used :

https://www.nopcommerce.com/boards/t/49713/list-widgets-zones-in-390.aspx

Thanks , How to use this ? Please one example

Hi, you can use default widgets from given list or you can create your Custom widget by injecting it
and in your plugin you can add like this

  [ChildActionOnly]
        public ActionResult PublicInfo(string widgetZone, object additionalData = null)
        {
            var nivoSliderSettings = _settingService.LoadSetting<NivoSliderSettings>(_storeContext.CurrentStore.Id);

            var model = new PublicInfoModel();
            model.Picture1Url = GetPictureUrl(nivoSliderSettings.Picture1Id);
            model.Text1 = nivoSliderSettings.Text1;
            model.Link1 = nivoSliderSettings.Link1;


            if (string.IsNullOrEmpty(model.Picture1Url)   )
                             //no pictures uploaded
                return Content("");


            return View("~/Plugins/Widgets.NivoSlider/Views/PublicInfo.cshtml", model);
        }


this is example of nivo slider,for reference you can review nivoslider

hope it can helpful to you.
5 years ago
ilyaspatel wrote:
Hi

please see this post it can helpful to you list of all widgets and which page it used :

https://www.nopcommerce.com/boards/t/49713/list-widgets-zones-in-390.aspx

Thanks , How to use this ? Please one example
Hi, you can use default widgets from given list or you can create your Custom widget by injecting it
and in your plugin you can add like this

  [ChildActionOnly]
        public ActionResult PublicInfo(string widgetZone, object additionalData = null)
        {
            var nivoSliderSettings = _settingService.LoadSetting<NivoSliderSettings>(_storeContext.CurrentStore.Id);

            var model = new PublicInfoModel();
            model.Picture1Url = GetPictureUrl(nivoSliderSettings.Picture1Id);
            model.Text1 = nivoSliderSettings.Text1;
            model.Link1 = nivoSliderSettings.Link1;


            if (string.IsNullOrEmpty(model.Picture1Url)   )
                             //no pictures uploaded
                return Content("");


            return View("~/Plugins/Widgets.NivoSlider/Views/PublicInfo.cshtml", model);
        }


this is example of nivo slider,for reference you can review nivoslider

hope it can helpful to you.


Look brother , Nopcommerce is using @Html.Widget("home_page_before_categories") , my questions is what is "home_page_before_categories" okey I understand my home page before categories what for ? where is .cs file , how to understand this code ,my widget deal ? Hops =( this very difficult ..
Thanks brother
5 years ago
hakansaks wrote:
my questions is what is "home_page_before_categories"

That is name of specific widget zone. nopCommerce has multiple widget zones, so need to named each one, so it may be called specific one by developers in plugin.

@Html.Widget - that is special area. Area in which you may place code/text/image/etc for example from plugin. That was made for developers to avoid changing default code of nopCommerce. Without any changes, developers are calling zone, in which plugin place own action.

Regards,
Tom
5 years ago
I m sory too many questions =(
Where is the widget content dll ? Sample @Html.Widget("head_html_tag") => head_html_tag (how find dll) is open source?
Thanks for help ,
Hope not block me
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.