Keyword

How to chage the exta field value url link to mail function for k2 item extra feield?

  • pamidipadudravid
  • pamidipadudravid's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 2 months ago #98241 by pamidipadudravid
hai.. i add the extra feild value  for  link  in k2 item extra feild group , example: in froend end ,it like

 

mail: This email address is being protected from spambots. You need JavaScript enabled to view it.

 when we  click it go for some other info.com , like that

 

 

but i need mail to means link MS Office mail for?

i like output like this :    www.w3schools.com/html/tryit.asp?filename=tryhtml_mailto

 

what i do?

 

 

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

More
13 years 2 months ago #98242 by BBC
Try:

jproven.com/extensions/k2fields

 

It has option "pre-configured validated input fields for alpha, alphanum, number, real, integer, email, url".

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

  • pamidipadudravid
  • pamidipadudravid's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 2 months ago #98243 by pamidipadudravid
Thanks for ur  reply.....

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

More
13 years 2 months ago #98244 by matthew turner
Hi,

if you use the switch case break loop in your template over rides (as posted by Daniel Arnolf here - community.getk2.org/forum/topics/output-extra-fields ) you can assign a PHP variable for each of your extrafields individually by ID, you can use a simple textbox extrafield and a bit of html/PHP  to add anything you want !!

<?php foreach ($this->item->extra_fields as $key=>$extraField):    switch($extraField->id) {        case 1:        $EmailAddress = $extraField->value;        break;        case 2:        $EmailSubject = $extraField->value;        break;                case 3:        $EmailLinkText = $extraField->value;        break;                      }endforeach;?>

All you would need to do after adding the code above (as referenced above), would be to echo the textbox variable inside the html email link :

&lt;a href="mailto:&lt;php echo $EmailAddress; ?>?Subject=Hello%20again">Send Mail</a>

or

&lt;a href="mailto:&lt;php echo $EmailAddress; ?>?Subject=<php echo $EmailSubject; ?>">Send Mail</a>

or even

&lt;a href="mailto:&lt;php echo $EmailAddress; ?>?Subject=<php echo $EmailSubject; ?>"><php echo $EmailLinkText; ?></a>
 

I use this method in my templates.... hope this helps you.

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

  • pamidipadudravid
  • pamidipadudravid's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 2 months ago #98245 by pamidipadudravid
www.andhrawishesh.com/k2/item/76-lakshmi-temple-uk.html?ctyi...

 

In above link i  did what i want Mr.mat.., if i click on email  extra field value, it will  fire the  mail to form...

 

Thanka  a lot..... well done

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

More
13 years 2 months ago #98246 by BBC
Does Joomla after this hide email address form spam spiders ?

Need to test.

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

  • pamidipadudravid
  • pamidipadudravid's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 2 months ago #98247 by pamidipadudravid
i cant get your words clearly.. can u tell me clearly?

plzzzzzzz

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

More
13 years 2 months ago #98248 by BBC
Email address is visible for spammers. Sometimes when Joomla detects "&lt;a href="mailto:" it hides email in js code snippet to hide it.

 

But i cannot ge it to work. Don´t know what wrong i am doing. So Mat, if you can please explain it step by step ?

I don´t want to echo extra field to some special place in Item, but to use extra field already among other extra fields. Just to be clickable.

 

Can´t get it to work both way. Checked other topic too.

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

More
13 years 2 months ago #98249 by BBC
I changed this:

case 1: $EmailAddress = $extraField-&gt;value; 

 

to:

case 11:$Email = $extraField-&gt;value; 


&lt;a href="mailto:&lt;php echo $Email; ?>?Subject=Hello%20again">Send Mail</a> 

 

This is my field ID and field name, but no difference.

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

More
13 years 2 months ago #98250 by matthew turner
Hi

My bad, I just noticed a typo with the code I posted above...sorry

should have been:

&lt;a href="mailto:&lt;?php echo $EmailAddress; ?>?Subject=Hello%20again">Send Mail</a>

 

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


Powered by Kunena Forum