Keyword

Advanced Search

Search Results (Searched for: Joomla K2 user extra fields)

  • Joe Campbell
  • Joe Campbell's Avatar
14 Jun 2016 15:36
Replied by Joe Campbell on topic v3 K2 Content Module

v3 K2 Content Module

Category: English K2 Community

Thanks Krikor,

Such a feature is a big deal for me. As I plan on controlling Content Modules on category and tag pages via extra fields.

Perhaps a post illustrating the similarities and differences between item vs category/tag extra/author fields would be helpful of K2 users.

Something similar to post I did with information I received from @Lefteris
www.joomlaworks.net/forum/k2-en/44148-k2-tags-vs-categories#149136

Thanks,

Joe
  • Wire Creative
  • Wire Creative's Avatar
28 Apr 2016 22:35
Replied by Wire Creative on topic All Items missing after 2.7 update

All Items missing after 2.7 update

Category: English K2 Community

I've tried repairing both through Joomla's database tools and cpanel's to no success. Even though I can see all that data in the k2 tables in the database, nothing will show up in the K2 Items or Categories screens.Users and user groups seem to work fine. I don't have any tags or extra fields, so I can't tell whether those parts are affected.
  • Joe Campbell
  • Joe Campbell's Avatar
06 Apr 2016 14:35

K2 Power Tip: User Agent Plugin for Website Optimization

Category: English K2 Community

Good News K2ers,

Joomla! 3.5 offers Platform Specific Caching:
joomlaseo.com/blog/joomla-3-5-platform-specific-caching

This means, my User Agent Plugin K2 Power Tip no longer has a caching limitation!!!

So go ahead and remove your sidebar from mobile devices or render device specific images (with the use of extra fields) - I am :)
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
16 Mar 2016 19:36
  • Richard
  • Richard's Avatar
21 Feb 2016 00:18
new user question was created by Richard

new user question

Category: English K2 Community

Hello,
I am a new user and having some issues in getting data to display in my joomla front end.

I created a category and associated extra fields and an associated extra field group.
I then used the K2 import/export tool to load about 800 items into the K2 category.
These items now appear as I expected in the Items section of K2 as shown here:



I then attempted to create a menu to display the category contents as shown here:





When I attempt to view the menu from the front end, This is what I see:



I was expecting to see a display of the items. Can someone clue me in on what I'm doing wrong?

Thanks in advance,
Richard
  • Michael Yaeger
  • Michael Yaeger's Avatar
18 Feb 2016 17:58

Display Extra Fields only to Certain Users or Access Levels

Category: English K2 Community

Yes, I strip out as much of the Joomla! "clutter" as I can, including any unnecessary templates, plugins, components, etc. I thought you were saying someone could force a different K2 layout template, which would not be good while trying to restrict extra fields.
  • Scott Lavelle
  • Scott Lavelle's Avatar
07 Feb 2016 00:26
Replied by Scott Lavelle on topic What Happened to K2 3.0?

What Happened to K2 3.0?

Category: English K2 Community

So - part of the issue is that there are other extensions out there that do some of the same things. When I look at K2 iteself, I ask what I'm really doing with it, which is usually using it as a Blog component, which others do fine - even Joomla Category Blog format works if you don't need comments and author blocks, but there are ways to deal with that as well.

When I want to do more, such as include Extra Fields, I can do that as well.

When I look at the "built in" gallery, in K2 I actually find it rather cumbersome to have to zip up pictures to include them and then have to do wierd FTP things or delete all pics to replace them. Not so bad for me, but for other staff members on my team who are less technical, or certainly my users, it's really hard for them. And captions on images with the built in system are also weird. Same goes for the video inclusions.

So - what does K2 REALLY bring for most folks who are putting it on new sites? The only thing that I've had to go back to K2 for lately is the module for displaying "latest" item on home page including the author block. Getting Zoo to do this is pretty impossible and there is no non-paid support for the product, and I think YooTheme is too expensive for Zoo, personally for the fact that I don't need any of their applications (like recipe, directory, etc).

Regarding "responsive": I haven't had the opportunity to test this since I've not really been using K2 since I moved to Joomla 3.x except for a site that doesn't have extra fields, so no real need to worry about responsive display of multi-column and also doesn't do multiple columns on the blog display page, so I don't really know what it would even do. However, having dealt with the template files before and looking at what is on the 2.5 site I currently use K2 on actively, I can see that there is no bootstrap incorporated, no responsive stuff natively, so I'd have to modify the display pretty heavily, which is not really something I want to have to spend my time on "recreating the wheel".

