Please notice that I created this template to be able to hide elements to public AND to Administrator (otherwise he doesn't see the same form as Public when he's logged in).
Do you really mean a Template - or do you mean just Access levels? I agree that Access levels are the correct way to show different elements to Public / Administrators, but I do not see why you would need to create new Fabrik templates for it, and creating bespoke templates will result in a big maintenance overhead as Fabrik's own templates are changed.
Also not sure how you switch templates depending on user?
Take in mind that my form has 2 groups : one for the contact, one for the admin's answer.
When displayed in frontend for public, only the group Contact should be seen (event by administrator)
When displayed in frontend administration pages after log in, both groups can be seen.
Again, I think is a good design. However I don't see the second group in the HTML, so I assume that you have the Group access settings set to avoid showing this to Public and that the Fabrik userid I am using is not an Administrator?
Can you post screen shots of the groups Access settings on the Details tab so I can use these to recreate the issue?
- Designing 2 templates (Public and Admin) was the only thing I found to do that.
As above, not sure this is necessary or a good idea.
- Filtering elements display was the only thing I found as it seems that there is no way to know in PHP the ACL user group.
I am sure that you can get the element or group model and call a method such as CanView or CanUse to decide this - but why do you need to use your own php at all rather than just rely on Fabrik's standard functionality?
2) User Group :
<screen shot>
Viewing Access Level :
<screen shot>
<screen shot>
<screen shot>
The purpose of user groups is to split users into distinct groups based on the functionality they need. Many of these are used by Joomla to control access to content editing, so if you want to give access to parts of your fabrik application without giving access to the CMS you may need to create new user groups (as I do on my site for customers and staff), but since you only want Public or Admin I am really unclear why you needed to create additional User Groups and Viewing Access Levels rather than use the standard ones.
So, if you want to show the Answer group to your Joomla Administrators, then you should be able to use Public for the Contact group and Special for the Answer group.
1) Access tabs : same for
- contacts___Answer
- contacts___AnswerDate
- contacts____Status
<screen shot>
So based on the above, I would set all Access settings for elements in the Answer group to Special.
NOTE: This design (using a single record to hold both initial contact request and reply) implies that you only make one reply to a contact and that you don't want to relate multiple contact/replies from the same person together. (I assume that you have a reason not to just create an email to you from the initial contact request and then use email for the reply.) You will also need to be careful about updating your date fields so that e.g. the Contact date field is not updated when you send the reply etc.
Hope this helps. Please post your Group Access settings and advise what you have done in your bespoke templates so I can recreate.
S