Unyson icon indicating copy to clipboard operation
Unyson copied to clipboard

Section wrapper

Open maiakhoa opened this issue 11 years ago • 4 comments

Hi team,

Currently, I saw that each row of page builder is wrapped by Section shortcode even it's not dragged into Section shortcode. So could you help me to identify whether a row is wrapped by Section or not ?

maiakhoa avatar Dec 12 '14 04:12 maiakhoa

Hello @maiakhoa.

You are right, the builder wraps shortcodes into sections, rows and columns. It does that to form a correct grid. This process is called correction, it occurs when saving or updating a post from the dashboard.

Not sure that I understood you correctly but if you are asking how to identify if a user actually dragged a section himself or if it was added automatically by the builder in the correction process then there is a auto_generated key in the $atts variable that is passed into the section shortcode's view. To make use of it you can overwrite the view file by creating a copy of it in {your-theme}/framework-customizations/extensions/shortcodes/shortcodes/section/views/view.php and modify it to suit your needs.

Note that the auto_generated key was added to the framework in a later version so make sure you update the framework and it's extensions before doing this.

rockalife avatar Dec 12 '14 06:12 rockalife

Thank @rockalife. But could you tell me the version that having auto_generated key in the $atts variable ? I have just upgraded to the latest version of framework but can not see that key name.

maiakhoa avatar Dec 12 '14 07:12 maiakhoa

Thank @rockalife so much. I found out that key. Sorry I forgot to update extensions.

maiakhoa avatar Dec 12 '14 07:12 maiakhoa

No problem @maiakhoa, glad I could help.

rockalife avatar Dec 12 '14 07:12 rockalife