Keyword

ACL for specific extra fields

  • jfbeaulieu
  • jfbeaulieu's Avatar Topic Author
  • Offline
  • New Member
More
9 years 5 months ago #143010 by jfbeaulieu
ACL for specific extra fields was created by jfbeaulieu
Hi,

I would like to be able to show some specific extrafield for Registered user or other group of user.

I have templated the item page with my current extrafield in item.php. You can see an exemple page here : psychofiches.com/fiches/53440-403

I would like to show the last section named as "Complément d'information" only to Registered user instead of all user. In K2 setting, we can only set ACL to item categories but I would like to set ACL to specific Extra Fields. Is that possible ?

This is a cut of my item.php file. In BOLD is the section I would like to set the ACL to the Registered user only. There is a PHP code I can put there if there's no plugin that do what I want ?
<td><span class="titleextrafields">Milieux:</span> <?php echo $extrafields[11];?><br></td>
	</tr>
	<tr>
	<td><span class="titleextrafields">Niveau de donnée probante:</span> <?php echo $extrafields[12];?><br></td>
	</tr>
	<tr>
	<td><span class="titleextrafields">Approche théorique:</span> <?php echo $extrafields[13];?><br></td>
	</tr>
	</table>
	<br>

------------ section to be shown only for Registered users -----------------------------------------------------------
	
<p align="center" class="compinfo">Complément d'information</p>
	<p><span class="titleextrafields">Références: </span><?php echo $extrafields[14];?></p>
    <p><span class="titleextrafields">Informations complémentaires: </span><br><?php echo $extrafields[15];?></p>
  
------------------------------------------------------------------------------------------------------------------------------  
    
</div>
<div class="separation"></div>

Thank you very much !

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 5 months ago #143014 by Krikor Boghossian
Replied by Krikor Boghossian on topic ACL for specific extra fields
You can use Joomla!'s user object docs.joomla.org/Accessing_the_current_user_object

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum