Truncated text, "more", and URL alias not working

44 views
Skip to first unread message

Mark Cyzyk

unread,
Aug 1, 2024, 9:18:04 AM8/1/24
to islandora

All,

I'm running into an issue with long text fields (Description, Abstract):

Their value is set to be truncated in the View, and the word "more" inserted.  "more" provides a link to the full text.

In the View, the URL Alias for this is:

node/{{ nid }}

BUT {{ nid }} is not being appended to the URL -- you just get a url like: 

https://ourserver/node   <-- not /node/{{ nid }}

I should mention, our Drupal version is 10.2.7.  PHP version 8.3.8

Any idea how to remedy?!

Mark

-- 
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Mark Cyzyk, M.A., M.L.S.
Library Applications Group
The Sheridan Libraries
The Johns Hopkins University
mcy...@jhu.edu

Verba volant, scripta manent. 

Mark Cyzyk

unread,
Aug 2, 2024, 9:13:33 AM8/2/24
to islandora
More:

This tutorial, for Drupal 7 (https://www.templatemonster.com/help/drupal-7-x-how-to-add-a-read-more-link-to-view-nodes.html), indicates that the syntax for addressing a NID is:

   /node/[nid]

not:

   /node/{{ nid }}

Neither work.

Mark

Rosie Le Faive

unread,
Aug 2, 2024, 11:22:51 AM8/2/24
to islandora
It sounds like you might need to put the node ID field ("ID" in Category: Content) in your view, and re-order it so that it comes before the description/abstract. You can set the ID field to not display. 

Only fields that come before the current field in Views (even if they're not displayed) are available as replacement tokens.

Mark Cyzyk

unread,
Aug 2, 2024, 2:13:15 PM8/2/24
to islandora
Thanks, Rosie!

That worked.

For the record:  Drupal 7 NID is now, simply, ID.  See:


I added that field:

snapshot1.png

And made sure it was arranged above my Description and Abstract fields in the View.

All working!

Mark
Reply all
Reply to author
Forward
0 new messages