By rbi on Saturday, 03 December 2016
Replies 12
Likes 0
Views 2K
Votes 0
Hi,

I use v3.4.25. I have disabled the "Make fields available in lists and calendar" because of high drop of performance. I have many events and several custom fields.

I want to do something very simple but I get lost in the documentation and FAQ.
I want to display a table, excel look, with 3 custom fields. There are five columns "Date", "Title", "Field1", "Field2", "Field3".
What is the procedure I need to follow?

br
Roland
Use the event list menu item type and select the columns you want to display.
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,
The event list menu item type lists only core fields/columns. How do I do to display 3 custom fields from a field collection?
br
Roland
rbi
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Roland,
there is a little trick here. Down the fields selection area you will notice a textarea which gets populated when you add a column. If you use your Custom Fields template tag, you can add them there easily. You can get your custom fields template tag choosing them in the Custom Layout editor.

This is not ideal, but we are working on improving the Events lists view to include better usability.
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi
Actually a better trick is to make the "Make fields available in lists and calendar" back to YES while editing .The fields selection area shows then my custom fields. So the table shows well now my 3 custom fields.

BUT, when I put back the "Make fields available in lists and calendar" back to NO the table does not show the values. I am back to the starting block. What am I doing wrong?

Roland
rbi
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Oh!! I was not aware Geraint implemented that!!. Great!!

If you want to show the fields, you need to have the "Make fields available in lists and calendar" set to YES at any time.
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I cannot set them to YES because it slows down too much the performance of the web site.
Is there a way to show the 3 custom fields in a table with a Latest Events module that I can customize? Do you have an example of a procedure allowing me to retrieve them?
Roland
rbi
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I'm afraid the only way to have Custom fields availabel in lists (and calendar) views and in latest events module, is setting that option to Yes.

As it's only 3 fields, maybe you can "use" other core fields for this purpose with a bit of language overrides...

Do you have any measure of how bad the performance is when you enable that option?
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Performance decreases drastically. I have about 600 events and 28 custom fields. These are used for setting up the events.
I have managed so far because I show some of the custom fields in the event detail view. But I need at least one tabular view, ummmhh, very bad news here!
rbi
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
600 events and 28 custom fields should not be that slow - it may be worth enabling Joomla debug mode to see which database queries are slow and if there are any optimisations that can be made.

The solution I have for you is to create a template override to temporarily enable list output for custom fields ONLY for that menu item type.

Create a file templates/YOURTEMPLATE/html/com_jevents/default/list/events.php with this content


<?php
defined('_JEXEC') or die('Restricted access');

$cfplugin = JPluginHelper::getPlugin('jevents', 'jevcustomfields' );
$dispatcher = JEventDispatcher::getInstance();
$oldplugin = new plgJEventsJevcustomfields($dispatcher, (array) ($cfplugin));
$dispatcher->detach($oldplugin);

$cfpluginparams = new JRegistry($cfplugin->params);
$cfpluginparams->set("inlists",1);
$cfplugin->params = $cfpluginparams->toString();
$newplugin = new plgJEventsJevcustomfields($dispatcher, (array) ($cfplugin));
$dispatcher->attach($newplugin);

$params = JComponentHelper::getParams( JEV_COM_COMPONENT );
$order = $params->get("dataorder", "rpt.startrepeat asc, rpt.endrepeat ASC, det.summary ASC");
$this->data = $this->datamodel->getRangeData($this->startdate,$this->enddate,$this->limit, $this->limitstart, $order);

$this->_header();
//$this->_showNavTableBar();

echo $this->loadTemplate("body");

$this->_viewNavAdminPanel();

$this->_footer();

// revert for modules etc.
$dispatcher->detach($newplugin);
$dispatcher->attach($oldplugin);



This will temporariy switch the custom fields in list option on for this one menu item type
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I agree with Geraint. That setup should not be that slow. I have a client site with more than 6000 events and 30 CF and there are no performance issues. Debugging it to profile the problem seems like a good idea before going with Geraint approach (which by the way you can also use to improve performance a bit )
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,

Really big thanks for your exemplary support.

I have found the problem. Very strange: the custom fields xml file was corrupted! I found that by chance after a fantastic crash when saving a simple modification for a custom field. I noticed while looking for a backup xml file that the size of the xml was 8Mb instead of being several Kb, this since the creation of my first custom fields.

The corruption is simple: the xml contained hundreds and hundreds of backslashes in some fields on the "description" text part.

Attached a file with the example of one corrupted field, extracted from the series of fields I have. For this one field size is 2Mb.

Now all is ok and performance is acceptable.

br
Roland
rbi
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Can you do some investigation for me please - each time the custom fields are edited an archive of the old version is created in the archive folder in the custom fields plugin path.

Can you check if there are many versions of the files and if they grew through time? I'm trying to see if something about the way you edited the file caused this exponential growth in the size of the file.
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post