Problem/Motivation

There is no way to use Node View Count as an extra/pseudo field.

Proposed resolution

Addition of 3 extra/pseudo fields using hook_entity_extra_field_info().
Each field covers the following scenario (as provided by arguments combination in NodeViewCountRecordsManager::getNodeViewsCount()):

  • node_view_count_total: Total node views count
  • node_view_count_unique: Unique (per user) node views count)
  • node_view_count_total_for_user: Total node views count for current user

User interface changes

An extra/pesudo field will be added to Node displays.

API changes

None

Data model changes

None

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

martinpe created an issue. See original summary.

martinpe’s picture

StatusFileSize
new1.35 KB

Patch with new feature added

stefanos.petrakis made their first commit to this issue’s fork.

stefanos.petrakis’s picture

Patch worked fine, thank you; still was missing caching, added that in the PR.

stefanos.petrakis’s picture

Hi-jacked this issue a bit and added the following (currently in the PR):

  1. Caching tags and invalidation
  2. 3 pseudo-fields instead of one; each pseudo-field matches one of the 3 possible combinations total/unique/total-for-current-user
stefanos.petrakis’s picture

Issue summary: View changes