HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Welcome Block

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#80082 (In Topic #16264)
Avatar

Honoured member

Hi again,

I am trying to edit the welcome block so that certain content is visible to different usegroups.

EG: The message "Why dont you register?" would be visible to guests, but not members.

On a similar topic…i only want certain usergroups to have the ability to add blog content. I have followed the tutorial that says "Have personal categories" and edited the permissions so that only a couple of usegroups can create a blog, but i want to be able to edit the links so that they appear different for those capable of submitting.

For example; In the 'features' block there is the link "Blog". For those capable of submitting a blog this works fine, but the link is still visible to those who cannot. When they click the link they get an error message. is there any way of making that link only visible to those who can submit a blog?
Back to the top
 
Posted
Rating:
#80094
Avatar

Community saint

Ollie8557 said

I am trying to edit the welcome block so that certain content is visible to different usegroups.

EG: The message "Why dont you register?" would be visible to guests, but not members.
Use if_in_group to differentiate between the types of users, always remembering that ocPortal ID's the Guest or Visitor group as '1', e.g.

Code

[semihtml]
 [if_in_group="1"]{+START,BOX,Visitors,100%,curved}<br />
[block]main_greeting[/block]
 {+END}[/if_in_group]
 [if_in_group="2,3,4,5,6,7,8,9,10,11,12,13"]{+START,BOX,Members,100%,curved}[block]main_greeting[/block]
 {+END}[/if_in_group]
[/semihtml]

This will get you something like this …

Greeting for members
Greeting for Visitors/Guests







I'll leave the second part of your question to somebody more clued-up in that area.

 :thumbs:

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#80097
Avatar

Community saint

What I was forced to do for the menu link was create a new menu block so that I could apply the if_in_group test to determine whether or not to display the block.

Code

[if_in_group=2-6][block param=&quot;collab_features&quot; caption=&quot;Contributing editors&quot; type=&quot;tree&quot; tray_status=&quot;tray_open&quot; silent_failure=&quot;0&quot;]side_stored_menu[/block][/if_in_group]

Bob
Back to the top
 
Posted
Rating:
#80098
Avatar

Community saint

I have on my front page a set of menus for "guests" and a set for "logged in". I created a "fake" menu with the same menu items as the "real" one and pointed those "fake" links to the sign in page. I then used the [if_in_group= ][/if_in_group] tags to switch between the menus depending on who is on the page. You could point your "fake menu" links to any page you want.  :thumbs:

On a side note…
To hide the individual menu link, enter into the menu editor, select the menu item and look for the check/tick box that's labeled "Only display link if there is permission" and tick it.

I believe the groups that have permissions to view the blog will also have permission to see the link.


Last edit: by sholzy

Steve
Back to the top
 
Posted
Rating:
#80101
Avatar

Honoured member

Thanks for the responses…i will have a play with the different options this evening.

Ollie
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: