Theme Navigation

Permalink 1 user found helpful
I may be missing something here, but I'm working on a template and I don't understand how I should setup the navigation I've built to plug into c5. As is, the links of course link to the pages I'll make. I'm not sure how I need to set up those links to work properly in c5. That is, once I start using the template, I'll begin making my pages, which will all be in c5. So how to I code my navigation work properly in c5 to link to those pages I create in c5?
I may be overlooking something, or it's much more simple than what I'm making it out to be.
The navigation I've made is simple enough, got a few drop downs. Here's an example:
<ul id="nav">
<li>
<a href="http://www.somesite.com">Welcome</a>
</li>
<li><a href="#">Services</a>
     <ul>
     <li><a href="#">Residential</a></li>
     <li><a href="#">Business</a></li>                     
     </ul>
</li>
<li><a href="#">About Us</a></li>
<li><a href="#">Meet Our Staff</a></li>
<li><a href="#">Gallery</a>
     <ul>
     <li><a href="#">Wood</a></li>


I have no clue how I need to code the links to work in c5 after I make pages with the template. Anyone out there that can offer advice on this would be greatly appreciated!

Thanks in advance.
Abs0lute

Abs0lute
 
Mnkras replied on at Permalink Reply
Mnkras
did you make the css for the dropdown?

all you have to do is add an autonav block and it will make that structure
bryanlewis replied on at Permalink Reply
bryanlewis
need a css dropdown menu for the market place. :)
Abs0lute replied on at Permalink Reply
Abs0lute
I've got a CSS dropdown menu. I just need help implementing it's setup in c5. What happened to that code 1235j posted? Is it that big of a secret? It just disappeared. Not sure what's going on here, but I need that code!
I'd hate to have to buy a menu I'm not going to use from the marketplace just to see the 2 lines of code that 1235j posted for me earlier:(
Abs0lute
Abs0lute replied on at Permalink Reply
Abs0lute
mmm, interesting.
Through researching I realized my naming schematic matched c5's, so that's handy.
I've already got the CSS for it. It used jQuery too for the drop-downs to add a smooth bounce effect as it rolls out.
So if I understand correctly, I just need to put the ul in w/ the code you gave me 1235j, then use auto-nav to populate it w/ list items? Then let my CSS handle the look and positioning?
Is that right? That's all there is to it?
I love c5 for it's ease of use, but this is more like a miracle.
Thanks for your help, I'll keep you updated on the status!
Abs0lute
12345j replied on at Permalink Reply
12345j
hi absolute. I realized the code I gave you didn't apply, I thought you were trying to do something different. anyway, you should download one of mnkrass themes called destyle. This theme is free and has a built in auto nav. What you should take from it is the blocks folder, copy that to the root of your theme, the superfish.css file and then this code
<?php 
            $bt = BlockType::getByHandle('autonav');
            $bt->controller->displayPages = 'top';
            $bt->controller->orderBy = 'display_asc';                    
            $bt->controller->displaySubPages = 'all'; 
            $bt->controller->displaySubPageLevels = 'custom';
            $bt->controller->displaySubPageLevelsNum = '3';   
            $bt->render('templates/header_menu_dropdown');
         ?>

you'll also want to call for superfish.css for your theme. Basically then what you want to edit is superfish.css under Destyle Main menu (though you'll probably have to rename .ts-main-menu to whatever your nav is.) Then you just style the css here, id recommend using background colors until you figure out what each part does. if you can't follow what im trying to say you can just pm me.

Another method is described by remo here:http://www.codeblog.ch/2009/04/concrete5-drop-down-menu/...
Abs0lute replied on at Permalink Reply
Abs0lute
Awesome.
I've been looking into destyle already, so we're on the same page. I'll have a look this evening at it. I knew the answer was in that theme, just wan't sure what I was looking for. Thanks for the direction!
I'll keep you posted.
Abs0lute
Mnkras replied on at Permalink Reply
Mnkras
you don't need superfish for a dropdown menu, its entirely optional
12345j replied on at Permalink Reply
12345j
yes but the superfish.css file works as a stylesheet that incorporates hiding the autonav when not in use, easier to edit preexisting than make a new one.
Abs0lute replied on at Permalink Reply
Abs0lute
Awesome!
Got it working, didn't even need the superfish.css file. Thanks Mnkras and 12345j!
I already the navigation working like a champ. I was just confused on how to work it into the template to allow Auto-Nav to handle it.
Many thank!
Extra Thanks to Mnkras for the great free template destyle. It's a wonderful template, but I just needed to see how your autonav worked.
Killer. Thanks guys!
Abs0lute
Abs0lute replied on at Permalink Reply
Abs0lute
Hey 12345j & Mnfras!
Hope you're enjoying the c5 site facelift. I love it. They did a great job.
That being said, back to my auto-nav. It works and displays correctly, but it doesn't work right. Every link I click on seems to take me to the same page. I'm not sure if Pretty URLs is causing the issue or not. I've got them enabled and working, but when I click a link, the URL changes correctly, just the page being displayed is the same.
Any advice?
12345j replied on at Permalink Reply
12345j
what was the last thing you did while it was still working? id go back and undo that.
Abs0lute replied on at Permalink Reply
Abs0lute
Actually, I don't think it ever was working. It's appearance was working and it worked when I created a new page, it would add it to the menu. At that time, I hadn't setup any pages, so I didn't think to check and make sure it was linking to the correct page. So really, all that's working is the appearance and adding new pages to the nav. But the correct linking to those pages is not working.
Stumped.
Mnkras replied on at Permalink Reply
Mnkras
if you could link to the site that would help
Abs0lute replied on at Permalink Reply
Abs0lute
The site link ishttp://www.sharpfence.com/index.php....
Note that I've got the old site still running, which is all .html.
So if you just go tohttp://www.sharpfence.com, it'll take you to the old site — index.html. The c5 site is running under index.php. When you click "Home" in the auto-nav, it will take you to the html site. All other links should take you to the right place, but it appears to just keep recycling the index.php page content on all the pages in the auto-nav.
Mnkras replied on at Permalink Reply
Mnkras
c5 is working correctly, i think its just the rewrite rule thats causing issues, if you disable pretty urls and remove the .htaccess file it should work,
Abs0lute replied on at Permalink Reply
Abs0lute
I just disabled it. Did spot a code error and corrected. Removed pretty URLs and it works, which brings me to my other thread:
http://www.concrete5.org/community/forums/customizing_c5/pretty-url...

