2017-02-23, 13:28:34
The second method:
The second method is interesting. That's what I was looking for.
The following apply: I18N Plugin, HTML, CSS and some PHP.
Menu rendering in components and code in Html targeted for UIkit 2.27.2 CSS Framework(https://getuikit.com/v2/)
Here I want to show only method
Component:
<?php get_component('off-canvas-menu'); ?>
This is what you need) Checking for compliance URL:
if ($item->url == 'vidy-rabot')
This code displays all of the child items for page 'vidy-rabot':
$bc = return_i18n_breadcrumbs(return_page_slug());
get_i18n_navigation($bc[0]['url']=='vidy-rabot'?return_page_slug():'vidy-rabot',1,2,I18N_SHOW_MENU, 'off-canvas-menu');
In this way, we can replace one menu item to another, or to include all its subsidiary pages instead of the menu, as shown here.
This code inserts the template:
The second method is interesting. That's what I was looking for.
The following apply: I18N Plugin, HTML, CSS and some PHP.
Menu rendering in components and code in Html targeted for UIkit 2.27.2 CSS Framework(https://getuikit.com/v2/)
Here I want to show only method
Component:
<?php get_component('off-canvas-menu'); ?>
PHP Code:
<?php
$s = array('current', 'activepath', 'currentpath', 'open');
$r = array('uk-active', 'active', 'active', 'uk-parent');
$c = str_replace($s, $r, $item->classes);
?>
<?php
if ($item->url == 'vidy-rabot'){
$bc = return_i18n_breadcrumbs(return_page_slug());
get_i18n_navigation($bc[0]['url']=='vidy-rabot'?return_page_slug():'vidy-rabot',1,2,I18N_SHOW_MENU, 'off-canvas-menu');
} else {
?>
<li class="<?php echo $c; ?>">
<?php if ($item->isOpen) { ?>
<a href="#">
<?php echo htmlspecialchars($item->text); ?>
</a>
<ul class="uk-nav-sub">
<?php $item->outputChildren(); ?>
</ul>
<?php } else { ?>
<a href="<?php echo htmlspecialchars($item->link); ?>">
<?php echo htmlspecialchars($item->text); ?>
</a>
<?php } ?>
</li>
<?php } ?>
This is what you need) Checking for compliance URL:
if ($item->url == 'vidy-rabot')
This code displays all of the child items for page 'vidy-rabot':
$bc = return_i18n_breadcrumbs(return_page_slug());
get_i18n_navigation($bc[0]['url']=='vidy-rabot'?return_page_slug():'vidy-rabot',1,2,I18N_SHOW_MENU, 'off-canvas-menu');
In this way, we can replace one menu item to another, or to include all its subsidiary pages instead of the menu, as shown here.
This code inserts the template:
Code:
<div id="offcanvas" class="uk-offcanvas">
<div class="uk-offcanvas-bar uk-offcanvas-bar-flip">
<ul class="uk-nav uk-nav-offcanvas uk-nav-parent-icon uk-margin-bottom uk-margin-top" data-uk-nav="{multiple:true}">
<?php function_exists('get_i18n_navigation') ? get_i18n_navigation(return_page_slug(),0,99,I18N_SHOW_MENU,'off-canvas-menu') : get_navigation(get_page_slug(FALSE)); ?>
</ul>
</div>
</div>
I use machine translation. Forgive me my errors.