Page 1 of 1
Adding elements to a layout with a theme
Posted: Fri Dec 16, 2016 12:38 pm
by TomM
Im trying to add elements to a layout in my theme, but I cant see how this would be done.
When I use the designer to drag an element into a layout, I dont see any properties that are changed in either the layout or the element.
Is there some hidden property that specifies which layout an element is inside of?
Thanks
Re: Adding elements to a layout with a theme
Posted: Fri Dec 16, 2016 5:55 pm
by Glenn
Tom,
There are 2 properties involved in placing an element inside a layout. The first one is called "layout" and needs to contain the "id" of the layout widget. The other one is called "container" and it should be set to "1". Note that the positional properties (top, left, etc...) of the element contained in the layout are based on the inside of the layout not on the page.
Glenn
Re: Adding elements to a layout with a theme
Posted: Tue Dec 20, 2016 9:47 am
by Scott Klement
A few notes on what Glenn said:
1) Yes, these properties (layout and container) are not visible in the Visual Designer, so you can think of them as "hidden".
2) The "container" property should NOT always be "1", it controls which section of the layout you want the item placed inside. In the Mobile layout, for example, there are 3 sections.. container=1 is the top bar, container=2 is the middle section, container=3 is the bottom bar.
The easiest way to see how this works is to create a throwaway display in the Visual Designer and then use SaveAs/LocalFile. Open the resulting file in Notepad and you can see exactly what properties the designer sets in JSON format.