Keyword

[SOLVED] Extra Fields

More
9 years 5 months ago #133513 by John
Extra Fields was created by John
I've been for awhile now trying to make this work with no luck. I have 2 extra fields of dates.
Although on the back-end it shows the format (10-31-2014) on the actual item.php page is shown as
(Friday, October 31, 2014.) I've been trying to use something like:

<?php echo JHTML::_('date', $this->item->extrafields[1], JText::_('K2_DATE_FORMAT_LC2')); ?> and
<?php echo JHTML::_('date', $this->item->extrafields[1], JText::_('m-d-Y')); ?> also...
<?php echo JHTML::_('date', $this->item->extrafields->mydatealias->value,JText::_('m-d-Y')); ?>

It "works"...LOL... but the only problem is that only brings the actual (today's) date and not the content entered in the database. I don't want ALL the dates with the same format, I just need these extra fields with that format.

Any help will be greatly appreciated.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 5 months ago - 9 years 5 months ago #133514 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Extra Fields
Hello John,

Have you tried, rendering each extrafield separately like this?
<?php echo $this->item->extraFields->EXTRAFIELDALIAS->value; ?>

You can also use var_dump() to see the exact value of the extrafield so you can manipulate it,

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

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

More
8 years 11 months ago #143551 by Joe Campbell
Replied by Joe Campbell on topic Extra Fields
Hi John,

I just posted a solution here:
www.joomlaworks.net/forum/k2-en/36900-edit-extra-field-date-format-in-specific-template#143550

I hope this helps,

Joe Campbell

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


Powered by Kunena Forum