Manual_Nav Custom Template

Permalink
Hello,

I am trying to use the Manual_Nav add-on to produce a horizontal navigation menu.

I am trying to use a custom template to produce the horizontal result.

I have the view.php moved to the correct location and it is working correctly. I can select a custom template called my_template under Custome Template.

The real problem is I am very new to PHP and do not know how to edit view.php to get the desired result. Below is my view.php file.

<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?>

<ul class="ccm-manual-nav">
<?php foreach ($links as $link):
$cssClasses = array();

if ($link->isCurrent) {
$cssClasses[] = 'nav-selected';
}

if ($link->inPath) {
$cssClasses[] = 'nav-path-selected';
}

$cssClasses = implode(' ', $cssClasses);
?>

<li class="">
<a href="<?php echo $link->url; ?>" class="<?php echo $cssClasses; ?>">
<?php echo htmlentities($link->text, ENT_QUOTES, APP_CHARSET); ?>
</a>
</li>

<?php endforeach; ?>
</ul>


Again I need to edit this so I have a horizontal view instead of vertical.

Bryan-

 
keeasti replied on at Permalink Reply
keeasti
I think you need to do this in the CSS (view.css)

Something like this:

.nav li {
 position: relative;
 float: left;
}


the .nav class maybe different for you ... adjust to taste!
bmcguire replied on at Permalink Reply
Ha... maybe you did not catch my statement.."I am very new to PHP".

When you say "the .nav class maybe different for you .... adjust to taste", what do you mean? I can see in the view.php file I have only the ul class="ccm-manual-nav".

Also I can't find a view.css.
grosik replied on at Permalink Reply
grosik
style which keesati posted is a CSS class which refers to each list item in the list. so in your case it will be :

ul.ccm-manual-nav li {
postion: relative;
float: left;
}


if you don't have view.css file just create it in your custom_template direcectory (f.e [root]/blocks/manual_nav/templates/your_custom_template/view.css) - basicly the same directory as view.php
jordanlev replied on at Permalink Reply
jordanlev
I wouldn't even bother with making a custom view.css file -- instead, just put the css rules in your theme's stylesheet. If you don't know where that is, tell us what theme you're using (is it a built-in c5 theme? a marketplace theme you downloaded? a custom theme you built yourself?) and someone can surely point you to the proper file.
keeasti replied on at Permalink Reply
keeasti
As others have also pointed out it is a CSS class (not PHP) and Jordan's suggestion of putting it in your theme's stylesheet is a good one. Do you have a link to the page test site ... maybe I can help more that way?