xmaverick56 Posted April 17, 2014 Share Posted April 17, 2014 So this is probably an incredibly simple thing to do, but humor me: I'm using the following to create the navigation for my site in the header.inc: <?php $root = $pages->get("/"); $children = $root->children(); $children->prepend($root); foreach($children as $child) { echo "<li><a href='{$child->url}'>{$child->title}</a></li>"; } ?> And it works just fine. My total noob hang-up is that I want the <li> markup to be <li class="col"> so that my CSS styles are applied to it. How do I make that happen? Thanks in advance! Link to comment Share on other sites More sharing options...
adrian Posted April 17, 2014 Share Posted April 17, 2014 I assume you are having issues with quote matching? You can take a couple of different approaches: echo "<li class='col'><a href='{$child->url}'>{$child->title}</a></li>"; echo '<li class="col"><a href="'.$child->url.'">'.$child->title.'</a></li>'; Have a read through some of these links: http://www.scriptingok.com/tutorial/Single-quotes-vs-double-quotes-in-PHP http://www.trans4mind.com/personal_development/phpTutorial/quotes.htm http://techtalk.virendrachandak.com/php-double-quotes-vs-single-quotes/ 3 Link to comment Share on other sites More sharing options...
xmaverick56 Posted April 22, 2014 Author Share Posted April 22, 2014 Evidently I was. Thought I had checked that about a dozen times; sometimes you just need another set of eyes and a few days break. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now