You may only need to have one of your developers take a look and update the code snippet. :-)
Cheers
Kristina
]]>
Thanks,
]]>
I will implement that instead. Much appreciated.
Sorry, we don't have an "is_student()" function. We've actually never had a use for it in Mahara core, because admins & staff can do everything students can do.
So, you'll just need to check that the user isn't staff or admin:
{if !($USER->get('admin') || $USER->get('staff') || $USER->is_institutional_admin() || $USER->is_institutional_staff())}
<!-- block of HTML for students -->
{else}
<!-- block for everyone else -->
{/if}
Cheers,
Aaron
]]>In fact, I have since discovered a further challenge:
{if $USER->is_institutional_staff()}
<!---Block of html for teachers--->
{else}
<!---Block of html for everyone else--->
{/if}
works really well as it displays teacher content for teachers and then changes it for others. However, as we've some some users who aren't institutional staff I'm actually looking to change the code so it will display specific content to students instead.
It is turning the code on its head really.
However, is this a valid command or is there anything similar that anyone is familiar with?
if $USER->is_student()
Could be used for:
{if $USER->is_student()}
<!---Block of html for students--->
{else}
<!---Block of html for everyone else--->
{/if}
Great that you got it to work. Do you have a write-up of your idea to share with others in case someone is interested in your solution to achieve something similar?
Cheers
Kristina
]]>
]]>
Another possibility (but only in later versions of Mahara) is the following which wouldn't require coding: If you have not hooked up your Mahara to a Moodle site, you could put all your teachers into one institution and all your students into another. And then you can set different messages for them on the homepage. See http://manual.mahara.org/en/15.04/administration/institutions.html#institution-static-pages for more information.
The added benefit is that you could also give your teachers a different theme than what the students get and give them different permissions in terms of public pages, seeing online users etc.
Cheers
Kristina
]]>
Cheers,
Aaron
]]>Is it possible to display a dynamic message according to the logged in user profile?
I'm currently using Mahara 1.7 and I believe it is possible to use something like:
{if $USER->is_institutional_staff()}
<!---Block of html for teachers--->
{else}
<!---Block of html for everyone else--->
{/if}
However, I've tried adding this to the 'show homepage information' text from the admin area and it is just displayed as text. Is there something I'm missing?
Thanks for any assistance you can provide.
]]>