Keyword

Adding "Email Author" Link to Article Header

  • Lee Allison
  • Lee Allison's Avatar Topic Author
  • Offline
  • New Member
More
10 years 10 months ago #121742 by Lee Allison
I've gotten most of this figured out:

1. I need to create a template override
2. I need to be editing item.php
3. I've even figured out the general area I need to put the new link into to get it to appear where I want on the page

What I'm missing is how I call the author's email address. Can someone help with that? Thanks!

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

  • Lee Allison
  • Lee Allison's Avatar Topic Author
  • Offline
  • New Member
More
10 years 10 months ago #121743 by Lee Allison
Replied by Lee Allison on topic Re: Adding "Email Author" Link to Article Header
Got it.
<?php echo JHTML::_('Email.cloak', $this->item->author->email); ?>

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

  • Lee Allison
  • Lee Allison's Avatar Topic Author
  • Offline
  • New Member
More
10 years 10 months ago #121744 by Lee Allison
Replied by Lee Allison on topic Re: Adding "Email Author" Link to Article Header
Can anyone help with adding the article title as a subject line in that email link?? This one is eluding my attempts to solve.

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

  • Lee Allison
  • Lee Allison's Avatar Topic Author
  • Offline
  • New Member
More
10 years 9 months ago #121745 by Lee Allison
Replied by Lee Allison on topic Re: Adding "Email Author" Link to Article Header
Anyone? No answer?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #121746 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Adding "Email Author" Link to Article Header
Your link needs to be like: <a href="mailto:[email protected]?subject=testing out mailto">

So you need somethinf like:
<a href="<?php echo JHTML::_('Email.cloak', $this->item->author->email).'?subject='.K2HelperUtilities::cleanHtml($this->item->title);">

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

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

  • Lee Allison
  • Lee Allison's Avatar Topic Author
  • Offline
  • New Member
More
10 years 9 months ago #121747 by Lee Allison
Replied by Lee Allison on topic Re: Adding "Email Author" Link to Article Header
Thank you Krikor. I understand what you are trying to do, but when I setup the link as you describe it creates the page fine, however the email cloaking is causing issues. When you click on the link it throws a "You do not have permission error" and then dumps the cloaking script.

Try it out by clicking "Email your resume to: Test2" here at: geekjoblist.com/index.php/domains/item/16-test-1

The current code is:
<?php echo "Email your resume to" ?>: <a href="<?php echo JHTML::_('Email.cloak', $this->item->author->email).'?subject='.K2HelperUtilities::cleanHtml($this->item->title); ?>">Test2</a>

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #121748 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Adding "Email Author" Link to Article Header
You need to see how the cloaking plugin works. I think the link and the subject should be passed as variables to that function.

docs.joomla.org/How_to_cloak_email_addresses

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