Introduction: Social Networking with Drupal 8
This Tutorial will show how to build social networking websites with Drupal 8 featuring articles, forums, blogs, photos, groups, & user profiles as the main community knowledge sharing tools.
- Problem: Drupal 8 has many social networking apps built into core but how to integrate them into a functional site for business communities or registered users for PaaS/SaaS?
- Solution: Use Panels & Views to create landing pages with dynamic content & build hubs for social network integration with Groups,Blogs, Forums, Articles, Profiles, etc.
- Hint: Manage fine-grained permission on Content Creation for Drupal 8 sites.
Group & Profile are extra modules for Drupal that can be added to a social network where multiple communities, departments, or teams are organized together on an intranet or portal.
Let’s get started.
Step One: Install Required Modules & Dependencies.
This Tutorial will provide the basic patterns & structure for building a social networking site with Drupal 8 core functionality, but requires some additional modules to be installed to the CMS.
Prerequisites: Site administrators will need to minimally add these Drupal 8 modules:
- Adv Agg
- Entity API
Although there are many more options for social networking features that can be added to a Drupal 8 site, these modules will assist with building the basic content management features.
In order to get started building a social network with Drupal 8, make sure to:
- Install the Forum module in Drupal 8 core & configure the Taxonomy categories.
- Create a custom Content Type for Blog posts. Configure Fields & Display settings.
- Add an anchor Image & Thumbnail settings to Article nodes.
- Set the URL path structure for Content-Type nodes using the PathAuto module.
- Create User Roles for Site Administrators, Authors, & Paid Subscriptions.
Search the Drupal section of HostAdvice “How-to” articles in the knowledge base to find more detailed information on these processes.
Install the modules above & enable for use on the site.
Step Two: Create Navigation Menus & PathAuto URLs
Goal: In building a social network, highlight the core content creation capabilities of Drupal 8 with Blogs, Articles, Forums, Groups, Profiles, Search, & Contact in the Navigation Menu.
First: Create a Views page to list all Article posts with a Teaser view or in a custom Table.
Next: Clone the View for Blog posts. Create keyword URLs for the landing pages.
Hint: Use the same format & Thumbnail Image sizes for User Profile pages in Views.
Next: Browse to /admin/structure/menu & edit the Navigation Menu. Create the menu with the following links:
- Blogs:/blogs ---> links to the Views page for all Blog posts.
- Articles:/articles ---> links to the Views page for all Article posts.
- Forum:/forum ---> links to the core Forum display page.
- Groups:/groups ---> links to the Views page for Group listings.
- Profiles: /profiles ---> links to the Views page for all Users.
- Search:/search ---> links to the Advanced Search page.
- Contact:/contact ---> Links to the Drupal 8 Contact form.
Finish: In the next step, we will use Panels to create a Homepage for the social network with Views Blocks of dynamic content from blogs, articles, forums, including a slideshow image.
Step Three: Panels & Views Blocks for Dynamic Content.
First: Navigate to the Views section and add Views Blocks for the Articles, Blog, & Forum post lists created above. Use a 220 px x 220 px thumbnail for the Views Block on content teasers.
Next: Navigate to Panels & create a new Panels page that will be used for the Home Page. Use the three-tiled, stacked layout design and add a slideshow to the top section.
Next: Embed the three views for Article, Blog, & Forum posts underneath the slideshow in Panels layout display boxes. Add the Views Blocks to the Panels regions & publish.
Hint: Put Views Blocks for User Profiles & Groups in the bottom Panels column. You can also place an animated image slideshow in the top section of the Panels page for /index.
Next:Save the Panel with a URL of /index or /home, then navigate to /admin/config/system/site-information to change the global settings.
Finish: Go to Configuration in Basic Site Settings & set the new URL as the homepage.
Step Four: Role Permissions & Registration Settings.
Each Drupal 8 website will have anonymous and authenticated User Roles for the community members with permissions determining what each group can do on the website.
- Review your website’s User Role settings at /admin/people/roles or add a new role.
Hint: Some websites choose to add User Roles for site administrators, content authors, and paid subscriptions. Add any new User Roles required then check the site Permissions.
Note: Drupal site Permissions are very important as they control whether or not registered users can create content, delete content, edit other user’s content, or revert revisions.
Next: Navigate to /admin/people/permissions and review your website’s Permissions for every User Role. Make sure anonymous & registered users do not have any administrative powers.
Next: Make a decision as to which User Roles will be able to create articles, blog posts, forum posts, etc. on the social network & save the Permissions settings. Also, review Filtered HTML.
Recommended Permission Settings for Drupal 8 Social Networks:
- Article, Blog, & Forum Nodes: Grant the powers to: “Create new content, Delete own content, & Edit own content” to registered users only.
- Registered Users:Use users' personal contact forms, Change own username, Cancel own user account, & Post/Edit/View comments.
- Anonymous Users: Use search, Use the site-wide contact form, & View comments.
Summary: On this social network, registered users will be able to create, edit, & delete their own content, which includes Blog, Articles, & Forum content types.
Finish: Confirm the Permissions for registered & anonymous users for Groups & Profiles.
Step Five: Review User Profile & Group Configuration.
The Profile module allows for expanded fields to be created for the user registration page. The Group module allows community members to collaborate around themes on a Drupal 8 site.
Next: For this social network, we create different Group Types based on categories, such as programming, systems administration, & web development, but any organization is possible.
Next: After creating the Group Types, we add different Groups within each container, ie.e PHP, Python, & Perl groups are listed inside the “Programming” Group Type.
Hint: Go to Views and build a page that lists the different Group Types and Group listings in a nested Table display. Create a keyword URL for the page like /groups and add to the menu.
Next: At /admin/config/people/profiles you can add new Profile types. After this, Drupal 8 administrators will be able to create custom CCK Fields to attach to User Profile pages.
Finish: Use the Profile module to create fields to collect the user name, address, & telephone number on registration if required, along with interests, hobbies, resumes, etc.
Conclusion: Advanced Drupal 8 Social Networking Sites.
While this site outline & quick tutorial is enough to get started with a social networking website using Drupal 8, there are a vast number of third-party modules that can be added to the installation codebase to include new features & functionality for user communities online.
Check out these top 3 Drupal hosting services: