- Posts: 92
COMMUNITY FORUM
Adding HTML code into Extra Fields
- Red Evolution
-
Topic Author
- Offline
- Premium Member
Is it possible to allow HTML code to be added into extra fields. Currently this is 'zapped' when you save. I'd like to add RomanCart shopping cart code (HTML and Javascript) into extra fields.
cheers
d
Please Log in or Create an account to join the conversation.
- ronildo
-
- Offline
- New Member
- Posts: 8
Here is a link: k2community.joomlaworks.gr/forum/topics/extra-wysiwyg-fields?x=1&id=3536014%3ATopic%3A1366&page=2#comments
I did that and it worked quit nice to me.
Please Log in or Create an account to join the conversation.
- Red Evolution
-
Topic Author
- Offline
- Premium Member
- Posts: 92
d
Please Log in or Create an account to join the conversation.
- ronildo
-
- Offline
- New Member
- Posts: 8
2/ Edit the administrator/components/com_k2/models/item.php file
Line 462 :
Replace :
$variables = JRequest::get('post');
By :
$variables = JRequest::get('post',JREQUEST_ALLOWRAW);
Try it.
Please Log in or Create an account to join the conversation.
- Red Evolution
-
Topic Author
- Offline
- Premium Member
- Posts: 92
d
Ronildo Costa said:Then just do second part: 2/ Edit the administrator/components/com_k2/models/item.php file
Line 462 :
Replace :
$variables = JRequest::get('post');
By :
$variables = JRequest::get('post',JREQUEST_ALLOWRAW);
Try it.
Please Log in or Create an account to join the conversation.
- ronildo
-
- Offline
- New Member
- Posts: 8
Please Log in or Create an account to join the conversation.
- Red Evolution
-
Topic Author
- Offline
- Premium Member
- Posts: 92
d
Ronildo Costa said:Let's wait the new version... it supposed to be available this week.
Please Log in or Create an account to join the conversation.
- Red Evolution
-
Topic Author
- Offline
- Premium Member
- Posts: 92
d
Dave Robinson said:Good plan! ;) Thanks for your help, it's very much appreciated.
d
Ronildo Costa said:Let's wait the new version... it supposed to be available this week.
Please Log in or Create an account to join the conversation.
- Red Evolution
-
Topic Author
- Offline
- Premium Member
- Posts: 92
administrator/components/com_k2/models/item.php
line 491 replace this:
$variables = JRequest::get('post');
with this:
$variables = JRequest::get('post',JREQUEST_ALLOWRAW);
Hop this helps
Please Log in or Create an account to join the conversation.
- ckka
-
- Offline
- New Member
- Posts: 7
Please Log in or Create an account to join the conversation.
- Amy L Dent Beebe
-
- Offline
- New Member
- Posts: 2
I'm also confused because in the forums it seems to say that in any version after 2.3, this functionality is built in. I just downloaded 2.4 and I can't find any ability for an html field.
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
Please Log in or Create an account to join the conversation.
- Amy L Dent Beebe
-
- Offline
- New Member
- Posts: 2
William White said:
Try looking in administrator/components/com_k2/controlers/ for the files
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
Please Log in or Create an account to join the conversation.
- josh tischer
-
- Offline
- New Member
- Posts: 5
details and documentation
Please Log in or Create an account to join the conversation.
- Jock
-
- Offline
- Premium Member
- Posts: 90
I am trying desperately to add some {gallery},{/gallery} code in an extra field but it is simply outputting the syntax.
I tried what you suggested above but it is not doing the job. I am using K2 2.4.1Is there something im missing here?
Many thanks if anyone has time to help me out here!
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
- Offline
- Platinum Member
- Posts: 404
Anyone have any solutions?
Jock said:
Hi Josh,
I am trying desperately to add some {gallery},{/gallery} code in an extra field but it is simply outputting the syntax.
I tried what you suggested above but it is not doing the job. I am using K2 2.4.1Is there something im missing here?
Many thanks if anyone has time to help me out here!
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
- Offline
- Platinum Member
- Posts: 404
blog.codepyro.com/2011/03/enable-html-in-joomla-k2-extra-fields.html
Please Log in or Create an account to join the conversation.
- Jock
-
- Offline
- Premium Member
- Posts: 90
<?php echo JHTML::_('content.prepare', $extraField->value); ?>
Worked a treat ^
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
- Offline
- Platinum Member
- Posts: 404
<?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?> <!-- Item extra fields -->
<div class="itemExtraFields">
<h3><?php echo JText::_('Additional Info'); ?></h3>
<ul>
<?php foreach ($this->item->extra_fields as $key=>$extraField):?>
<li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
<span class="itemExtraFieldsLabel"><?php echo $extraField->name; ?>:</span>
<span class="itemExtraFieldsValue"><?php echo $extraField->value; ?></span>
<br class="clr" />
</li>
<?php endforeach; ?>
</ul>
<div class="clr"></div>
</div>
<?php endif; ?>
Assuming this is the same code you have, can you past in yours so that I can see where your line goes?
Please Log in or Create an account to join the conversation.