Jump to content
  • 0

How To Add Some Elements On Here?


Question

5 answers to this question

Recommended Posts

  • 0
Posted

You can do either:

 

1. Edit Structure.pdt and add stuff after this:

<?php
								foreach ($this->Html->ifSet($nav, array()) as $link => $value) {
									$attributes = array();
									$link_attributes = array();
									$dropdown = !empty($value['sub']);
									$active = false;
									
									if ($value['active']) {
										$active = true;
										$attributes['class'][] = "active";
										$active_nav = $value;
									}
									if ($dropdown) {
										$attributes['class'][] = "dropdown";
										$link_attributes['class'][] = "dropdown-toggle";
										$link_attributes['data-toggle'][] = "dropdown";
										
										// Set parent to active if child is
										if (!$active) {
											foreach ($this->Html->ifSet($value['sub'], array()) as $sub_link => $sub_value) {
												if ($sub_value['active']) {
													$attributes['class'][] = "active";
													break;
												}
											}
										}
									}
								?>
								<li<?php echo $this->Html->buildAttributes($attributes);?>>
									<a href="<?php $this->Html->_($link);?>"<?php echo $this->Html->buildAttributes($link_attributes);?>>
										<i class="<?php $this->Html->_($value['icon']);?>"></i> 
										<?php
										$this->Html->_($value['name']);
										
										if ($dropdown) {
										?>
										<b class="caret"></b>
										<?php
										}
										?>
									</a>
									<?php
									if (!empty($value['sub'])) {
									?>
									<ul class="dropdown-menu">
										<?php
										foreach ($this->Html->ifSet($value['sub'], array()) as $sub_link => $sub_value) {
										?>
										<li>
											<a href="<?php $this->Html->_($sub_link);?>"><i class="<?php $this->Html->_($sub_value['icon']);?>"></i> <?php $this->Html->_($sub_value['name']);?></a>
										</li>
										<?php
										}
										?>
									</ul>
									<?php
									}
									?>
								</li>
								<?php
								}
								?>

2. Or you can use the Admin Tools plugin from Naja7host.

  • 0
Posted
  On 2/12/2015 at 5:17 PM, Tyson said:

You can write a plugin that adds elements to the main navigation using the nav_primary_staff plugin action.

@Tyson , i think this is another reason to unlock the primary key for navigation . to add just 3 navigation link , you need to write 3 plugins , is this logical for you ?

  • 0
Posted
  On 2/12/2015 at 10:05 PM, naja7host said:

@Tyson , i think this is another reason to unlock the primary key for navigation . to add just 3 navigation link , you need to write 3 plugins , is this logical for you ?

 

My response to that is in your feature request thread. I'm deferring to Cody for an update to plugin actions.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...