kgiszewski / Archetype

Archetype is an Umbraco 7 property editor that wraps other installed property editors.
https://github.com/kgiszewski/ArchetypeManual
MIT License
89 stars 54 forks source link

Rendering Archetype with Grid Layout - Umbraco 7 #367

Closed rachael-ross closed 8 years ago

rachael-ross commented 8 years ago

I have an Archetype (1.12.4.0) with one of its properties as an Umbraco 7.4.3 Grid datatype.

Within the razor view that renders said page using the Archetype, I'm using the following, which renders all the HTML markup, but no actual content within each part of the grid:

@Html.Partial("Grid/bootstrap3", fieldset.GetValue<object>("grid"))

When looking at the json/dynamic object that's getting passed into grid/bootstrap3, there are several properties missing from the sections/rows/areas/controls/editor node. The bootstrap3.cshtml and base.cshtml editor views rely upon the "view" property being present, but all I've got is the "alias" property. Is the Archetype not saving the grid json properly??

Here's an "editor" node from a page that uses the grid directly (not within an Archetype):


    sections/rows/areas/controls...
    "editor": {
                        "name": "Rich text editor",
                        "alias": "rte",
                        "view": "rte",
                        "render": null,
                        "icon": "icon-article",
                        "config": {}
                      }

But the data from the grid nested in the Archetype is:


     "editor":{  
                         "alias":"rte"
                    },

As you can see, all the properties besides "alias" is present as the Json data in the database!

Any suggestions??

kjac commented 8 years ago

Hey @rachael-ross,

I sincerely doubt you'll ever get the Grid working as a property within Archetype. It's not something we've actively made any attempt to support - frankly I believe you're the first one to ever have this use case (or at least to report it failing).

Maybe you should consider using Archetypes within your Archetype to achieve the same goal?

rachael-ross commented 8 years ago

Actually, I got it working for my particular use case, but it's not optimal. When I have time, I'll pull down the source code and see if it's something I could add. We actually have 2 cases where we'd like to use it in that manner. In searching the Internet for possible solutions found by others, there's definitely folks out there wanting to use the grid as a property of an Archetype. Here's one example: https://our.umbraco.org/projects/backoffice-extensions/archetype/sound-off/60460-Rendering-Archtype-plus-Grid-Layout

Thanks for the response. :-)