Skip to content

Instantly share code, notes, and snippets.

@joeworkman
Last active February 5, 2019 20:52
Show Gist options
  • Save joeworkman/0d9592203f9b466a03a07bd606716789 to your computer and use it in GitHub Desktop.
Save joeworkman/0d9592203f9b466a03a07bd606716789 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
//-----------------------------------------------
if ($publish) {
$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>
@dnibbeling
Copy link

dnibbeling commented Dec 4, 2018

Joe is it possible to set tags and categories as filter within this code? I like to separate the different categories within a list.

@joeworkman
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment