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.
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("");
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("");
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
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.
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.