Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Oddly enough thinking about this right now it could be a little tricky. You have two possible solutions off the top of my head.</p> <p>1 - Create a new view of item type <em>Node</em>. Your row style will obviously be set to <em>Fields</em>. Under which <strong>Fields</strong> to pull select the <em>User</em> group and then tick off the <em>User: Name</em> checkbox. Set your <strong>Items to display</strong> setting to <em>0</em> for unlimited results.</p> <p>Under the preview you should get a ton of results looking something like:</p> <p><em>Name: John Doe</em></p> <p><em>Name: Mary Jane</em></p> <p><em>Name: John Doe</em></p> <p><em>Name: Anonymous</em></p> <p>What you're seeing is the authors of <strong>all</strong> the nodes posted in your system. There will be duplication because a user in your system could be the author of multiple nodes. Unfortunately you can't just tick off the <strong>Distinct:</strong> <em>Yes</em> option because this only applies to nodes and not the users. </p> <p>How to deal with the duplicate user name results tho? Custom theme your view by creating a custom template under <strong>Theme: information</strong>. Inside the template write some PHP code which intercepts the row results from the View query before it renders and only render distinct user names from the results. You'd have to write the logic though to determine whether a user name has already been added. </p> <p>As simple as creating a new custom array, adding each row result (user name) to array but first checking to see whether it already exists in your custom array - if it does then toss it and move on to the next user name. At the end you'll have an array filled with distinct user names who have posted on your site.</p> <p>voila! It works. It's not elegant but it definitely will work if built this way.</p> <p>2 - Alternatively maybe you can get this module working to accomplish the same thing in a less complicated manner: <a href="http://drupal.org/project/views_customfield" rel="nofollow">http://drupal.org/project/views_customfield</a> but I have never used it so I cannot comment on it.</p> <p>Good luck. Hope that helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload