Creating an automatic link to contact form (saving item form is not needed)

  • Published by
    George Papadakis
  • Last modified
    20 March 2014
  • Up to date
    Yes
  • Profile concerned
    End user, Webdesigner, Developer
  • Concerns
    Component Plugins
  • Since Version
    1.5.6
  • Voting
    Average rating
    4 votes
    • 1
    • 2
    • 3
    • 4
    • 5
  • Favourites
    246 Creating an automatic link to contact form (saving item form is not needed) /documentation/tutorials-english/71-fields-usages-tips-joomla-plugin/246-creating-an-automatic-link-to-contact-form.html
  • Tags
    weblink

It is possible to create a link to the Joomla contact form for sending email to the author of the article.

1. Create a new FLEXIcontent field of type "Select" and at the top right select the desired FLEXIcontent Types

2. In parameter "Prefix Text" enter:

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


3. In parameter "Suffix Text" enter:

" alt="Contact">Contact this author</a>


4. Enable parameters: "Remove Space" ,  "Use Sql Query" and disable parameter "Use first option"

5. In parameter "Field Elements" enter:

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


6. Add the field to item/category layout of the template you use

7. Edit and resave every item so that new field gets a value
NOTE 1: for this to work you will need to create on Joomla contact for every author and don't forget to select the correct user for every Joomla contact form NOTE 2: After you create the field, go to item edit form and check that it works properly. This field must appear as a single entry in a select box. The single entry will be the title of the user's contact form. After you save the first item, goto frontend and check that it works by clicking at the created link (author's contact form should open). If it fails, double check the above steps and check that you have created a Joomla contact for the author.