Displaying a column based on user logged in.

chriso0258 22 Apr, 2014
Hello,

What I would like to do is display a column depending on who is logged in. For example, if user A is logged in I want to show the delete column. If user B is logged in I don't want to display the delete column. I currently have it set up so that if user B is logged in and they press to delete a record it shows access denied. I can live with that option if needed but it would be better not to display the column.

I saw in there is a php functions block in the front list settings but not sure if this is applicable or if so, how to configure.

Thanks for your help.
Max_admin 18 May, 2014
Answer
Hi Chris,

A bit late, sorry!🙂

The "Columns list" box supports PHP, so you can get the logged in user's id/name/username and compare it using an "if" statement and based on that echo the column's field name, make sure that the whole code returns just 1 new line, so that it works well with other fields!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.