-
Notifications
You must be signed in to change notification settings - Fork 253
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
Add ability to add multiple sub-templates #8381
base: release-3.0
Are you sure you want to change the base?
Conversation
$before = array_slice(Utils::$context['template_layers'], 0, $position + 1); | ||
$after = array_slice(Utils::$context['template_layers'], $position + 1); | ||
Utils::$context['template_layers'] = array_merge($before, ['maint_warning'], $after); | ||
array_splice(Utils::$context['template_layers'], $position + 1, 0, ['maint_warning']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, what is maint_warning
? Maybe main_warning
, main
, or warning
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maintenance warning.
Co-authored-by: Bugo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from indentation issue, LGTM.
Sources/Theme.php
Outdated
'thumbnail' => file_exists($theme_data['theme_dir'] . '/images/thumbnail_' . $variant . '.png') ? $theme_data['images_url'] . '/thumbnail_' . $variant . '.png' : (file_exists($theme_data['theme_dir'] . '/images/thumbnail.png') ? $theme_data['images_url'] . '/thumbnail.png' : ''), | ||
]; | ||
} | ||
|
||
Utils::$context['available_themes'][$id_theme]['selected_variant'] = $_GET['vrt'] ?? (!empty($variant_preferences[$id_theme]) ? $variant_preferences[$id_theme] : (!empty(self::$current->settings['default_variant']) ? self::$current->settings['default_variant'] : self::$current->settings['theme_variants'][0])); | ||
Utils::$context['available_themes'][$id_theme]['selected_variant'] = $_GET['vrt'] ?? (!empty($variant_preferences[$id_theme]) ? $variant_preferences[$id_theme] : (!empty(self::$current->settings['default_variant']) ? self::$current->settings['default_variant'] : self::$current->settings['theme_variants'][0])); | ||
|
||
if (!isset(Utils::$context['available_themes'][$id_theme]['variants'][Utils::$context['available_themes'][$id_theme]['selected_variant']]['thumbnail'])) { | ||
Utils::$context['available_themes'][$id_theme]['selected_variant'] = self::$current->settings['theme_variants'][0]; | ||
} | ||
if (!isset(Utils::$context['available_themes'][$id_theme]['variants'][Utils::$context['available_themes'][$id_theme]['selected_variant']]['thumbnail'])) { | ||
Utils::$context['available_themes'][$id_theme]['selected_variant'] = self::$current->settings['theme_variants'][0]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These indentation changes appear to be a mistake.
EDIT: for some reason GitHub isn't showing all the lines I commented on, but this comment was meant to include lines -2195 to +2220 (meaning, the indentation change before 'thumbnail' => ...
and all following lines.)
The latest commit brought back the weird indentation again |
right. GitKraken didn't show it. Will reverse that.
…On Tue, Dec 31, 2024 at 1:34 PM Jon Stovell ***@***.***> wrote:
The latest commit brought back the weird indentation again
—
Reply to this email directly, view it on GitHub
<#8381 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADJNN2BTBRVXG7AVVRNBYL2IL5WTAVCNFSM6AAAAABUKV6KSWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRWG4YDANBWHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
We have several templates (layers) that just call others. This commit introduces
Utils::$context['sub_templates']
which is a simple list of templates to callBonus: If a template name is array, the second element shall be parametres to pass to the function. Similar structure to $post_errors in the Post action.