Changing page layout/functions/links for some users Options
Ig_p118
Posted: Tuesday, July 25, 2006 10:47:45 PM
Rank: Fanatic

Joined: 7/21/2006
Posts: 255
Location: Salerno - Italy
How Can I change dynamically page/template or insert links or function for some registered users or groups???? That is: I'm login as user A then he see only functions and pages for A or A groups, B for B and so...

Thanks

Red Consulting s.a.s - Umbraco from v1.0
Ronnie
Posted: Wednesday, July 26, 2006 8:09:42 AM
Rank: Devotee

Joined: 7/19/2006
Posts: 31
you could create different stylesheets, example: group1.css, group2.css.

Then I would create a xslt macro that create the link to the css files.


<xsl:if test="your.library:isMemberOfAGroup("group1",umbraco.library:GetCurrentMember()/@id)">
<link rel='stylesheet' type='text/css'href='/css/group1.css' />
</xsl:if>

so you can make a library with this c# code:

public static bool isMemberOfAGroup(string groupName, int memberId)
{
Member m = new Member(memberId);
System.Collections.IDictionaryEnumerator en = m.Groups.GetEnumerator();

while (en.MoveNext())
{
if(groupName == ((umbraco.cms.businesslogic.member.MemberGroup)en.Value).Text)return true;
}
return false;
}



.NET/Umbraco developer @ ebita ApS
Ronnie
Posted: Wednesday, July 26, 2006 8:11:49 AM
Rank: Devotee

Joined: 7/19/2006
Posts: 31
hmm deleted my xslt example, but ist something like this

if test="your.library:isMemberOfAGroup("group1",umbraco.library:GetCurrentMember()/@id)">
<link rel='stylesheet' type='text/css'href='/css/group1.css' />
/if


.NET/Umbraco developer @ ebita ApS
Ig_p118
Posted: Wednesday, July 26, 2006 4:25:13 PM
Rank: Fanatic

Joined: 7/21/2006
Posts: 255
Location: Salerno - Italy


Could you explain more precise ?

Thanks

Red Consulting s.a.s - Umbraco from v1.0
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.