Last active
June 18, 2018 14:13
-
-
Save uglyeoin/11133dd0e2dc03db16be80c21a5275a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo $this->item->jcfields[0]->value; ?> | |
## The number is the ID of the field NOT the number in the array | |
<?php echo $item->jcfields[JText::_('JCFIELDS_FIELDNAME')]->value; ?> | |
## FIELDNAME is the NAME of the field as you have saved it | |
## or turn core fields into names | |
<?php | |
// Turn fields from array numbers into field names. I usually stick this in the head somewhere. | |
foreach($this->item->jcfields as $jcfield){ | |
$this->item->field[$jcfield->name] = $jcfield; | |
} | |
?> | |
// Call the field by the name. With error checking if it is empty. | |
// This way we can add markup around it and it will only appear if the field is in use. | |
<?php | |
if (isset($this->item->field['price']->value) and !empty($this->item->field['price']->value)) | |
{echo "Value: " . $this->item->field['price']->value;}; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
my idea was good then ? :-)
https://www.facebook.com/groups/joomlanospam/permalink/10155263368160997/?comment_id=10155263517830997&reply_comment_id=10155265358735997¬if_id=1526939237607865¬if_t=group_comment_reply
we can get ->value and ->rawvalue