fix(list): wire Zibll list/card display chain end-to-end
Resolve post list mode from global list_type + surface card overrides so homepage/archives/AJAX honor admin list and card style settings.
This commit is contained in:
1 parent
b2815614d1
commit
d73a7af25e
17 files changed
+444
-151
No files matched your search
@@ -50,6 +50,7 @@ if (!function_exists('aksrt_renderer_defaults')) {
|
||||
'multi_thumb_limit' => 4,
|
||||
'multi_thumb_min' => 2,
|
||||
'list_show_type' => 'separate',
|
||||
'list_img_position' => 'left',
|
||||
'number_offset' => 0,
|
||||
'show_number' => false,
|
||||
'extra_class' => '',
|
||||
@@ -87,9 +88,15 @@ if (!function_exists('aksrt_renderer_config')) {
|
||||
$cfg['show_comments'] = false;
|
||||
}
|
||||
|
||||
if ($cfg['mode'] === 'card' || $cfg['mode'] === 'grid-cms') {
|
||||
$cfg['style'] = $cfg['style'] === 'default' ? 'style3' : $cfg['style'];
|
||||
if (in_array((string) $cfg['style'], ['default', 'null'], true)) {
|
||||
$cfg['style'] = '';
|
||||
}
|
||||
$cfg['list_img_position'] = in_array(sanitize_key((string) ($cfg['list_img_position'] ?? 'left')), ['left', 'right'], true)
|
||||
? sanitize_key((string) ($cfg['list_img_position'] ?? 'left'))
|
||||
: 'left';
|
||||
$cfg['list_show_type'] = in_array(sanitize_key((string) ($cfg['list_show_type'] ?? 'separate')), ['separate', 'no_margin'], true)
|
||||
? sanitize_key((string) ($cfg['list_show_type'] ?? 'separate'))
|
||||
: 'separate';
|
||||
|
||||
return $cfg;
|
||||
}
|
||||
@@ -514,7 +521,11 @@ if (!function_exists('aksrt_renderer_thumb')) {
|
||||
$target_attr = !empty($cfg['target_blank']) ? ' target="_blank"' : '';
|
||||
|
||||
if ($cfg['mode'] === 'list') {
|
||||
return '<div class="post-graphic"><div class="item-thumbnail' . esc_attr($empty_class) . '"><a href="' . esc_url($href) . '" rel="bookmark"' . $target_attr . '>'
|
||||
$graphic_class = 'post-graphic';
|
||||
if (($cfg['list_img_position'] ?? 'left') === 'right') {
|
||||
$graphic_class .= ' order1';
|
||||
}
|
||||
return '<div class="' . esc_attr($graphic_class) . '"><div class="item-thumbnail' . esc_attr($empty_class) . '"><a href="' . esc_url($href) . '" rel="bookmark"' . $target_attr . '>'
|
||||
. $img_html . '</a>' . $sticky_html . $format_badge . '</div></div>';
|
||||
}
|
||||
|
||||
@@ -714,6 +725,7 @@ if (!function_exists('aksrt_renderer_list')) {
|
||||
}
|
||||
if (($cfg['list_show_type'] ?? 'separate') === 'no_margin') {
|
||||
$classes[] = 'no-margin';
|
||||
$classes[] = 'no_margin';
|
||||
}
|
||||
|
||||
$thumb = aksrt_renderer_thumb($data, $cfg);
|
||||
|
||||
Reference in new issue
Block a user