mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 11:50:30 +02:00
Mega-Menu shortcode example added to Bootstrap theme.
This commit is contained in:
@@ -15,7 +15,7 @@ if (!defined('e107_INIT')) { exit; }
|
||||
* @param string $parm['source'] latest (latest news items) | sticky (news items) | template (assigned to news-grid layout)
|
||||
* @param integer $parm['order'] n.news_datestamp DESC
|
||||
* @param integer $parm['limit'] 10
|
||||
* @param string $parm['template'] default | or any key as defined in news_grid_template.php
|
||||
* @param string $parm['layout'] default | or any key as defined in news_grid_template.php
|
||||
*
|
||||
* @example hard-coded {MENU: path=news/news_grid&limit=6&source=latest&featured=2&template=other}
|
||||
* @example admin assigned - Add via Media-Manager and then configure.
|
||||
@@ -24,4 +24,6 @@ if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
$cached = e107::getObject('news')->render_newsgrid($parm);
|
||||
|
||||
var_dump($parm);
|
||||
|
||||
echo $cached;
|
||||
|
@@ -156,6 +156,23 @@ li.dropdown-submenu.lower ul.submenu-start li:hover { background-color:#f5f5f5;
|
||||
.news-grid-default .featured { margin-bottom:30px; }
|
||||
.news-grid-other .featured { margin-bottom:30px; }
|
||||
|
||||
|
||||
/* MENU MENU Example*/
|
||||
|
||||
|
||||
|
||||
.theme-sc-bootstrap-megamenu-example { position: static !important; }
|
||||
|
||||
.theme-sc-bootstrap-megamenu-example .dropdown-menu {
|
||||
padding: 20px 15px 15px;
|
||||
width: 100%;
|
||||
}
|
||||
.theme-sc-bootstrap-megamenu-example .dropdown-menu ul.media-list {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* CUSTOM Responsive Styles */
|
||||
|
||||
|
||||
|
@@ -261,6 +261,36 @@ class theme_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Mega-Menu Shortcode Example.
|
||||
* @usage Select "bootstrap_megamenu_example" in Admin > Sitelinks > Create/Edit > Function
|
||||
* @notes Changing the method name will require changing .theme-sc-bootstrap-megamenu-example in style.css
|
||||
* @param null $data Link data.
|
||||
* @return string
|
||||
*/
|
||||
function sc_bootstrap_megamenu_example($data)
|
||||
{
|
||||
// include a plugin, custom code, whatever you wish.
|
||||
|
||||
// return print_a($data,true);
|
||||
|
||||
$parm= array();
|
||||
$parm['caption'] = '';
|
||||
$parm['titleLimit'] = 25; // number of chars fo news title
|
||||
$parm['summaryLimit'] = 50; // number of chars for new summary
|
||||
$parm['source'] = 'latest'; // latest (latest news items) | sticky (news items) | template (assigned to news-grid layout)
|
||||
$parm['order'] = 'DESC'; // n.news_datestamp DESC
|
||||
$parm['limit'] = '6'; // 10
|
||||
$parm['layout'] = 'media-list'; // default | or any key as defined in news_grid_template.php
|
||||
$parm['featured'] = 0;
|
||||
|
||||
|
||||
return "<div class='container'>". e107::getObject('news')->render_newsgrid($parm) ."</div>";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user