solved Tag Cloud - Module specific

gary.moncrieff
gary.moncrieff
@garymoncrieff
9 years ago
865 posts
Hey All

Is there a way to filter the tag cloud to show only tags from the relevant module. ie In the Events section of my sites frontend only show Event related tags, Music section, music related tags etc.

Having difficulty discovering all the wee tricks for searching and ordering in smarty.

I tried this to no avail

{jrTags_cloud module="jrEvent" height="300" assign="tag_cloud"}

Thanks
updated by @garymoncrieff: 05/18/15 02:25:52PM
douglas
@douglas
9 years ago
2,790 posts
You've assigned the output to the tag_cloud variable, the only reason you want to do that is to see if it is set.

{jrTags_cloud module="jrEvent" height="300" assign="tag_cloud"}
{if isset($tag_cloud) && strlen($tag_cloud) > 0}
 {$tag_cloud}
{else}
  something else
{/if}

Otherwise you can just use this:

{jrTags_cloud module="jrEvent" height="300"}



--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
gary.moncrieff
gary.moncrieff
@garymoncrieff
9 years ago
865 posts
Hey

I have tried numerous ways included what you suggested and it still shows all tags, the reason I know this is I am trying it in events and I know there are no tags on any test events yet, so no tags should show in the tag cloud.
brian
@brian
9 years ago
10,148 posts
the jrTags_cloud function lets you use searches just like in jrCore_list - i.e.

{jrTags_cloud search="tag_module = jrAudio" height=300}

Or with multiple modules:

{jrTags_cloud search="tag_module in jrVideo,jrAudio,jrSoundCloud" height=300}

Let me know if that helps.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
gary.moncrieff
gary.moncrieff
@garymoncrieff
9 years ago
865 posts
Thank you, so if I am understanding this correctly I can search for any datastore item in a similar fashion? I seen the module name was stored in tag_module in the tags datastore but couldn't see it as available in debug to use.
gary.moncrieff
gary.moncrieff
@garymoncrieff
9 years ago
865 posts
Ok for now the for the next level.

{jrTags_cloud search="tag_module in jrProfile" height=300}

Is it possible to search for tags on a specific quotas profile?
michael
@michael
9 years ago
7,714 posts
perhaps:
{jrTags_cloud search="profile_quota_id in 1,2,3" height=300}

to search for any tags whos profile_quota_id is either 1 or 2 or 3, but im not sure if thats what your after or not.
gary.moncrieff
gary.moncrieff
@garymoncrieff
9 years ago
865 posts
Thanks Michael

The solution came to me on my way to work but had to sort out server after installing an update to a Wordpress site it took it down.

For the purposes of others, what I wanted to do was to show all profile tags for specific quotas.

So was able to achieve this using

{jrTags_cloud search="tag_module in jrProfile" search1="profile_quota_id = 8" height=300}

Amazing how much you forget after being away for a few months.
michael
@michael
9 years ago
7,714 posts
:) nice one.

Since you only have 1 item for the IN, that could be an = too.
{jrTags_cloud search="tag_module = jrProfile" search1="profile_quota_id = 8" height=300}
alt=
@andrusito
9 years ago
302 posts
Hello,

One question: how can I show all audio_genre values on my index? I want to have some kind of list (or tag cloud) with all audio genres.

Is that possible?

THanks!
gary.moncrieff
gary.moncrieff
@garymoncrieff
9 years ago
865 posts
Yes for a list have something like this in your index.tpl file

{jrCore_list module="jrAudio" group_by="audio_genre" template="audio_genres.tpl"}

and then the audio_genres.tpl would look something like this

{if isset($_items)}
    {jrCore_module_url module="jrAudio" assign="murl"}
    <ul>
    {foreach from=$_items item="item"}
          <li>{$item.audio_genre}</li>
    {/foreach}
    </ul>
{/if}

updated by @garymoncrieff: 04/15/15 10:33:44AM
alt=
@andrusito
9 years ago
302 posts
Yeah, that worked! Thanks.

Now, I'd like to have a link for each genre, so users can filter audio by genres.

I think it's possible :)
gary.moncrieff
gary.moncrieff
@garymoncrieff
9 years ago
865 posts
Yes it is but it's very much skin specific as to how you go about this. I have done it with MediaPro as Douglas had set up search areas in the templates, but bear in mind this also means that the module search doesn't work. Better to start a new thread and get a more polished opinion on how to do this other than mine.

Tags