I ammended it below, but it doesn't work. Does anyone have any ideas? The table name is Sarasota_Users_1 and the filed is Role. Different types of roles listed are : Finance, Cost Center, Admin. Thanks for any help you can provide as I am trying to add this to the header. (Also, does anyone know if you could take the script below and make it an App?)
<div id='navMenuConditional'></div>
<script type="text/javascript">
document.addEventListener('DataPageReady', function (event) {
if ('[@authfield:Sarasota_Users_1_Role]' == 'Finance') {
document.querySelector('#navMenuConditional').innerHTML = '[@app:FiscalNavigation2022]'
} else if ('[@authfield:Sarasota_Users_1_Role]' == 'Cost Center') {
document.querySelector('#navMenuConditional').innerHTML = '[@app:CostCenterNavigation2022]'
}
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
PDSRQ
I found this in the community forum: https://forums.caspio.com/topic/16540-navigation-menu-that-varies-by-user-or-user-role/#comment-44997
I ammended it below, but it doesn't work. Does anyone have any ideas? The table name is Sarasota_Users_1 and the filed is Role. Different types of roles listed are : Finance, Cost Center, Admin. Thanks for any help you can provide as I am trying to add this to the header. (Also, does anyone know if you could take the script below and make it an App?)
<div id='navMenuConditional'></div>
<script type="text/javascript">
document.addEventListener('DataPageReady', function (event) {
if ('[@authfield:Sarasota_Users_1_Role]' == 'Finance') {
document.querySelector('#navMenuConditional').innerHTML = '[@app:FiscalNavigation2022]'
} else if ('[@authfield:Sarasota_Users_1_Role]' == 'Cost Center') {
document.querySelector('#navMenuConditional').innerHTML = '[@app:CostCenterNavigation2022]'
}
});
</script>
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.