Keyword

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

More
13 years 2 months ago #98251 by BBC
I get nothing at the frontend. I must be dumb.

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

More
13 years 2 months ago #98252 by BBC
It works now. If you call it only in Item text area.

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

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

The code would need adding per template (category_item.php, latest_item.php etc) and can be used in the K2 content module template over rides as well....

On the Joomla protecting the email address from spammers, I'm looking into that, I think it may be Joomla only protecting the email address inside of main content area(or intro text)....

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

More
13 years 2 months ago #98254 by BBC
I am testing it in item.php.

 

I need some option to turn ordinary Text Field into clickable email address, if it detects "@" in field.

Some simple solution. There are 5-6 files in admin/components/com_k2 that needs to be changed. But it is to much core changing for such small benefit.

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

More
13 years 2 months ago #98255 by BBC
You can try tweak code from user.php:

<?php echo JHTML::_('Email.cloak', $this->user->email); ?> 

 

Email.cloak hides email addresses.

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

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

The above works nicely !

Just out of curiosity I tested the Extrafields plugin code that I posted for Jock (for the Gallery plugin) and that did the same wrap in javascript routine:

 

<?php echo JHTML::_('content.prepare', $EmailAddress ); ?>

 

Which again wraps it in Javascript - Joomla built in ?

Not sure at this moment how to add in/change the subject line...

Working on that next

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

More
13 years 2 months ago #98257 by BBC
This with extra fields will kill K2. People run away to SobiPro, Flexicontent and Jsblod.

 

Didn´t tried in deep last two, but Sobi is not near K2. And it would be shame to lose users just because of extra fields.

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

More
13 years 2 months ago #98258 by BBC
I woudn´t mind to pay yearly subscription just to have some pro documentation.

Some code snippets you can use in templates, some core (code) tweaks, etc...

 

I am aware that developers are not so eager to put new options, etc... K2 could slow down. But some central place where you can read documentation would be OK.

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

More
13 years 2 months ago #98259 by BBC
How your code for mail looks now ?

I don´t need it now, but paste it here for some future use.

 

All i got with my code was javascript code in address field, in mail client.

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

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

Got it sorted in the last couple of minutes....Using the code you posted, with a bit of string replacement...  ;)

 

<?php

$myhiddenemail = JHTML::_('Email.cloak', $EmailAddress); $JscriptSubject = "var suffix = ''";$EmailSubject   = "var suffix = '?Subject=Hello%20again'";$myNEWhiddenemail = str_replace($JscriptSubject, $EmailSubject, $myhiddenemail);

?>

<?php echo JHTML::_('content.prepare', $myNEWhiddenemail ); ?>

 

This could be further modified if you echo another extrafield variable in place of the Hello%20again bit

I think this is part of how Joomla is coded, plugins, replacements etc to just work in the main content area...

K2 presents ways around nearly all of my issues of the standard Joomla.

Not sure how I got anything done before I started using K2 as I have found this forum and community to be a fantastic resource of information (including some from your posts BBC !) and similar minded people - I have learned so much about PHP,JSON,MySql etc from this forum and related searches to achieve my clients needs....

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


Powered by Kunena Forum