But I did NOT remove the .htaccess file and it's working. So my c5 is fine, it's just a matter of dealing w/ the hosting and mod_rewrite you think?
Mnkras replied on at Permalink Reply
Mnkras
i don't think pretty urls will work untill the index.html is moved/renamed
Abs0lute replied on at Permalink Reply
Abs0lute
Tried that too. It's like that right now.
I get a "No input file specified." page. No styling, just text.
Mnkras replied on at Permalink Reply
Mnkras
what host are you on, if you have php running as fcgi change it to normal cgi
Abs0lute replied on at Permalink Reply
Abs0lute
I'm on Bluehost. It is running fastCGI. I removed the apache
Handler: fcgid-script
Extension(s): .php
Pretty sure that's how it's done on Bluehost. Does the server have to be restarted for those types of changes to take effect?
Abs0lute replied on at Permalink Reply
Abs0lute
undid that. Not sure if it was correct. I've put in a ticket w/ Bluehost. Hopefully they'll be able to help.
12345j replied on at Permalink Reply
12345j
unrelated but you have errors relating to the div id="page" in your sourcecode, its above the html declaration. might want to fix that while looking at the theme.
Abs0lute replied on at Permalink Reply
Abs0lute
Thanks 12345j!
No clue what's causing that, but certainly needs fixing.
Possible bug you think?
My elements » header.php file looks like this up to the navigation—any ideas why it's putting the page div there before the html?
<?php  defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="Shortcut Icon" href="<?php echo $this->getThemePath()?>/favicon.ico" type="image/x-icon" />
<style type="text/css">@import "<?php echo $this->getThemePath()?>/style.css";</style>
<style type="text/css">@import "<?php echo $this->getThemePath()?>/typography.css";</style>
<!--   * GOOGLE FONT DIRECTORY: Arvo reg, italic, bold, & bold italic   *   -->
<link href='http://fonts.googleapis.com/css?family=Arvo:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>
<!--   *   EDITING HEADER   *   -->
<?php  Loader::element('header_required'); ?>
</head>
<body>
<!--      *    PAGE   *      -->
<div id="page">
Abs0lute replied on at Permalink Reply
Abs0lute
Caught it. A self-made bug!
Had the page div in the default.php file and the header.
Thanks for the catch 123.
12345j replied on at Permalink Reply
12345j
looks like you got it working. what did the trick?
Mnkras replied on at Permalink Reply
Mnkras
im betting on the fcgi as there is a bug in php that screws with path_info
Abs0lute replied on at Permalink Reply
Abs0lute
Didn't get the pretty urls working, just turned them off until I hear from Bluehost. Nav works now, but it's got index.php in from of every other url. I can live with that if need be - but I really hope I can solve this and post the answer - and get a new badge!
Thanks to both of you for your help, I'll keep you posted.
Abs0lute replied on at Permalink Best Answer Reply
Abs0lute
Got Pretty_URLs working on Bluehost — and still have FastCGI running!
Hopefully this will help others. If so, please mark it so in the forums:)
This solution came via Jereme Claussen:
http://jeremeclaussen.com/blog/2010/3/30/concrete5-pretty-urls-and-...

In a nutshell, here's how to do it:

1) Create a new php file w/ the following code:
<?php require('index.php'); ?>


2) Save as "pretty_url.php" and place it in your site's root directory.

3) Enable Pretty URLs in the Sitewide Setting in c5. Copy the .htaccess file info that it displays.

4) Create a new plain text file and paste in the code you copied. Then find the following line:
RewriteRule ^(.*)$ index.php/$1 [L]

and replace with the following:
RewriteRule ^.*$ pretty_url.php/$1 [L]
.

5) Save it w/ your local site at -htaccess. This will prevent the file from disappearing. If you name it .htaccess locally, it will turn invisible and you'll need to turn invisible files visible to see it.

6) Upload to your site root, then rename it there to .htaccess.

7) Make sure in your config/site.php file you have this:
define('DIR_REL', '');


That's it! Good to go. I was building the c5 site behind the scenes, so in my directory I still had the old site running under index.html—which I'll remove when I'm ready for the c5 site to go live. This will not work if you have an index.html file, so be sure you don't.

I did notice my blog appears sometimes w/www.www.site.com/index.php/blog,... but if I visit a post, it correctly showshttp://www.site.com/blog. That's the only one that alternates between showing the index.php and not showing it. Overall though, this will get your Pretty URLs looking so good, they may make you blush.
Thanks to all for helping.
12345j replied on at Permalink Reply
12345j
you should be able to mark your own post as the answer, btw.
Abs0lute replied on at Permalink Reply
Abs0lute
Wish I could, but I felt you answer earlier on setting up the auto-nav was more appropriate. Maybe someone else will find it useful and mark it. Thanks again.