Thanks for your elaborate answer.
This is exactly what I'm trying to do. Use DTGE in combination with Footprint, but I'm missing the part in the custom view where you go from GetSegmentedValue to GetGridHTML.
Do you perhaps have an example of a custom view where you get the value from GetSegmentedValue and render the grid content?
Documentation for this kind of thing is hard to find :)
I'm probably not doing a good job explaining at what point I'm having troubles. Probably a language thing (not native English here). Let me try it this way:
I've got a DocType 'ContentPage' that has a property 'contentGrid' that has the 'Footprint grid' datatype attached to it.
So in the ContentPage.cshtml view you would normally (without Footprint) use this to render the grid content:
@Model.Content.GetGridHtml("contentGrid")
But now with Footprint I need to get the grid content for the right segment.
var test = Model.Content.GetSegmentedValue("contentGrid");
This gets me the right segmented JSON values for the grid content, but I'm having a hard time getting that to render.
As far as I understand it, this has little to do with the DocTypeGridEditor (even though I use that to fill the grid). The segmentation takes place at the grid level, not at the components in the grid. But I could be wrong about this of course.
I understand now. I am on my phone so can't link to it. You need to get the segmented value and pass it to the grid layout macro. Using the helper function might make it difficult just call the grid layout partial directly.
I normally do my footprint at the grid item level not the entire grid
Footprint <3 GridLayout?
Hi!
We are considering using footprint to personalize content for our users. We are also using the built-in "Grid Layout" data type in Umbraco 7.
Is it possible to use segmented (Footprint) content inside a grid layout? If so, can you help us figure out how to do it?
I have tried adding an editor to the Footer by modifying grid.editors.config.js but I'm not sure what to put for the alias and view values.
Example:
Thank you for your help!
I use a combination of doctypegrideditor and footprint
Hi,
Could you show me an example of the cshtml that does this? How do you go from GetSegmentedValue to render the grid content?
Hey Peter,
I use a combination of DoctypeGridEditor and Footprint.
My grid.editors.config has entries like this.
I then create a document with the documentTypeAlias of myCustomContent. This will have the footprint values add to it.
You can then create a custom view for your new custom document type. (See the documention for doctypegrideditor)
In the custom view you will be given an IPublishedContent which works with GetSegmentedValue.
In my complete solution I use ditto to strongly type the models however that is an extra complexity.
Hi Shannon,
Thanks for your elaborate answer. This is exactly what I'm trying to do. Use DTGE in combination with Footprint, but I'm missing the part in the custom view where you go from GetSegmentedValue to GetGridHTML. Do you perhaps have an example of a custom view where you get the value from GetSegmentedValue and render the grid content? Documentation for this kind of thing is hard to find :)
Hey Peter,
You will need to name the view the same as your document type.
https://github.com/umco/umbraco-doc-type-grid-editor/blob/develop/docs/developers-guide.md#rendering-a-doc-type-grid-editor
The documentation has good examples.
Hi Shannon,
I'm probably not doing a good job explaining at what point I'm having troubles. Probably a language thing (not native English here). Let me try it this way:
I've got a DocType 'ContentPage' that has a property 'contentGrid' that has the 'Footprint grid' datatype attached to it.
So in the ContentPage.cshtml view you would normally (without Footprint) use this to render the grid content:
@Model.Content.GetGridHtml("contentGrid")
But now with Footprint I need to get the grid content for the right segment.
var test = Model.Content.GetSegmentedValue("contentGrid");
This gets me the right segmented JSON values for the grid content, but I'm having a hard time getting that to render.
As far as I understand it, this has little to do with the DocTypeGridEditor (even though I use that to fill the grid). The segmentation takes place at the grid level, not at the components in the grid. But I could be wrong about this of course.
Any idea on how to achieve this?
It's always nice when you can solve your own problems :)
I ran into this package: https://our.umbraco.org/projects/developer-tools/skybrudumbracogriddata/
That does exactly what I needed:
Now I have segmented grid content.
Thanks for your help Shannon.
I understand now. I am on my phone so can't link to it. You need to get the segmented value and pass it to the grid layout macro. Using the helper function might make it difficult just call the grid layout partial directly.
I normally do my footprint at the grid item level not the entire grid
is working on a reply...