Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Blog Categories Filter


Go to End


4 Posts   3199 Views

Avatar
purtle

Community Member, 11 Posts

24 September 2015 at 12:34pm

Hi there,

I've installed Silverstripe CMS 3.1.15 along with the blog module. Out of the box this works well, however one thing I can not figure out how to extend is adding a filterable nav list of blog categories, exactly like the Silverstripe Blog has (http://www.silverstripe.org/blog/) - All / Software ... etc. Any advice would be appreciated!

Many thanks,
Grant

Avatar
helenclarko

Community Member, 166 Posts

24 September 2015 at 2:32pm

Hi Purtle,

I could be wrong, but I believe this is done with <% loop Menu(2) %>, The same way you would with a sidebar navigation.

Simply the following should do the trick:

<% if Menu(2) %>
	<ul>
		<li>
			<a href="/blog/category/all" class="Something">All</a>
		</li>
		<% loop Menu(2) %>
			<li>
				<a href="$Link" class="$LinkingMode">$MenuTitle</a>
			</li>
		<% end_loop %>
	</ul>
<% end_if %>

Avatar
purtle

Community Member, 11 Posts

24 September 2015 at 4:13pm

Hi helenclarko,

Thanks for you response. I originally tried the same method thinking that should simply work too, but with no success.

After reading up on the blog module I realised it supported category and tag widgets, but that has required some extra stuff installed to get this working. After installing the widgets extension and upgrading to 3.2, the admin still seems to fail at displaying a Widgets Tab. I had hoped this would solve my problem, but am grateful for any more ideas?

Grant

Avatar
helenclarko

Community Member, 166 Posts

24 September 2015 at 4:35pm

Edited: 24/09/2015 4:36pm

Hi Purtle,

On my 3.1.6 site I have a sidebar which works on Menu(2), It works from the blog also.

My set up is the following:

BlogTree
--BlogHolder
----BlogEntry

But I can have the following

BlogTree
--BlogHolder (as Category 1)
----BlogEntry (as 1st blog post)
----BlogEntry (as 2nd blog post)
----BlogEntry (as 3rd blog post)
--BlogHolder (as Category 2)
----BlogEntry (as 1st blog post)
----BlogEntry (as 2nd blog post)
--BlogHolder (as Category 3)
----BlogEntry (as 1st blog post)
----BlogEntry (as 2nd blog post)
----BlogEntry (as 3rd blog post)
--BlogHolder (as Category 4)
----BlogEntry (as 1st blog post)

Then when you go to the blogtree page, the nav will show up at the top and Menu(2) will point to the blog holders. You will then simply need to add a link for "ALL" which points to BlogTree.

-helenclarko