Unyson icon indicating copy to clipboard operation
Unyson copied to clipboard

Extension: Builder

Open themesmeta opened this issue 12 years ago • 11 comments

Hi there, When I create a custom page with Visual Layout Editor, the render view in front-end will be wrapped by a DOM selector with class name

fw-layout-builder-content
. The question is: can I replace this one by my own, or simply add more class names into it ? Any helps would be appreciated. Thanks in advanced !

themesmeta avatar Oct 24 '14 12:10 themesmeta

Please update to v1.4.4 and use this filter

ghost avatar Oct 24 '14 13:10 ghost

Superb ! Keep on great work ! Just one more question: is it possible to detect whether a element is wrapped by a column element or not ? Eg:

if( ! element.is_wrapped_by_1/3_column() ){
element.wrapped_by_1/1_column();
// or doing something ...
}
Hope this makes sense. Thank you guys so much !!

themesmeta avatar Oct 24 '14 13:10 themesmeta

Do you need to be able to just detect whether it is wrapped by a column, or do you also need to wrap it yourself if it is not wrapped ?

rockalife avatar Oct 24 '14 14:10 rockalife

Hey @rockalife , I need to do all two things that you mentioned, if a element is not wrapped by a column element (in back-end), it will be wrapped automatically by 1/1 column element (in front-end). Thanks.

themesmeta avatar Oct 24 '14 14:10 themesmeta

The framework does not provide this functionality at the moment, but this is an interesting idea.

You could write it yourself though, first see what kind of html do the columns have (by default there are divs which have a shortcode-column class), so you might check if the element's parent has such a class then the element is inside a column, if the parent doesn't have such a class then the element is not wrapped by a column. Similarly you could write a function that wraps some element with a div like the column one.

As a side note I want to say that although I do not know what are you trying to create it might not be a good idea to forcefully wrap a shortcode inside a column this way, because the users might be confused by the fact that in the builder the shortcode is not inside a column while in the frontend a column that he didn't put there appears. I would suggest not to do this and when the user forgets to drag your shortcode into a column he will notice for sure when he will preview the page on the frontend that it does not look good.

This is up to you, I hope that you will solve your problem.

rockalife avatar Oct 24 '14 14:10 rockalife

Well, I have to do this because I must follow the grid's constructor of my theme, it's pretty easy for me to address this issue with Javascript, but I would like to do with PHP in server-side. One more thing, there is an idea I would like to tell you for the enhancement of extension Builder: When adding an element to builder area, the system should also add its wrapper with a default grid (like the way Visual Composer plugin doing) so that we can add more options for grid such as: different size of grid gutter, vertical divider between two columns, or even displaying columns with Masonry layout, etc ... Thanks. screen shot 2014-10-24 at 11 13 26 pm

themesmeta avatar Oct 24 '14 16:10 themesmeta

Hey @RayNguyen. Can you please explain what you mean by "following the grid's constructor", do you mean that the html of the pages is written in a certain way (using a certain grid) and you must integrate that with the page builder ? Thank you.

rockalife avatar Oct 27 '14 10:10 rockalife

Hey @rockalife , Thanks for your response. Here is the grid system of my theme:

<div class="grid-container">
    <div class="column-1-2">
        // put elements here ...
    </div>
     <div class="column-1-2">
        // put elements here ...
    </div>
</div>

All elements must be put inside a column, thus I have to wrap all elements (front-end) that have not been wrapped by any shortcode-column yet. Hope this makes sense. Thanks.

themesmeta avatar Oct 27 '14 10:10 themesmeta

Hi @RayNguyen,

just wanted to say that we are in the process of rethinking and remaking the grid system, it should solve this kind of problems. I will let you know when it will be released.

rockalife avatar Nov 06 '14 07:11 rockalife

Very good news @rockalife , could you please tell me a bit about new grid system and how it works ? Have a nice day !

themesmeta avatar Nov 07 '14 06:11 themesmeta

Hi @RayNguyen,

Just wanted to say that we have released the plugin version, and now the page builder corrects the grid, so if a shortcode was dropped directly into the builder, it will wrap the shortcode into a column, row and section. By doing this, the grid remains correctly structured (it is very similar and inspired by the bootstrap framework's grid).

You can get the plugin from wordpress.org, or directly from github, then you need to download and install the page builder extension from the dashboard.

Feel free to open new issues if some problems or questions occur.

rockalife avatar Dec 04 '14 08:12 rockalife