Mixed feelings, but especially unhappy with the lack of response from JoomlaWorks, especially with the lateness of the release for which there just doesn't seem any concern. I am especially confused by people who want to purchase a Pro support plan for this when it's been made abundantly clear that support for K2 is not a priority at this time.
  • Chris Hood
  • Chris Hood's Avatar
02 Nov 2015 15:33 - 02 Nov 2015 15:37

K2 stripping formatting from a custom field in TinyMCE

Category: English K2 Community

Hi all,

This is a tricky one involving some customisation - I've created a new column in the K2 Items Table in my site's database which I want to be editable on the K2 Items Admin page using the TinyMCE WYSIWYG editor. IE, I want it to retain the formatting tags on save.

This is essentially an 'opening hours' field - I wanted something akin to an Extra Field, but easier to work with in PHP. I anticipate some users might want to insert bullet points, bold or similar here.

I've added the field and WYSIWYG editor in the Admin K2 Items page no problem, but all tags are getting stripped on Save.

Things I've checked -
  • Database column type is correct ("Mediumtext") and it retains all tags when editing the raw database in phpMyAdmin
  • TinyMCE plugin is set to not strip anything other than 'applet'. I've tried adding some Valid elements here with no result.
  • All HTML filters in normal Joomla Configuration are set to 'no filtering'

One thing I have noticed is that in the K2 settings you can disable HTML Cleanup for Introtext and Fulltext, and both are disabled. So does this mean that K2 will strip all formatting from all fields other than those specified somewhere? I've noticed the Embed Video field retains all its HTML tags, so there's obviously something somewhere that determines fields which the system won't strip tags from.

Any advice would be greatly appreciated! Thank you :)
  • benner
  • benner's Avatar
19 Oct 2015 21:06 - 19 Oct 2015 21:07
Replied by benner on topic Create table using items extra fields

Create table using items extra fields

Category: English K2 Community

So far i have done this:

1. I have created a new k2 template folder: com_k2/templates/table

