Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE-293: Add template for Content row paragraph type Columns layout variant. #295

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kp77
Copy link
Contributor

@kp77 kp77 commented Aug 12, 2019

ISSUE-293

Description

openeuropa/oe_paragraphs#65 introduces a new variant (Columns Layout) for the 'content row' paragraph type. This issue is created to contribute the theming logic that will be responsible to render multi-column layouts for this new variant.

Change log

  • Added:
    Template file for the new variant.
  • Changed:
    oe_theme.theme (added preprocess function for the new variant)
    composer.json (added patch for oe_paragraphs new variant temporarily)

msnassar
msnassar previously approved these changes Aug 12, 2019
Copy link
Member

@ademarco ademarco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two approvals above were just a test to test GitHub permissions. I'll block this PR until is ready for an actual review.

if (is_numeric($layout_settings)) {
// Set column count and layout for equal width columns.
$column_count = (int) $layout_settings;
$layout = array_fill(0, $column_count, $grid_column_count / $column_count);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By validation before we should avoid chance to get float number

}
else {
// Set column count and layout for variable width columns.
$layout = explode('-', $layout_settings) ?? [$grid_column_count];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Require validation that we have number of columns in sum equels 12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants