Inhalte aufrufen

Profilbild

Custom widgetzones.json file


2 Antworten zu diesem Thema

#1 CompleteCoders

CompleteCoders

    Advanced Member

  • Members
  • 69 Beiträge

Geschrieben: 21 October 2018 - 02:25

We wanted to create a widget in a custom location that currently doesn't have a widget.  We did this by editing the widgetzones.json file in the appdata folder and then adding the widgetzone to the html.

 

1. Is this the correct way to do this?

2. Is there a way for a plugin to add a file to the wigetzones.json file in code?

3. If the answer to #2 is No, is there a reason why we shouldn't allow a plugin to do this?

4. Would smartstore run faster if we removed unused widgetzones from the json file?  I assume smartstore has to process all of these every time it renders a page.

5. Does the name field of the wigetzone have anything to do with the location?  Is there a difference in the system if I add a new entery to the "Shoppingcart" widget that already exists or make my own section like below.

 

{
   "name": "CustomWidget",
   "zones": [
   "custom_order_summary_content_after"
 ]
}

 


  • GalenKa, RidgeOi und Brantot gefällt das

#2 Murat Cakir

Murat Cakir

    SmartStore AG

  • Administrators
  • 1079 Beiträge

Geschrieben: 22 October 2018 - 19:54

The file widgetzones.json has only informational purpose: it is loaded to fill the dropdown menu with options to select from. It is not required to add an entry to the file in order for a custom widget zone to render content. The only downside is that you have to know the name of your zone and enter it manually. The name property refers to the optgroup element of the dropdown, and the zones property defines the actual zones in this group.

 

1. Not really. You should just add a custom @Html.RenderWidget("MyZoneName") call anywhere you like in your custom or existing templates.

2. No

3. See 1

4. No. The number of widget zones has a very minimal impact on page rendering performance thank to heavy caching and micro optimization.

5. See 1


  • GalenKa gefällt das

Murat Cakir
SmartStore AG


#3 CompleteCoders

CompleteCoders

    Advanced Member

  • Members
  • 69 Beiträge

Geschrieben: 23 October 2018 - 01:46

Thanks very informative.





Auf dieses Thema antworten