Drupal view all comments on new page
To create a new page in Drupal that displays all comments, you can follow these steps:
Step 1: Create a new view
- Go to the Views module page at
admin/structure/views
. - Click on the "Add new view" button.
- Enter a name and description for your view, and select "Comments" as the view type.
- Click "Save and edit" to create the view.
Step 2: Configure the view
- In the "Fields" section, add the "Comment" field to the view.
- In the "Filters" section, add a filter for "Comment type" and select "All comments".
- In the "Sort criteria" section, add a sort criterion for "Comment created" and select "Descending" to sort the comments by date.
- Click "Save" to save the view configuration.
Step 3: Create a new page for the view
- Go to the "Pages" section at
admin/structure/views/page
. - Click on the "Add new page" button.
- Enter a title and path for the page (e.g., "All Comments").
- Select the view you created in Step 1 as the view to display on this page.
- Click "Save" to create the page.
Step 4: Configure the page
- Go to the "Display settings" section at
admin/structure/views/page/{page_path}/display
. - Select the "Full content" display type.
- In the "Fields" section, add the "Comment" field to the display.
- In the "Filters" section, add a filter for "Comment type" and select "All comments".
- Click "Save" to save the display settings.
Step 5: Test the page
- Go to the page you created (e.g.,
example.com/all-comments
). - You should see a list of all comments on the page.
That's it! You should now have a new page in Drupal that displays all comments.