Skip to content

Instantly share code, notes, and snippets.

@joeworkman
Created November 16, 2018 16:33
Show Gist options
  • Save joeworkman/e11dcea2bfd556c452649ff473989207 to your computer and use it in GitHub Desktop.
Save joeworkman/e11dcea2bfd556c452649ff473989207 to your computer and use it in GitHub Desktop.
This will create menu items for all blog posts inside Total CMS. You can place this snippet inside of any Foundation menu stack that supports custom HTML menus.
<li class='has-dropdown'><a href='#'>Blog</a><ul class='dropdown'>
<?php
$cmsid = "blog";
//-----------------------------------------------
// Do not modify below this line
//-----------------------------------------------
$totalblog = new \TotalCMS\Component\Blog($cmsid);
$posts = $totalblog->filter_posts();
foreach ($posts as $post) {
echo "<li><a href='$totalblog->posturl$post->permalink'>$post->title</a></li>";
}
?>
</ul></li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment