Flippy is restricted to paging only through the contents of a single content type. However, a content type is not the most granular "set" of content -- it can further be defined by taxonomy.

Flippy can page through content type a, but if content type a is further differentiated by taxonomies x, y, and z, it will not recognize that differentiation.

The request, then is to allow flippy to be configured to page through a subset of a content type, as further defined by taxonomy, i.e.

"Only page through nodes containing content type a and taxonomy x."

"Only page through nodes containing content type a and taxonomy y."

"Only page through nodes containing content type a and taxonomy z."

So, for example, you could page through articles in content type "food" with taxonomy "fish", or content type "food" with taxonomy "low fat". Of course if a node contained both "fish" and "low fat" as taxonomies, they would show up in both configurations.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nravens’s picture

I also think the above feature request would be great. Flippy is a nice simple basic pager and works well but it would be nicer to be able to be able to page through content of specific taxonomy terms.

skizzo’s picture

isn't this issue a duplicate of /node/1464374 ?

ubersoft’s picture

That was a question ("can this be done?") The answer to the question was "no."

So this is a feature request. I created it to formally petition for new functionality.

So while it's the same topic, I don't consider it a duplicate.

Lux Delux’s picture

+1

I am begging for this functionality :)

eaton’s picture

I'm looking into it. One of the big problems at the moment is that the previous alternative to this module (Custom Pager module) uses views as its backend to handle a bunch of crazy argument-driven stuff. I'm tackling the feature list for the upcoming 2.0 release and I'm going to put this in the queue to see how well it can be integrated.

Lux Delux’s picture

Thank you very much for your effort, I'll be happy to provide additional feedback once it needs testing if the integration goes as planned

stevieb’s picture

for sorting through taxonomy or any kind of filter try this module http://drupal.org/project/freepager

joseph11’s picture

You can also try Flippy Improved (http://drupal.org/sandbox/joseph11/1938026) which was made for this purpose.

It's devel version, but grouping by taxonomy should work.

thalemn’s picture

Issue summary: View changes

#8 works perfectly. I would recommend that Flippy Improved be committed to Drupal as a regular module. I really needed the grouping by Taxonomy term feature that FI provides.

Thank you.

xadag’s picture

Hi,

Great sandbox on #8 but flippy module is different now i think, i've founded a way to group by terms based on this sandbox.

Just use the form_node_type_form_alter from the sandbox with only the add of flippy_use_taxonomy and flippy_use_taxonomy_field (be carefull of the weight of your module doing the alteration, it must be greater than the flippy module)

and use the query alter for ->addTag('alter_flippy_query'); from flippy to add the filter for taxonomy field

function mymodule_query_alter_flippy_query_alter(QueryAlterableInterface $query) {
  $node = $query->getMetaData('node');
  if (variable_get('flippy_use_taxonomy_' . $node->type, NULL) &&
    (($taxonomy_reference_field = variable_get('flippy_use_taxonomy_field_' . $node->type, NULL)) !== NULL)) {

    $current_node_term = field_get_items('node', $node, $taxonomy_reference_field);
    if (!empty($current_node_term) && is_array($current_node_term)) {
      $current_node_term = reset($current_node_term);
      $current_node_term = $current_node_term['tid'];
    }
    else {
      $current_node_term = NULL;
    }

    if ($current_node_term != NULL) { // If we have taxonomy term assigned to node, filter by it
      $table_alias = $query->join('field_data_' . $taxonomy_reference_field, 't', 't.entity_id = n.nid');
      $query->condition($taxonomy_reference_field . '_tid', $current_node_term);
    }
  }
}

And you must patch flippy.module to add metadata node

$query->addMetaData('node', $node);

In flippy_build_list

ipitbiz’s picture

Hi,

I have prepared a small modification in the module that allows filtering by taxonomy. I would appreciate any comments.

ipitbiz’s picture

Version: 7.x-1.x-dev » 8.x-1.0-beta1
Status: Active » Needs review
Olafski’s picture

Hi @ipitbiz, thanks for your patch to filter by taxonomy! I could need such a filter setting and have tested the patch. Here are my results:

When I enable a taxonomy in the Flippy settings of a content type, a node with this taxonomy has no pager, which is good!

However, the pager links of the nodes 'before' and 'after' the filtered taxonomy node are still pointing to the taxonomy node. In my opinion, these links should skip the taxonomy node and point to the next non-taxonomy node instead.

Here's an example: In the schema below, the pager link of Node A shouldn't point to the Taxonomy node but to Node B. The pager links of Node B should point to Node A on the left side and Node C on the right side.

Node A | Taxonomy node | Node B | Node C | ...

Additional information: The pager on my test site is sorted by "Title". Don't know if this setting affects the issue.

rli’s picture

Status: Needs review » Needs work
ssantaeugenia’s picture

The patch suggested in comment #11 cannot be applied to 8.x-1.0-beta3 version.
I attached a patch that worked for me.

ssantaeugenia’s picture

Issue summary: View changes
apaderno’s picture

Version: 8.x-1.0-beta3 » 8.x-1.x-dev
chegor’s picture

Status: Needs work » Needs review

Patch #16 works for me. (last dev)

Juc1’s picture

Hi all, did filter content by taxonomy get into 8.x-1.0-beta4 released 14 July 2020 ?

gngn’s picture

Just a quick glance: #15 changes the file modes (i.e. sets the files to writable by the webserver).

yonas.legesse’s picture

After applying patch,all works well. However, a notice is introduced in admin due to an invalid array key. I've added a check to avoid it:

yonas.legesse’s picture

apaderno’s picture

Status: Needs review » Needs work
Anybody’s picture

Status: Needs work » Postponed
Parent issue: » #3308293: [3.x] Add a submodule to use a view as basis for flippy links

This should be solvable most flexible using a view as basis for flippy. Please help to develop a flippy submodule for that. We should stop other custom development here, I think.

Anybody’s picture

Status: Postponed » Closed (won't fix)

I hope we'll be able to solve this with #3308293: [3.x] Add a submodule to use a view as basis for flippy links please help over there! :)