solved How to Create a Genre block

gary.moncrieff
gary.moncrieff
@garymoncrieff
11 years ago
865 posts
Hey Guys

Anyone got an example of a block that outputs Genres into a clickable list?

I am looking to include a list of all Genres in the side of the music section of Media Pro skin.

Thanks
updated by @garymoncrieff: 11/07/14 06:27:50PM
michael
@michael
11 years ago
7,805 posts
you'll want to use jrCore_list and the group_by parameter.

"{jrCore_list}"
http://www.jamroom.net/the-jamroom-network/documentation/development/89/jrcore-list#group-by

Group by the audio_genre so that only 1 of each genre comes out.

Then in your template make a foreach loop and point the link to where you want to point it.

At a guess:
{jrCore_list module="jrAudio" group_by="audio_genre" template="audio_menu.tpl"}

Then in audio_menu.tpl
{if isset($_items) && is_array($_items)}
 {foreach $_items as $item}
  {* the link goes here *}
  <a href="{$jamroom_url}/wherever/{$item.audio_genre}"
 {/foreach}
{/if}
gary.moncrieff
gary.moncrieff
@garymoncrieff
11 years ago
865 posts
Thanks it outputs the genres correctly but the url is wrong, will have to dig more, the genre dropdown box is passing a search parameter to achieve this.
douglas
@douglas
11 years ago
2,806 posts
Try this for the link...

<a href="{$jamroom_url}/music/search_area=audio_genre/search_string={$item.audio_genre">{$item.audio_genre}</a>

Hope this helps! :)


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
gary.moncrieff
gary.moncrieff
@garymoncrieff
11 years ago
865 posts
Thanks that works
douglas
@douglas
11 years ago
2,806 posts
Your welcome! :)


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

Tags