Score:0

Is there any possibility to capture an array with all nid of a view?

mx flag

I tried using hooks but in $view->result variable I only get nodes from the actual page (10 nodes because pager size is 10). My view has multiple exposed filters so I want the resulting nodes from filtering

function mymodule_views_pre_view(&$view, &$display_id, &$args){

if ($view->id() == 'myview') {

    foreach ($view->result as $row) {
        // Get the full name value.
        $nid = $row->nid;
        // check the result output for testing only.
        \Drupal::messenger()->addMessage($nid);
    }

My ultimate goal is to create a link in that view with concatenated nid argument. Is it possible?

No Sssweat avatar
ua flag
Curious to know why? What's the purpose of creating such concatinated link?
aljico avatar
mx flag
I want to create a link to a custom controller in that view: http://example.com/pdf-printer?nodes=1+2+3+4+5+6+7+8+9+10+11+12
in flag
What about creating an additional display in the same view, which is not paginated?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.