Problem/Motivation

It would be great if there is an ability to promote a reference by marking it as sticky. Useful for highlighting and weightage.

Proposed resolution

Since, it would be tedious to add a boolean field (field_is_sticky) to every reference type, therefore it would be better if this is added as a property - similar to what node does.

Remaining tasks

N/A

User interface changes

There will be a new field called Sticky at top of lists while adding a reference.

API changes

For checking if a reference is sticky:

  /**
   * Returns the reference sticky status.
   *
   * @return bool
   *   TRUE if the reference is sticky.
   */
  public function isSticky();

For marking/unmarking a referece as sticky:

  /**
   * Sets the reference sticky status.
   *
   * @param bool $sticky
   *   TRUE to set this reference to sticky, FALSE to set it to not sticky.
   *
   * @return \Drupal\bibcite_entity\Entity\ReferenceInterface
   *   The called reference entity.
   */
  public function setSticky($sticky);

Data model changes

There will be a new column in bibcite_reference table called sticky.

Release notes snippet

N/A

CommentFileSizeAuthor
#2 3027750-2.patch4.01 KBsubhojit777

Comments

subhojit777 created an issue. See original summary.

subhojit777’s picture

Status: Active » Needs review
StatusFileSize
new4.01 KB
antongp’s picture

Status: Needs review » Closed (won't fix)

Hello @subhojit777.

Thank you for your issue and attached patch. There is similar issue #2934158: Add "Promoted" to the Reference entity which is postponed for now - I believe requested "Promoted" property within that issue is supposed to behave like "Sticky" actually. Anyway, I don't think that "Sticky" should be added to Reference entity type. But "Published" is planned to be added, probably within beta1.

Also, Field tools module may be helpful in adding one field to many bundles at the same time, to add field_is_sticky, for example, in not so tedious way.

Thanks!