2

I'm just getting to know Drupal. I've been manually recreating current Drupal 7 Views from a production installation into a new development install of Drupal 8.85. I've run into some differences between Drupal 7 and Drupal 8, as you might imagine.

In Drupal 7, many views are using Content: Nid (for the node ID), which doesn't exist in Drupal 8. I've read here and elsewhere it has been replaced by Content: ID, in Drupal 8.

That said, the dialog boxes for each look different when it comes to setting options and parameters. For example, Content: Nid has an option/checkbox for Link this field to the original piece of content. Content: ID doesn't have that option, as I can see.

Additionally, the Content:ID dialog has options not seen in the Content: Nid dialog, such as the options for Formatter, Thousand marker, and Display prefix and suffix.

Is Content: ID really the Drupal 8 equivalent of Content: Nid? Where are the options missing in Content: ID?

1

Is Content: ID really the Drupal 8 equivalent of Content: Nid?

Yes

Additionally, the Content:ID dialog has options not seen in the Content: Nid dialog, such as the options for Formatter, Thousand marker, and Display prefix and suffix.

Thousand marker makes sense. The other two not so much, bug maybe?

In Drupal 7, many views are using Content: Nid (for the node ID), which doesn't exist in Drupal 8. I've read here and elsewhere it has been replaced by Content: ID, in Drupal 8.

I could see them thinking when developing the D8 version, who links to a Node/Entity using the ID? Using something descriptive like a Title, or "view/edit/delete" text makes a ton more sense, don't really need this feature for ID. Plus having to hover over single digits is not user friendly.

But, if you still want to link using the ID

  • Add the ID field and checkmark hide from display.

Then either add field:

  • Link to content OR Link to edit content

    Under rewrite results:

    • Checkmark override the output of this field with custom text

Example:

enter image description here

| improve this answer | |
  • "But, if you still want to link using the ID" I should have clarified about this. I don't want or need to link. I was just using that as an example of the difference(s) in options presented between the D7 Nid and D8 ID dialogue boxes. So, just wanted to be sure that Nid and ID were, in fact, functional equivalents. – Heyitsrick Apr 16 at 12:38
  • 1
    'nid' is the entity id; 'vid' is the entity revision. Both are defined in the Node entity annotation. Node inherits (eventually) from ContentEntityBase, which sets up 'id' and 'revision' as 'integer' base fields, hence they use the Numeric formatter. So, that is where the thousands, prefix, and suffix come from when you add the field in a view. – mpdonadio Apr 19 at 23:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.