Search

Is there a way to limit categories only counting articles that have been publish? I was looking at my category xml output and noticed that all the articles under one category are being counted in as an article related to said category. Obviously this is not the desired functionality. is there anyway to get around this?

Not really. Remember that ‘publish’ is a totally arbitrary field. Some sections might have it, others not. Right now, there isn’t any way to filter the associated entry counts by the contents of a field in the target section, though I suppose you could write a field that extends selectbox link and does that.

I had a similar problem with comments. I only wanted my comment count to show moderated, or published, comments. What I had to do is create another data source to pull IDs of “published” comments from the entry and count them to get the number of comments. A little extra work, but more specific.

I figured this issue out with one exception. Using the selectbox link extension, i get this error when my entry has more than one category:

Illegal offset type in isset or empty
/httpdocs/v1/extensions/selectbox_link_field/fields/field.selectbox_link.php line 244

239     
240     
241     public function findFieldIDFromRelationID($id){
242         if(is_null($id)) return NULL;
243         
244         if (isset(self::$cacheRelations[$id])) {
245             return self::$cacheRelations[$id];
246         }
247
248         try{

    backtrace:

[/httpdocs/v1/extensions/selectbox_link_field/fields/field.selectbox_link.php:244] GenericErrorHandler::handler();
[/httpdocs/v1/extensions/selectbox_link_field/fields/field.selectbox_link.php:130] fieldSelectBox_Link->findFieldIDFromRelationID();
[/httpdocs/v1/extensions/selectbox_link_field/fields/field.selectbox_link.php:73] fieldSelectBox_Link->__findPrimaryFieldValueFromRelationID();
[/httpdocs/v1/symphony/lib/toolkit/data-sources/datasource.section.php:236] fieldSelectBox_Link->groupRecords();
[/httpdocs/v1/workspace/data-sources/data.category_count.php:52] include();
[/httpdocs/v1/symphony/lib/toolkit/class.frontendpage.php:489] datasourcecategory_count->grab();
[/httpdocs/v1/symphony/lib/toolkit/class.frontendpage.php:238] FrontendPage->processDatasources();
[/httpdocs/v1/symphony/lib/toolkit/class.frontendpage.php:63] FrontendPage->__buildPage();
[/httpdocs/v1/symphony/lib/core/class.frontend.php:50] FrontendPage->generate();
[/httpdocs/v1/index.php:20] Frontend->display();

any ideas on what is going on here?

I’m just getting the same error. It occurs when I set the group value for a DS…

Any ideas?

I get the same error, trying to group the output. Is there some workaround? I suppose I could skip the grouping and do it manually in XSL somehow but that would be a bit messy.

J

sym 2.1.2

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details