Forum .LRN Q&A: Re: user/community portal

Collapse
2: Re: user/community portal (response to 1)
Posted by Nagita Karunaratne on
The best I can come up with is to get the community_id and then check if it is false. Seem clunky.

set community_id [dotlrn_community::get_community_id]

<if @community_id@ false>
  This is a User.
</if>
<else>
  This is a community (class/club/subcomm).
</else>

Anything better ...?

Thanks.

Collapse
3: Re: user/community portal (response to 2)
Posted by Jose Pablo Escobedo Del Cid on
Hi Nagita,

The proc dotlrn_community::get_community_id returns null if you are not inside a community. I gess you can use it, but why do you need to know this?, because if you are working with portlets you can use the cf variable and get the "list of package ids", as you can see it in the faq-portlet for example.

Regards, Jose

Collapse
4: Re: user/community portal (response to 3)
Posted by Nagita Karunaratne on
Hi Jose,

The 'cf' variable returns a list of packages (from the communities the user is a member of) plus '0' if the portlet is in a 'user' portal. Otherwise it lists the package_ids of the community (and subcommunities)

So I guess one can see if '0' is in the list of package_id and that would be a user portal. Seems strange that there is no function for a portlet to determine if it in a user or community portal.