If sub-categories are created, these show up in the sub-menu beneath the horizontal Categories menu when the main category is selected (in the default Drigg theme), but do not show up in the Categories block.

The RSS feed for a category - from the Feed icons in the Categories block - includes the items listed in the main Category, but does not include any items listed in sub-categories of the selected Category.

If subcategories are to be implemented in Drigg, the ideal, would be to create RSS feeds (and obvious links for these) for each sub-category, as well as for primary categories; and also, to include all items in sub-categories of a primary category, in the RSS feed for that primary category.

Comments

mercmobily’s picture

Hi,

coolclu3, can you have a look at this issue please?

Merc.

mercmobily’s picture

Hi,

coolclu3, I think your bit is only:

"The RSS feed for a category - from the Feed icons in the Categories block - includes the items listed in the main Category, but does not include any items listed in sub-categories of the selected Category."

Can you please enrich the query for the RSS feed as well, in the same way?

I will deal with the block...

Merc.

coolclu3’s picture

Okay Merc, I'll take care of this. I will deal with the block as well, just leave the bug to me...
Cheers

mercmobily’s picture

Hi,

Coolclu3: I _love_ you. Seriously.
We will _have to_ forward port this to the Drupal 6 port. I will take care of it once you've sent the patch.

***Thank you**.

The bright side is that FriendList is very very very nearly released. Are you aware of that module? It's a Drupal revolution!

Merc.

mercmobily’s picture

Hi,

Coolclu3, please also have a look at #315464: Items in subcategory included on the front page block but not on category page block. I marked it as duplicate, but I think it might be a little different... but the same problem.

Bye!

Merc.

coolclu3’s picture

Yep, I am aware of FriendList, I haven't got the chance to fully try it out though, but from the description it certainly looks interesting, AND...complex.
Right now, I'm setting up a website for my client (in Drupal of course) which will take a few more days :). But this patch will be available by ...next Monday I'd say. This should be a quick fix.

Just one question though. Am I gonna attach the patch here, for drigg-5.x-1.36 ? Or was I granted the CVS access before?

btw, I am now full time doing just Drupal stuff. Yes, Full-time. How cool is that? ;)

mercmobily’s picture

Hi,

Really cool indeed :-D
You do have access to CVS, but it's better if you send it as a patch, because I need to forward-port it to DRUPAL-6...

Thank you!

Merc.

coolclu3’s picture

Duplicate comment

coolclu3’s picture

Hi
Problem resolved!
But the block just displays all the categories /subcategories at the same level. That is, there is no hierachical order in the block.

I'm not too happy with this, but it seems making the RSS Categories block hierachical takes some more effort....

Merc, are you happy with the flat menu? If so, I'll send the patch. It's about 5,6 lines of code

mercmobily’s picture

Hi,

you're a star coolclu3.

Is it possible to make it just an indented LI item?
Just wondering. I can just see the bug reports "the item list is flat"... ecc.

Bye,

Merc.

coolclu3’s picture

First of all , the categories/subcategories on the RSS block are displayed ordered by (weight, creation time), like the main top menu, kind of.

Generating the whole properly indented RSS block menu would require a bit more hacking on the drigg_ui_sections() function when $print_rss_links == TRUE. This would be a simple and *separate* function that gets all the categories/subcategories.

And *VERY* likely, that a separate function drigg_ui_rss_sections() needs to be kinda 'forked' from drigg_ui_sections() (Then the $print_rss_links param should be removed, of course). This approach is also better in the sense that the top menu depends on the currently viewed category, whereas the RSS block is always *fixed*

This change will take time and unfortunately, I don't have enough time & attention to work on this right now coz i'm fully occupied with my 2 paid projects. I'll quickly post the patch for the code here in case someone's interested to get the proper menu

1. Making the RSS feed to read the items in subcates as well:
File drigg_ui.module, function drigg_ui_node_feed(), line 162:
Change

  if($category != 'All'){
    $tl=drigg_section_list();
    $tid = $tl['by_safe_name'][$category];
    $extra_join .= ' LEFT JOIN {term_node} t ON n.nid = t.nid ';
    $where_conditions.=" t.tid=$tid AND ";
}