2. In com_k2/templates/table/category_item.php I have this (I have added the code after <!-- extrafields columns -->):
<?php /** * @version 2.6.x * @package K2 * @author JoomlaWorks https://www.joomlaworks.net * @copyright Copyright (c) 2006 - 2014 JoomlaWorks Ltd. All rights reserved. * @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html */ // no direct access defined('_JEXEC') or die; // Define default image size (do not change) K2HelperUtilities::setDefaultImage($this->item, 'itemlist', $this->params); ?> <!-- Start K2 Item Layout --> <div class="catItemView group<?php echo ucfirst($this->item->itemGroup); ?><?php echo ($this->item->featured) ? ' catItemIsFeatured' : ''; ?><?php if($this->item->params->get('pageclass_sfx')) echo ' '.$this->item->params->get('pageclass_sfx'); ?>"> <!-- Plugins: BeforeDisplay --> <?php echo $this->item->event->BeforeDisplay; ?> <!-- K2 Plugins: K2BeforeDisplay --> <?php echo $this->item->event->K2BeforeDisplay; ?> <div class="catItemHeader"> <?php if($this->item->params->get('catItemDateCreated')): ?> <!-- Date created --> <span class="catItemDateCreated"> <?php echo JHTML::_('date', $this->item->created , JText::_('K2_DATE_FORMAT_LC2')); ?> </span> <?php endif; ?> <?php if($this->item->params->get('catItemTitle')): ?> <!-- Item title --> <h3 class="catItemTitle"> <?php if(isset($this->item->editLink)): ?> <!-- Item edit link --> <span class="catItemEditLink"> <a class="modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="<?php echo $this->item->editLink; ?>"> <?php echo JText::_('K2_EDIT_ITEM'); ?> </a> </span> <?php endif; ?> <?php if ($this->item->params->get('catItemTitleLinked')): ?> <a href="<?php echo $this->item->link; ?>"> <?php echo $this->item->title; ?> </a> <?php else: ?> <?php echo $this->item->title; ?> <?php endif; ?> <?php if($this->item->params->get('catItemFeaturedNotice') && $this->item->featured): ?> <!-- Featured flag --> <span> <sup> <?php echo JText::_('K2_FEATURED'); ?> </sup> </span> <?php endif; ?> </h3> <?php endif; ?> <?php if($this->item->params->get('catItemAuthor')): ?> <!-- Item Author --> <span class="catItemAuthor"> <?php echo K2HelperUtilities::writtenBy($this->item->author->profile->gender); ?> <?php if(isset($this->item->author->link) && $this->item->author->link): ?> <a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a> <?php else: ?> <?php echo $this->item->author->name; ?> <?php endif; ?> </span> <?php endif; ?> </div> <!-- Plugins: AfterDisplayTitle --> <?php echo $this->item->event->AfterDisplayTitle; ?> <!-- K2 Plugins: K2AfterDisplayTitle --> <?php echo $this->item->event->K2AfterDisplayTitle; ?> <?php if($this->item->params->get('catItemRating')): ?> <!-- Item Rating --> <div class="catItemRatingBlock"> <span><?php echo JText::_('K2_RATE_THIS_ITEM'); ?></span> <div class="itemRatingForm"> <ul class="itemRatingList"> <li class="itemCurrentRating" id="itemCurrentRating<?php echo $this->item->id; ?>" style="width:<?php echo $this->item->votingPercentage; ?>%;"></li> <li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_1_STAR_OUT_OF_5'); ?>" class="one-star">1</a></li> <li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_2_STARS_OUT_OF_5'); ?>" class="two-stars">2</a></li> <li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_3_STARS_OUT_OF_5'); ?>" class="three-stars">3</a></li> <li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_4_STARS_OUT_OF_5'); ?>" class="four-stars">4</a></li> <li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_5_STARS_OUT_OF_5'); ?>" class="five-stars">5</a></li> </ul> <div id="itemRatingLog<?php echo $this->item->id; ?>" class="itemRatingLog"><?php echo $this->item->numOfvotes; ?></div> <div class="clr"></div> </div> <div class="clr"></div> </div> <?php endif; ?> <div class="catItemBody"> <!-- Plugins: BeforeDisplayContent --> <?php echo $this->item->event->BeforeDisplayContent; ?> <!-- K2 Plugins: K2BeforeDisplayContent --> <?php echo $this->item->event->K2BeforeDisplayContent; ?> <?php if($this->item->params->get('catItemImage') && !empty($this->item->image)): ?> <!-- Item Image --> <div class="catItemImageBlock"> <span class="catItemImage"> <a href="<?php echo $this->item->link; ?>" title="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>"> <img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" /> </a> </span> <div class="clr"></div> </div> <?php endif; ?> <?php if($this->item->params->get('catItemIntroText')): ?> <!-- Item introtext --> <div class="catItemIntroText"> <?php echo $this->item->introtext; ?> </div> <?php endif; ?> <div class="clr"></div> <?php if($this->item->params->get('catItemExtraFields') && count($this->item->extra_fields)): ?> <!-- Item extra fields --> <div class="catItemExtraFields"> <h4><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h4> <ul> <?php foreach ($this->item->extra_fields as $key=>$extraField): ?> <?php if($extraField->value != ''): ?> <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>"> <?php if($extraField->type == 'header'): ?> <h4 class="catItemExtraFieldsHeader"><?php echo $extraField->name; ?></h4> <?php else: ?> <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span> <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span> <?php endif; ?> </li> <?php endif; ?> <?php endforeach; ?> </ul> <div class="clr"></div> </div> <?php endif; ?> <!-- Plugins: AfterDisplayContent --> <?php echo $this->item->event->AfterDisplayContent; ?> <!-- K2 Plugins: K2AfterDisplayContent --> <?php echo $this->item->event->K2AfterDisplayContent; ?> <div class="clr"></div> </div> <?php if( $this->item->params->get('catItemHits') || $this->item->params->get('catItemCategory') || $this->item->params->get('catItemTags') || $this->item->params->get('catItemAttachments') ): ?> <div class="catItemLinks"> <?php if($this->item->params->get('catItemHits')): ?> <!-- Item Hits --> <div class="catItemHitsBlock"> <span class="catItemHits"> <?php echo JText::_('K2_READ'); ?> <b><?php echo $this->item->hits; ?></b> <?php echo JText::_('K2_TIMES'); ?> </span> </div> <?php endif; ?> <?php if($this->item->params->get('catItemCategory')): ?> <!-- Item category name --> <div class="catItemCategory"> <span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span> <a href="<?php echo $this->item->category->link; ?>"><?php echo $this->item->category->name; ?></a> </div> <?php endif; ?> <?php if($this->item->params->get('catItemTags') && count($this->item->tags)): ?> <!-- Item tags --> <div class="catItemTagsBlock"> <span><?php echo JText::_('K2_TAGGED_UNDER'); ?></span> <ul class="catItemTags"> <?php foreach ($this->item->tags as $tag): ?> <li><a href="<?php echo $tag->link; ?>"><?php echo $tag->name; ?></a></li> <?php endforeach; ?> </ul> <div class="clr"></div> </div> <?php endif; ?> <?php if($this->item->params->get('catItemAttachments') && count($this->item->attachments)): ?> <!-- Item attachments --> <div class="catItemAttachmentsBlock"> <span><?php echo JText::_('K2_DOWNLOAD_ATTACHMENTS'); ?></span> <ul class="catItemAttachments"> <?php foreach ($this->item->attachments as $attachment): ?> <li> <a title="<?php echo K2HelperUtilities::cleanHtml($attachment->titleAttribute); ?>" href="<?php echo $attachment->link; ?>"> <?php echo $attachment->title ; ?> </a> <?php if($this->item->params->get('catItemAttachmentsCounter')): ?> <span>(<?php echo $attachment->hits; ?> <?php echo ($attachment->hits==1) ? JText::_('K2_DOWNLOAD') : JText::_('K2_DOWNLOADS'); ?>)</span> <?php endif; ?> </li> <?php endforeach; ?> </ul> </div> <?php endif; ?> <div class="clr"></div> </div> <?php endif; ?> <div class="clr"></div> <?php if($this->item->params->get('catItemVideo') && !empty($this->item->video)): ?> <!-- Item video --> <div class="catItemVideoBlock"> <h3><?php echo JText::_('K2_RELATED_VIDEO'); ?></h3> <?php if($this->item->videoType=='embedded'): ?> <div class="catItemVideoEmbedded"> <?php echo $this->item->video; ?> </div> <?php else: ?> <span class="catItemVideo"><?php echo $this->item->video; ?></span> <?php endif; ?> </div> <?php endif; ?> <?php if($this->item->params->get('catItemImageGallery') && !empty($this->item->gallery)): ?> <!-- Item image gallery --> <div class="catItemImageGallery"> <h4><?php echo JText::_('K2_IMAGE_GALLERY'); ?></h4> <?php echo $this->item->gallery; ?> </div> <?php endif; ?> <div class="clr"></div> <?php if($this->item->params->get('catItemCommentsAnchor') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?> <!-- Anchor link to comments below --> <div class="catItemCommentsLink"> <?php if(!empty($this->item->event->K2CommentsCounter)): ?> <!-- K2 Plugins: K2CommentsCounter --> <?php echo $this->item->event->K2CommentsCounter; ?> <?php else: ?> <?php if($this->item->numOfComments > 0): ?> <a href="<?php echo $this->item->link; ?>#itemCommentsAnchor"> <?php echo $this->item->numOfComments; ?> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?> </a> <?php else: ?> <a href="<?php echo $this->item->link; ?>#itemCommentsAnchor"> <?php echo JText::_('K2_BE_THE_FIRST_TO_COMMENT'); ?> </a> <?php endif; ?> <?php endif; ?> </div> <?php endif; ?> <?php if ($this->item->params->get('catItemReadMore')): ?> <!-- Item "read more..." link --> <div class="catItemReadMore"> <a class="k2ReadMore" href="<?php echo $this->item->link; ?>"> <?php echo JText::_('K2_READ_MORE'); ?> </a> </div> <?php endif; ?> <div class="clr"></div> <?php if($this->item->params->get('catItemDateModified')): ?> <!-- Item date modified --> <?php if($this->item->modified != $this->nullDate && $this->item->modified != $this->item->created ): ?> <span class="catItemDateModified"> <?php echo JText::_('K2_LAST_MODIFIED_ON'); ?> <?php echo JHTML::_('date', $this->item->modified, JText::_('K2_DATE_FORMAT_LC2')); ?> </span> <?php endif; ?> <?php endif; ?> <!-- Plugins: AfterDisplay --> <?php echo $this->item->event->AfterDisplay; ?> <!-- K2 Plugins: K2AfterDisplay --> <?php echo $this->item->event->K2AfterDisplay; ?> <div class="clr"></div> </div> <!-- End K2 Item Layout --> <!-- extrafields columns --> <div class="extrafieldscolumns"> <ul> <li><?php echo $this->item->extraFields->headquarter->value ;?></li> <li><?php echo $this->item->extraFields->founded->value ;?></li> <li><?php echo $this->item->extraFields->minimum-deposit->value ;?></li> </ul> </div> <!-- END extrafields columns -->


