Fix: Exclude SPA pages from Appearance Entry Page dropdown, remove hardcoded Hero paddings, fix Accordion dropdown clipping
This commit is contained in:
@@ -167,12 +167,18 @@ class PageSSR
|
||||
$subtitle_style = self::generate_style_attr($element_styles['subtitle'] ?? []);
|
||||
$cta_style = self::generate_style_attr($element_styles['cta_text'] ?? []); // Button
|
||||
|
||||
// Image (if not background)
|
||||
// Content Wrapper
|
||||
$content_width = $section_styles['contentWidth'] ?? 'contained';
|
||||
$wrapper_class = $content_width === 'full' ? 'w-full' : 'container max-w-7xl mx-auto px-4';
|
||||
|
||||
$html .= "<div class=\"wn-hero__content-wrapper {$wrapper_class}\" style=\"position: relative; z-index: 10;\">";
|
||||
|
||||
// Image (if not background) - Inside Content Wrapper for Proper Alignment
|
||||
if ($image && !$bg_image && $layout !== 'default') {
|
||||
$html .= "<img src=\"{$image}\" alt=\"{$title}\" class=\"wn-hero__image\" />";
|
||||
}
|
||||
|
||||
$html .= '<div class="wn-hero__content" style="position: relative; z-index: 10;">';
|
||||
$html .= '<div class="wn-hero__content">';
|
||||
if ($title) {
|
||||
$html .= "<h1 class=\"wn-hero__title\" {$title_style}>{$title}</h1>";
|
||||
}
|
||||
@@ -183,6 +189,7 @@ class PageSSR
|
||||
$html .= "<a href=\"{$cta_url}\" class=\"wn-hero__cta\" {$cta_style}>{$cta_text}</a>";
|
||||
}
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
$html .= '</section>';
|
||||
|
||||
return $html;
|
||||
@@ -206,8 +213,10 @@ class PageSSR
|
||||
$title_style = self::generate_style_attr($element_styles['title'] ?? []);
|
||||
$text_style = self::generate_style_attr($element_styles['text'] ?? ($element_styles['content'] ?? []));
|
||||
|
||||
$contentWidth = $options['contentWidth'] ?? 'contained';
|
||||
|
||||
// Wrapper Classes
|
||||
$wrapper_class = "wn-max-w-7xl wn-mx-auto wn-px-4";
|
||||
$wrapper_class = $contentWidth === 'full' ? "wn-w-full" : "wn-max-w-7xl wn-mx-auto wn-px-4";
|
||||
$grid_class = "wn-mx-auto";
|
||||
|
||||
if ($has_image && in_array($image_pos, ['left', 'right', 'image-left', 'image-right'])) {
|
||||
@@ -275,8 +284,8 @@ class PageSSR
|
||||
// Section Styles (Background)
|
||||
$bg_type = $section_styles['backgroundType'] ?? 'solid';
|
||||
$bg_color = $section_styles['backgroundColor'] ?? '';
|
||||
$padding = $section_styles['paddingTop'] ?? '';
|
||||
$height_preset = $section_styles['heightPreset'] ?? '';
|
||||
$pt = $section_styles['paddingTop'] ?? '';
|
||||
$pb = $section_styles['paddingBottom'] ?? '';
|
||||
|
||||
$css = "";
|
||||
if ($bg_type === 'gradient') {
|
||||
@@ -289,22 +298,34 @@ class PageSSR
|
||||
}
|
||||
|
||||
// Height Logic
|
||||
$preset_padding = '';
|
||||
if ($height_preset === 'screen') {
|
||||
$css .= "min-height: 100vh; display: flex; align-items: center;";
|
||||
$padding = '5rem'; // Default padding for screen to avoid edge collision
|
||||
$preset_padding = '5rem'; // Default padding for screen to avoid edge collision
|
||||
} elseif ($height_preset === 'small') {
|
||||
$padding = '2rem';
|
||||
$preset_padding = '2rem';
|
||||
} elseif ($height_preset === 'large') {
|
||||
$padding = '8rem';
|
||||
$preset_padding = '8rem';
|
||||
} elseif ($height_preset === 'medium') {
|
||||
$padding = '4rem';
|
||||
$preset_padding = '4rem';
|
||||
}
|
||||
|
||||
if ($padding) $css .= "padding:{$padding} 0;";
|
||||
if ($pt) {
|
||||
$css .= "padding-top:{$pt};";
|
||||
} elseif ($preset_padding) {
|
||||
$css .= "padding-top:{$preset_padding};";
|
||||
}
|
||||
|
||||
if ($pb) {
|
||||
$css .= "padding-bottom:{$pb};";
|
||||
} elseif ($preset_padding) {
|
||||
$css .= "padding-bottom:{$preset_padding};";
|
||||
}
|
||||
|
||||
$style_attr = $css ? "style=\"{$css}\"" : "";
|
||||
|
||||
$inner_html = self::render_universal_row($props, 'left', $color_scheme, $element_styles);
|
||||
$contentWidth = $section_styles['contentWidth'] ?? 'contained';
|
||||
$inner_html = self::render_universal_row($props, 'left', $color_scheme, $element_styles, ['contentWidth' => $contentWidth]);
|
||||
|
||||
return "<section id=\"{$id}\" class=\"wn-section wn-content wn-scheme--{$color_scheme}\" {$style_attr}>{$inner_html}</section>";
|
||||
}
|
||||
@@ -316,8 +337,8 @@ class PageSSR
|
||||
{
|
||||
$bg_type = $section_styles['backgroundType'] ?? 'solid';
|
||||
$bg_color = $section_styles['backgroundColor'] ?? '';
|
||||
$padding = $section_styles['paddingTop'] ?? '';
|
||||
$height_preset = $section_styles['heightPreset'] ?? '';
|
||||
$pt = $section_styles['paddingTop'] ?? '';
|
||||
$pb = $section_styles['paddingBottom'] ?? '';
|
||||
|
||||
$css = "";
|
||||
if ($bg_type === 'gradient') {
|
||||
@@ -330,21 +351,33 @@ class PageSSR
|
||||
}
|
||||
|
||||
// Height Logic
|
||||
$preset_padding = '';
|
||||
if ($height_preset === 'screen') {
|
||||
$css .= "min-height: 100vh; display: flex; align-items: center;";
|
||||
$padding = '5rem';
|
||||
$preset_padding = '5rem';
|
||||
} elseif ($height_preset === 'small') {
|
||||
$padding = '2rem';
|
||||
$preset_padding = '2rem';
|
||||
} elseif ($height_preset === 'large') {
|
||||
$padding = '8rem';
|
||||
$preset_padding = '8rem';
|
||||
} elseif ($height_preset === 'medium') {
|
||||
$padding = '4rem';
|
||||
$preset_padding = '4rem';
|
||||
}
|
||||
|
||||
if ($padding) $css .= "padding:{$padding} 0;";
|
||||
if ($pt) {
|
||||
$css .= "padding-top:{$pt};";
|
||||
} elseif ($preset_padding) {
|
||||
$css .= "padding-top:{$preset_padding};";
|
||||
}
|
||||
|
||||
if ($pb) {
|
||||
$css .= "padding-bottom:{$pb};";
|
||||
} elseif ($preset_padding) {
|
||||
$css .= "padding-bottom:{$preset_padding};";
|
||||
}
|
||||
$style_attr = $css ? "style=\"{$css}\"" : "";
|
||||
|
||||
$inner_html = self::render_universal_row($props, $layout, $color_scheme, $element_styles);
|
||||
$contentWidth = $section_styles['contentWidth'] ?? 'contained';
|
||||
$inner_html = self::render_universal_row($props, $layout, $color_scheme, $element_styles, ['contentWidth' => $contentWidth]);
|
||||
|
||||
return "<section id=\"{$id}\" class=\"wn-section wn-image-text wn-scheme--{$color_scheme}\" {$style_attr}>{$inner_html}</section>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user