Hello
I am starting to play with the dlm file to create the layouts and layout-owners for putting up content.
I'm a little confused about the capabilities/workings of the dlm file and was wondering if anyone can advise me. I'm getting little response from SCT Support.
Say if I have 3 roles in my system that a user could have in any of the 7 combinations:
1 role1
2 role2
3 role3
4 role1 and role2
5 role1 and role3
6 role2 and role3
7 role1, role2 and role3
but I want a user to have one of only two layouts based on the following combinations of roles they may have:
1 role1
4 role1 and role2
(I would like both layouts to have a home page but a user to only see one homepage- ie get only one layout)
do I have to code up just 2 layout-fragments in dlm.xml for:
role1
role1 and role2
or many more for:
role1 and not role2
role1 and not role2 and not role3
role1 and not role2 and role3
role1 and role2 and role3
role1 and role2 but not role3
ie do you explicitly have to include all role combinations in your dlm:audience logic?
if so this would become quite complicated very quickly as roles increase. I have a feeling I maybe over complicating things but am finding the documentation a bit parse and getting odd behaviour when i try and experiment with the dlm file.
Thanks for any advice!
conditional dlm
See if this example can be of any help:
This one uses a layout(layoutx) for users having "role1" OR "role2". You do not have to use conditions like "role1" but not "role3" etc. You may also use "AND" instead of "OR" as the situation demands:
http://www.nd.edu/~vahmed/dlm.txt
thanks for the reply
so I presume that with that fragment you provided, a user with role1 and role3 would see the same layout as a user with role1 and role4?
although with your example would not a user with only role1 see the same as a user with role1 and role2? I would like a user with role1 (and not role2 ) to see a different layout than a user with role1 AND role2, irrespective of any other roles they might have.
cheers again!
updated
I have updated the link with a complex example that should address the "role1 and NOT role2" criterion. Just replace the "yearLevel" and "courses" attributes with "roles". As you may be aware, the paren operator is to be read bottom-up and not top-down.
wonderful
cheers for that..much appreciated. nope wasn't aware of that or the contains mode either!
same question
I'm a little late on this one as I've found the link to the example provided by Vikram is no longer valid.
If you see this one Vikram, could you help me out and supply the sample again? Or, if anyone else has the solution Vikram suggested could you provide it.
Thanks