To

  if($category != 'All'){
    $tl=drigg_section_list();
    $tid = $tl['by_safe_name'][$category];
    //$extra_join .= ' LEFT JOIN {term_node} t ON n.nid = t.nid ';
    //$where_conditions.=" t.tid=$tid AND ";
    $tid_list = listize_from_array(drigg_ui_get_all_offspring_tids($tid)); //string
    $tid_list .= $tid;
    $extra_join .= ' LEFT JOIN {term_node} t ON n.nid = t.nid ';
    $where_conditions .= " t.tid IN ($tid_list) AND ";
  }

2. Getting the RSS block menu to have the subcategories as well (INCOMPLETE, see comment right above)
File drigg_ui.module, function drigg_ui_sections(), line ~602

Change

  if($terms){
    foreach( $terms['by_weight'] as $tid ){
      //only checks for terms that are children of $parent_tid
      if (($terms['lookup'][$tid]['parent_tid'] != $parent_tid ) /*&& ($tid != $parent_tid)*/){
        continue;
      }

to

  if($terms){
    foreach( $terms['by_weight'] as $tid ){
      //only checks for terms that are children of $parent_tid when $print_rss_links is FALSE (i.e. dealing with top menu)
      if (($terms['lookup'][$tid]['parent_tid'] != $parent_tid ) && (!$print_rss_links) /*&& ($tid != $parent_tid)*/){
        continue;
      }

If you notice carefully the $print_rss_links logic in the drigg_ui_sections plays very minor role, and therefore there should be 2 functions, 1 for the main menu, and one for the RSS block. Here is the logic for the RSS block

     // Work out the links for the RSS feed for that category - if
      // present!
      $rss_links=' ';
      if($print_rss_links){
        $all_string=variable_get('drigg_look_rss_cat_all','');
        $cat_string=variable_get('drigg_look_rss_cat_pro','');

        if($all_string || $cat_string){ $rss_links .= '<span class="rss">'; }

        if($all_string){ $rss_links .= l($all_string,"feed/all/$category",array(),NULL,NULL,FALSE,TRUE); }
        if($cat_string){ $rss_links .= l($cat_string,"feed/published/$category",array(),NULL,NULL,FALSE,TRUE); }

        if($all_string || $cat_string){ $rss_links .= '</span>'; }
      }
 

Really sorry, I don't have time to deal with this, probably until next week....

Cheers,

mercmobily’s picture

Hi,

Coolclu3, is it OK if I wait for the final patch?
At that point, Drigg D6 should be finished and (hopefully) tested. So, we can roll out the patch then.

Sounds like a plan?

merc.

coolclu3’s picture

Hi Merc,
Let's make it a plan. I'll update my situation in 1 week's time
Cheers

mercmobily’s picture

Hi,

OK thanks!

Merc.

coolclu3’s picture

Hi Merc,
I'm dead busy trying to meet deadlines and all that, so right now I really don't have enough time to work on this. I'll try my best to hack this when I can get some time free from my projects.
Someone please lend a hand?
Cheers

mercmobily’s picture

Hi,

I am stupidly_ busy with Opensocial.
It's 3:45AM here, and am still working on that.

Coolclu3, I think it's fine if you do it "whenever you can", really. Realistically, you're the bestest person for the patch, and people will just need to wait or offer a bounty.

Plus, Drigg _is_ still in code freeze. So...

Bye,

Merc.

ajayg’s picture

Are you considering #315464: Items in subcategory included on the front page block but not on category page block at all? It was marked as duplicate but the code above seems to address only RSS (This is from a quick glance I haven't actually tried the patch so could be wrong here)

mercmobily’s picture

Hi,

Thanks for checking Ajayg.
Coolclu3, let us know. I am not paying _full_ attention to this issue, since I am immersed full-on into the FriendList/Activities/Opensocial part of Drupal at the moment (which will _obviously_ benefit Drigg... !)

Thanks for helping out right now guys.

Merc.

leeugene’s picture

hey guys,

does the code above work?

leeugene’s picture

yes it does

mercmobily’s picture

Hi,

leeugene, are you able to test the code above and provide a proper patch?
Once you've done that, I will apply to the codebase.

A patch for the 6.x version would be _fantastic_!

Merc.