How to implement navigation in static site generator Assemble - gruntjs

I'd like to build navigation for the static site that I'm generating with Assemble.
Currently, I have a pages directory, and several sub-directories within that directory. I'd love to be able to generate some kind of hierarchy or structured navigation like:
<ul>
<li>About Us
<ul>
<li>Sub Page 1</li>
<li>Sub Page 2</li>
<li>Sub Page 3</li>
</ul>
</li>
</ul>
Is there a preferred way to do this without hard-coding links to all of my pages?

Related

get_permalink() returns empty for certain page IDs

<ul class="stageList2">
<li><a class="sel">Stage 1</a></li>
<li>Stage 2</li>
<li>Stage 3</li>
<li>Stage 4</li>
<li>Stage 5</li>
<li>Stage 6</li>
<li>Stage 7</li>
<li>Stage 8</li>
<li>Stage 9a</li>
<li>Stage 9b</li>
</ul>
<ul class="stageList2">
<li>Stage 10</li>
<li>Stage 11</li>
<li>Stage 12</li>
<li>Stage 13</li>
<li>Golf Stage 1</li>
<li>Golf Stage 2</li>
<li>Golf Stage 3</li>
<li>Golf Stage 4</li>
<li>Golf Stage 5</li>
<li>Golf Stage 6</li>
I have this code on part of my page. I am trying to get the permalinks for these specific pages, but it returns nothing and the href attribute of the links are empty. If I use other IDs than these ones listed here, the permalinks are returned fine. Also, if I use these IDs to get a permalink on another part of the site, it is returned fine there too. There is something about this specific part of this page template and these specific page IDs that won't allow me to return the permalinks.
Has anybody ever experienced anything like this before? Is it some kind of bug that can be fixed?
I have moved my entire WordPress website to a new server, and these permalinks were working completely fine on the other server. I have also disabled all my plugins to see if any of them were causing any errors, but it is still not working.
Cheers,
Justin
When you moved your website to a new server is highly probably that the ids changed depending on how you did the migration and even the configuration of the database in the new host. I always tried to avoid using id's on the templates. They are not good for reading the code. You can get an id from a title. Something like this:
get_permalink( get_page_by_title( 'Monthly Events' ) );
The function get_page_by_title will give you the id of the page or post. An even better approach would have been using categories and then iterating over the categories with a loop and query_posts.
Related to you problem. First, check in the database (if I am not wrong, the table wp_posts) if those numbers (ids) exist. I bet not. If not, you can do an import and export of the database with any database manager (like phpmyadmin), without using the wordpress import/export plugin.
Possible Solution 1: Imagine your workspace. You have your website open to view your changes right? Okay, so when you write code it doesn't matter how many times your refresh the browser... nothing will show until you save the code.
Adding a page through your wordpress dashboard is the same thing with respect to your WAMP/XAMP/whatever. I had this issue and I refreshed(right click toolbar icon>"Refresh". DON'T DO ANYTHING UNTIL ITS DONE!) my WAMP server and the problem went away.
I can't guarantee this will work but it's super simple to do. Hope this works for ya!
Possible Solution 2: try outputting the get_permalink() (empty parameter). If that prints try href="<.?php echo get_permalink(); ?>[slug-name]"> [prints htt.p:/[sitename]/ and you just add the [slug-name] or whatever to the end]

Linking back from the blog page/file

See this link for description in practice on Blog link on navigation bar
Have installed the following Blog link on navigation bar of a website all contents of which is contained within the file bcf_site. The Blog script including its index.php is in the bcf_blog file which is in the main site file. This arrangement works fine on the navigation bar with the link to the Blog page as follows.
<li>Blog</li>
To navigate back out of the Blog file back to the webpages requires following this path: default>themes>bcf_blog>bcf_site>relevant .html page link on the navigation.
How should the following site navigation be altered so as to facilitate return to the main site pages:
<div class="topnav">
<ol class="dropnav">
<li>Home</li>
<li>About
<ol>
<li>Community Forum</li>
<li>Administration Committee</li>
<li>Representative Committees</li>
<li>Working Groups</li>
</ol>
</li>
<li>Blog</li>
<li>Assets</li>
<li><a>Issues</a>
<ol>
<li>List 1</li>
<li>List 2</li>
</ol>
</li>
<li>LAPR</li>
<li>Contact</li>
<li>Links</li>
</ol>
</div>
Pfiew. It took me some time to struggle through your question, but my guess is that you just need to add ../ to all the links if you're in bcf_blog - in order to move up one level in the directory structure.
So:
<a href="index.html">
becomes
<a href="../index.html">

Drupal 6: Trying to print Primary links with children, having a hard time

I am creating a custom Drupal theme for Drupal 6 and have been struggling all day to get the primary links to print with the child objects.
There are hundreds of possible solutions around, but not one of them work. I must be doing something wrong.
Here is what I would like:
<ul>
<li>Item 1</li>
<ul>
<li>Sub of 1</li>
</ul>
<li>Item 2</li>
</ul>
The problem is no matter what I do I am only getting the top level links. I cannot put the primary links in a block, which most solutions require.
Thank you
http://drupal.org/node/68578
hop that will help u

wordpress navigation help

I have a website that consists of the following areas,
Home
About Us
Project Management
Small Works
Testimonials
Contact Us
Current Projects
My issue is that I can display a navigation bar fine, however the Current Projects is not acutally a page, it is more of a category that has a collection of posts, how can I add this to my nav bar, so that when a user clicks to see the current projects, it shows the titles of the posts that are in the current_projects category? Any help would be great.
Just add this and the users will be pointed to /category/current-projects
<?php wp_list_categories('title_li=&depth=1'); ?>
A more in-depth:
<ul>
<?php wp_list_pages('sort_column=menu_order&title_li='); ?> // This will output all pages.
<?php wp_list_categories('title_li=&depth=1'); ?> // This will output all categories.
</ul>
You can exclude categories from showing by adding &exclude=5,6,7 (5,6,7 being the categories ID's that you want to exclude. or &include=3,2,1)
It generates HTML like:
<ul>
<li>Page One</li>
<li>Page Two</li>
<li>Page Three</li>
<li>Page For</li>
<li>Category One</li>
</ul>

Drupal 6x - Primary Links jquery accordion menu

I'm trying to transform my primary link menu block in a jquery accordion menu (link text).
I've tested the Accordion Menu module for Drupal, but it does not function for me.
For my Primary Links Block I would have more or less this html output:
<ul id="accordion">
<li>
Recent Entries
<ul id="recent">
<li><span class="date">01.19.2009</span> Recent Entry Title</li>
<li><span class="date">01.15.2009</span> Recent Entry Title</li>
<li><span class="date">01.13.2009</span> Recent Entry Title</li>
<li><span class="date">01.11.2009</span> Recent Entry Title</li>
<li><span class="date">01.10.2009</span> Recent Entry Title</li>
</ul>
</li>
<li>
Recent Entries
</li>
<li>
Popular Entries
<ul id="popular">
<li><span class="date">08.16.2008</span> Popular Entry Title</li>
<li><span class="date">06.12.2008</span> Popular Entry Title</li>
<li><span class="date">04.12.2008</span> Popular Entry Title</li>
<li><span class="date">06.12.2007</span> Popular Entry Title</li>
<li><span class="date">03.12.2007</span> Popular Entry Title</li>
</ul>
</li>
<li>
Categories
<ul id="categories">
<li>Category Name <span class="count">7</span></li>
<li>Category Name <span class="count">4</span></li>
<li>Category Name <span class="count">15</span></li>
<li>Category Name <span class="count">29</span></li>
<li>Category Name <span class="count">8</span></li>
</ul>
</li>
</ul>
I have some primary links with child:
Territory
Map
Gallery
Products
Wine
Glasses
Contacts
Devel Themer Module says that I must override "theme_menu_item" function but I don't know how to proceed. Can I reach my goal only editing this function in the "template.php" file?
I'm sure that jQuery and jQuery UI are working well beacuse I've tested them with the above code in page.tpl.php.
Any ideas?
Thanks
Bye
EDIT
I've read a lot of docs and drupal forums, but I can't find a similar request. I can simply edit only primary links html without child using this code that add id tag to ul
function basic_menu_tree($tree) {
return '<ul id="accordion" class="menu">'. $tree .'</ul>';
}
The problem comes with child ul, in fact the above function add id="accordion" tag also on child ul with bad effect to jquery script
I want to customize only Primary Link menu block html and I can't believe there are no solutions...
Thanks
UPDATE
I've resolved using above function in template.php file and adding a header class through jquery script to primary link parents to setting jquery ui accordion header options (http://jqueryui.com/demos/accordion/#option-header)!
Bye
Overriding theme functions is the most basic thing done in themes.
Short version is, that if you create a function named [theme_name]_menu_item, that function will be used to generate the html instead of the default one: theme_menu_item. So yes this can be done in your template.php.
Note, the changes will affect all menu items, not just the ones in your primary link menu.
Long version
What's a problem to append jquery accordeon to standard primary menu output? There's everything you need for.

Resources