3. I have added the following paragraph at the end of the k2 .css file:

/* extrafields columns */

.extrafieldscolumns ul { width: 100%; margin:0;padding:0; /* CSS Reset */ max-width: 1000px; /* restrict the width */ margin: auto; /* center it */}.extrafieldscolumns li { width: 20%; float:left; /* IMPORTANT */ list-style-type: none; display:inline; /* IMPORTANT */}

/* END extrafields columns */




4. I have then selected the new created template ("table") in the K2 category for which I want to use the table.


The result looks like this:

K2 item 1
Headquarter: New York
Date Created: 1980
Minimum Deposit: 5000

K2 item 2
Headquarter Berlin
Date Created 1958
Minimum Deposit 3000

K2 item 3
Headquarter London
Date Created 1973
Minimum Deposit 3500



Instead of this:


Headquarter I Date Created I Minimum Deposit
K2 item 1 New York 1980 5000
K2 item 2 Berlin 1958 3000
K2 item 2 London 1973 3500
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
02 Oct 2015 12:10
Replied by Krikor Boghossian on topic k2 extra fields visibility for specified user id

k2 extra fields visibility for specified user id

Category: English K2 Community

As per the instructions in Joomla!'s documentation:

Use $user->groups to retrieve an array with all the IDs that refer to the groups (from #__usergroups table) of a user.


Then you can use PHP's in_array() function - php.net/manual/en/function.in-array.php - to look for the id in the array. eg: if (in_array( ID , $user->groups))
  • Vlachos Evaggelos
  • Vlachos Evaggelos's Avatar
02 Oct 2015 00:19
Replied by Vlachos Evaggelos on topic k2 extra fields visibility for specified user id

k2 extra fields visibility for specified user id

Category: English K2 Community

Yes i assign $user to Joomla!'s user object

<?php $user = JFactory::getUser(); ?>
<?php if($params->get('itemExtraFields') && count($this->item->extra_fields) && $user->id = '543'): ?>

With this method again dont work

<?php $user = JFactory::getUser(); if($params->get('itemExtraFields') && count($this->item->extra_fields) && $user->id = '543'): ?>

$user->id code work because echo variable and see the login user id. The problem is in this code $user->id = '543'. Any idea?
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
01 Oct 2015 17:27
  • Angel
  • Angel's Avatar
07 Sep 2015 04:15
Users additional fields was created by Angel

Users additional fields

Category: English K2 Community

I'm NEW to K2
I'm going to add fields to the Users. Do I add the fields on Joomla or K2???

If in joomla, one of the fields is Gender, and K2 already asks for it. Do I have to make the dual entry??
Also if in Joomla. do the extra fields are added to K2?? Or the extra fields have to be managed through Joomla users.

If in K2, how I add the extra fields.

I need to understand if I'll manage users through Joomla and use K2 user login just to use K2 story?????

Fields needed are: Phone, Town, Sex, How you new about us and the Motorcycle, since it is a motorcycle group.
  • Tarun Das
  • Tarun Das's Avatar
17 Aug 2015 11:49
Replied by Tarun Das on topic Facebook comments module and K2 Category

Facebook comments module and K2 Category

Category: English K2 Community

All that I wanted was to add a FB comment module that would appear at the end of the item page of K2. The problem was that FB module would appear in K2 category listing pages too. I did not want that. Users need to comment only in the article not on the article lists. Sounds logical isn't it? So I was thinking how to remove that module from K2 Category listings. ( Wonder why nobody faced this problem before me). Module Anywhere is a wonderful extension. But it does not suit my requirement. Module Anywhere ADDs a module anywhere you want it does not REMOVE a module from the place you want. What Module Anywhere does is it makes a module acts like a plugin so that you can write the parameters in any writable area of your page. With Module Anywhere I had to put my FB comment module inside the introtext area of item pages as that's the only writable area of the page. ( I did not use Extra Fields). Now, think how it would look in a page if comments appears in the middle of the page before "Tagged under" and "Related Posts" things. Secondly, I have to edit all my old and future articles and put the Module Anywhere tag below it. That's certainly not the proper solution. For the same reason I did not use any FB comment plugin extension available for Joomla. The proper solution would be a module that appears only in K2 item pages. Extensive search in internet did not solve my problem. But Krikor gave me some hint in his reply when he wrote, "My approach however would be to create a new position in the item.php" . First I thought that would involve coding. Since I am not a coder and all my skills are limited to copy and paste ( that's ok with me, I am not a professional website maker, it's my hobby, I make websites only for non profit organisation for free) I searched in internet and found that two simple copy and paste would solve my problem. First I need to add a line:
<position>fbcomments</position>
in templateDetails.xml file. That would be my new module position name.
Second, I need to add a div at the end of the item.php file. This time I was lucky and found the code in Gavick site.
<div> <?php $position = 'fbcomments'; $params = array('style'=>'gk_style'); $document = &JFactory::getDocument(); $renderer = $document->loadRenderer('module'); $contents = ''; foreach (JModuleHelper::getModules($position) as $mod) { $contents .= $renderer->render($mod, $params); } echo $contents; ?> </div>

Those two simple cut and paste solved my problem. Thank you Krikor for your hint. Now you got to tell me whatever I did is right?

Regards
Tarun
  • Daniel
  • Daniel's Avatar
14 Jul 2015 08:06

Validation in the frontend submit form

Category: English K2 Community

Hi guys,

I hope you can help or guide me here since I'm about to jump out of a window.

My site uses K2 as the foundation to create an event's site. In other words, K2 items represent events, and these events are user generated from the frontend. With a nice template and a couple of cool extensions everything was looking great, so I went live in beta testing mode and invited some users to submit their events.

The majority of them (but a few don't) are having the same issue when they click save in the frontend K2 submit item form:

DateTime::__construct(): Failed to parse time string (2015-18-8 00:00:00) at position 6 (8): Unexpected character

or

DateTime::__construct(): Failed to parse time string (undefined-undefined-15. März 2016) at position 0 (u): The timezone could not be found in the database


As you can imagine events rely heavily on dates, start date, end date, registration start date, etc so I have quite a few date extra fields which are the ones that are creating these error messages and preventing the creation of new K2 items.

As you can see the problem is due to incorrect formatting of the date fields, and the issue is that I cannot find a way to add a reliable validation for these fields. I did a template override of itemform.php and added javascript to force the users to use the datepickers and to validate the format of the date fields. Even when date pickers are used there could still be format issues due to different date formats used by computers in different parts of the world. However, even if the javascript is hardcoded at itemform.php it does not seem to work in many cases.

Other people seem to be having similar issues as per
www.joomlaworks.net/forum/k2-en/40132-problems-with-field-validation

But it doesn't seem to be a clear solution

So how can we reliably check with regular expressions that the content of the fields is correct? And show appropriate error messages when the format is not correct? Prior to running into ugly error messages as per the one shown above and users losing all the populated info.

Please provide some advice or guiding

Many thanks!
  • quebecguitare
  • quebecguitare's Avatar
19 May 2015 14:34
Replied by quebecguitare on topic Extra Fields Value NULL

Extra Fields Value NULL

Category: English K2 Community

Here is the list of extension with "K2" in the name:

Nom Emplacement Statut Type Version Date Auteur Dossier ID

Canonical Links for K2
Site Plug-in 3.6.0 July 2014 Marko Dedovic k2 10197

French (France) language pack for K2
Site Fichier 2.5.0 October 23, 2014 getk2.org N/A 10131

Josetta - K2 Categories
Site Plug-in 2.6.9 December 8th, 2014 JoomlaWorks josetta_ext 10286

Josetta - K2 Items
Site Plug-in 2.6.9 June 7th, 2012 JoomlaWorks josetta_ext 10287

K2
Administration Composant 2.6.9 December 8th, 2014 JoomlaWorks N/A 10021

K2 Comments
Site Module 2.6.9 December 8th, 2014 JoomlaWorks N/A 10009

K2 Content
Site Module 2.6.9 December 8th, 2014 JoomlaWorks N/A 10010

K2 Integration- My Maps Location
Site Plug-in 2.2.8 December 2012 Joomunited k2 10333

K2 Login
Site Module N/A 10011

K2 My Maps location
Site Module 2.2.8 December 2012 JoomUnited N/A 10326

K2 Quick Icons (admin)
Administration Module 2.6.9 December 8th, 2014 JoomlaWorks N/A 10015

K2 Stats (admin)
Administration Module 2.6.9 December 8th, 2014 JoomlaWorks N/A 10016

K2 Tools
Site Module 2.6.9 December 8th, 2014 JoomlaWorks N/A 10012

K2 User
Site Module 2.6.9 December 8th, 2014 JoomlaWorks N/A 10014

K2 Users
Site Module 2.6.9 December 8th, 2014 JoomlaWorks N/A 10013

Recherche intelligente - K2
Site Plug-in 2.6.9 December 8th, 2014 JoomlaWorks finder 10017

Search - K2
Site Plug-in 2.6.9 December 8th, 2014 JoomlaWorks search 10018

System - AutotweetK2
Site Plug-in 7.7.0 October 2009 Extly.com system 10145

System - K2
Site Plug-in 2.6.9 December 8th, 2014 JoomlaWorks system 10019

User - K2
Site Plug-in 2.6.9 December 8th, 2014 JoomlaWorks user 10020
  • hooman hamedifar
  • hooman hamedifar's Avatar
18 May 2015 14:02

User extended fields issue with required extra field check

Category: English K2 Community

Hi,
I use k2 2.6.9 and joomla 3.4.1 , when I try to add item directly from front end, form checks required extra fields and show error if some fields didn't filled. but when I enable User Extended Fields for K2 (by JoomlaWorks) Plugin, this feature dosen't work and required check isn't work normally,
let me ask you what is this issue and how can I fix it.

thanks.
  • Daniel
  • Daniel's Avatar
10 Apr 2015 02:05

How to access extra fields in author view

Category: English K2 Community

Hi there,

I'm trying to show the extra fields for each item in the author view (user.php) but I'm having some trouble and I hope you can help me.

I was trying to follow the same technique that I used to show the item's extra fields in the tag view (tag.php) but there is something different that escapes me.

First difference I noticed is that in the K2 global configuration the “Layouts and views” for author pages does not have the option to enable/disable extra fields. Whereas this option is available in the tags section under “Layouts and views” as well.

In tags.php I can index the extra fields for each item as follows:
$extraitem = array();
// Extra field array indexed by field alias
foreach($item->extra_fields as $extrafield){
$extraitem[$extrafield->alias] = $extrafield;
}

Whereas if I use the same code in user.php I get an error message: “Warning: Invalid argument supplied for foreach() in...”

Then I tried to do “print_r ($item->extra_fields)” and in tags.php I get an array with all the extra fields per item as expected, however the same code applied in user.php gets me string with just the ID and value of the extra fields.

So in user.php I cannot index the extra fields with the same code that I use in tags.php since $item->extra_fields is not an array.

What can I do to index the extra fields for each item in the author view (user.php)?

I'm using K2 2.6.9 and Joomla 3.4.1

Many thanks!
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
16 Mar 2015 14:23
Replied by Krikor Boghossian on topic Extra fields restrictions

Extra fields restrictions

Category: English K2 Community

You can render these extrafields directly in your template.
This post will help you do this: www.joomlaworks.net/forum/k2-en/31801-where-to-edit-k2-after-item-fields

Then by using Joomla!'s user object - docs.joomla.org/Accessing_the_current_user_object you can seperate which fields are intended for guests and which for registered users.

As for an extension I think Akeeba Subscriptions might do the trick.
  • Mirko
  • Mirko's Avatar
16 Mar 2015 13:37
Extra fields restrictions was created by Mirko

Extra fields restrictions

Category: English K2 Community

Hi people,

I'm using K2 to create a products catalog but I have a problem I can't resolve: I need to give the opportunity to joomla users to see only some K2 extra fields depending on the user group they belongs to.

Example: in my Joomla site I have 2 user groups: A & B and 1 product (in k2) which extra fields are: price, color, dimensions. Now, I want that a user logged in my website can see all the extra fields if he belongs to group A and, for example, only the price and color if he belongs to group B.
How can I do to accomplish this ? Is there any K2 extension I can buy to obtain my aim ?

Thanks in advance and sorry for my bad English.

Mirko
Displaying 41 - 60 out of 248 results.

Powered by Kunena Forum