Groups Sidebar Question

Ceri
Ceri
@adolygwr
6 years ago
370 posts
Is there a way to customise the right hand sidebar on a group by group basis? If so how would I go about it?


--
Ceri Shaw - AmeriCymru

updated by @adolygwr: 05/17/18 10:11:27AM
brian
@brian
6 years ago
10,148 posts
Like most everything in Jamroom what you "see" is controlled by templates, so yes - you would need to customize the templates in modules/jrGroup/templates to suit your needs.

https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/1051/altering-a-modules-template


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
paul
@paul
6 years ago
4,326 posts
Something like this in the template?
{if $item.group_name == 'xxx'}
  // Sidebar code for xxx here
{elseif $item.group_name == 'yyy'}
  // Sidebar code for yyy here
{elseif $item.group_name == 'zzz'}
  // Sidebar code for zzz here
{/if}



--
Paul Asher - JR Developer and System Import Specialist
Ceri
Ceri
@adolygwr
6 years ago
370 posts
Many thanks but which template?


--
Ceri Shaw - AmeriCymru
brian
@brian
6 years ago
10,148 posts
Should be item_detail.tpl


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Ceri
Ceri
@adolygwr
6 years ago
370 posts
A further question.....I have been playing with this on my devserver and I am obviously doing something wrong. I have already customised item detail tpl a while ago but in such a way that a list of other groups appears in the sidebar below the 'Group Pages' box. What I would like to do is give one group a unique sidebar.

My question is where would the if else loop go in the template and how would I limit the customisation to one group only. Can I use a wildcard in the code supplied above?


--
Ceri Shaw - AmeriCymru
michael
@michael
6 years ago
7,715 posts
You can have pretty much anything you want, just need to figure out what you want, then request it.

The main function for requesting stuff from a .tpl file is {jrCore_list}

Docs: "{jrCore_list}"
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/89/jrcore-list

So first you would figure out where you want it to come out by putting:
WHERE DOES THIS COME OUT???????
into various templates until you figure out which template is the one you want. Then move it around that template until you get it into the location you want it.

Once you know the point, then you can use {jrCore_list} to get a list of whatever you want. Either by using a static number or by using one of the variables available to you in the template.
Ceri
Ceri
@adolygwr
6 years ago
370 posts
Done the 'WHERE DOES THIS COME OUT' thing already. Here is the group that I want to customise:- https://americymru.net/ceri-shaw/group/48/grwp-y-gymraeg

As you can see there is a 'More Groups' section in the right hand column. I added the code for this to item_detail.tpl a while back and it appears on all group pages on the site. What I want to do is have a custom sidebar for this group alone.

I understand that this can be achieved with an if/else statement in the item_detail.tpl (as per Paul's post in this thread) BUT despite having spent a while trying to work out where to place this on my devserver I can't seem too make it work. Also since I want all other groups on the site to have the existing sidebar configuration (for now) I am wondering if I can use a wildcard in an if/else statement to exclude other groups from the customisation.


--
Ceri Shaw - AmeriCymru
Ceri
Ceri
@adolygwr
6 years ago
370 posts
Additionally I should add that I want to keep the members and group pages features on the Grwp Y Gymraeg sidebar. I just want to be able to get rid of the 'More Groups' section in that group and replace it with something (various things) specific to the group.


--
Ceri Shaw - AmeriCymru