Hi,
I keep coming up with half of the solution and decided to drop in here to see if someone could help me out.
What I have set up is a blog in which only one field group exists. That field group is a matrix that is used to display audio tracks. I use the title of each entry of this blog to be the header of my list of tracks for that entry. This works fine when I want to show everything without any constraints.
However, if I add a checkbox to my matrix and want to display only tracks that have been checked off I run into problems. It displays only those tracks just fine, but as you can see from my code below, I’m also returning every single entry {title} in the blog since it sits outside of the matrix.
{exp:weblog:entries weblog="{my_weblog}" sort="desc" orderby="date" limit="10" }
<div>
<h3>{title}</h3>
<p> {matrix}<br />
{if checkbox}<br />
<a href="http://{url}">{name}{if artist}{artist}{/if}, {time}</a><br />
{/if}<br />
{/matrix}<br />
</div> <br />
{/exp:weblog:entries}I’m aiming for results like this:
Album 1
Track 01
Track 04
Track 07
Album 3
Track 05
But, instead I’m getting results like this:
Album 1
Track 01
Track 04
Track 07
Album 2
Album 3
Track 05
Album 4
Album 5
Album 6
...
I can’t move the {title} inside the {matrix} tags, because then it will be repeated above every single track. Is there something I’m not thinking of? Or, is there a better way to do this? I’m all ears.
And preferably, I’d like to use FF Select instead of FF Checkbox to determine which tracks will be displayed so I don’t have a bunch of checkboxes on every entry form. But I was having trouble as far as the markup is concerned for FF Select. Maybe that’s another topic to create…