How to create a field that links to contact page of current item author (requires saving item form)

  • Published by
    George Papadakis
  • Last modified
    28 December 2013
  • Up to date
    Yes
  • Profile concerned
    End user, Webdesigner
  • Concerns
    Plugins
  • Since Version
    1.5.6
  • Voting
    Average rating
    1 vote
    • 1
    • 2
    • 3
    • 4
    • 5
  • Favourites
    302 How to create a field that links to contact page of current item author (requires saving item form) /documentation/tutorials-english/71-fields-usages-tips-joomla-plugin/302-how-to-create-a-field-that-links-to-contact-page-of-current-item-author.html

You can create a field of type "select" that when displayed in frontend, it automatically links to the contact page (or community builder user details page).

1. Create a select field

2. enable Use SQL Query

3. as Field elements enter

1
SELECT id AS value, name AS text FROM # __contact_details WHERE user_id="{item->created_by}"

NOTE above remove space from # __

4. enable Remove space

5. as Frontend Display
select "value" instead of "text"

6. as value prefix enter:

1
<a href="index.php?option=com_contact&view=contact&id=

7. as value suffix enter:

1
" alt="Contact">Contact this author

8. Disable Use first option