Creating a Social Network Site with Drupal 8

Creating a Social Network Site with Drupal 8

Social networking websites are all very popular. From Facebook to Twitter to Instagram, people seemed to be hooked onto these platforms.

Many people think of Drupal as a system that can only create websites and ecommerce stores. But few realize that Drupal 8 can also be used to build a fully-functioning social network website.

In this article, learn how to integrate different social networking apps available in the Core to build a functioning site. You’ll be using the Panels and Views to craete dynamic content. Then create hubs and integrate them with Groups, Blogs, Profiles, and Forums. You’d also have to set permissions for every user or groups of users.

With that said, let’s get started.

Install the Modules and Dependencies

The first prerequisite to building a social network website in Drupal 8 is to install the required modules and their necessary dependencies to the core functionality.

Here are the prerequisite for building the social networking site with Drupal 8:
  • Panels
  • cTools
  • PathAuto
  • Group
  • Adv Agg
  • MetaTag
  • Entity API
  • Profile
There are many other modules you can download and use. But these should be sufficient to include basic functionalities.

To get things rolling, take care of the following:
  • Install the Forum module and configure Taxonomy categories
  • For releasing blog posts, use a custom Content Type. You can also create a new one by configuring Fields & Display settings
  • Add the Image &Thumbnail settings to each Article node
  • Install the PathAuto module to set URL path structures for Content-type nodes
  • Define and create User Roles for admins (Site Administrators), authors (Authors), and others (like Paid Subscriptions)
Before moving ahead, make sure you’ve installed all the required modules correctly.
  • Create Navigation Menus & PathAuto URLs
Next, you need to create navigation menus by using the Blog, Forums, Search and other modules. And then create PathAuto URLs for access.

To start, you have to create a Views page with a Teaser view. You’ll be using it for listing the Article posts. If not in the Teaser view, you can create a separate custom Table instead.

Now, you need to clone the View for Blog posts. Then, create the keyword URLs to be used for the landing pages.

For User Profile pages inside Views, you should retain the format and Thumbnail Image size.

Next, start editing the Navigation Menu by navigating into /admin/structure/menu and creating menu with the links just like the following:
  • Home -<front>
  • Blogs - /blogs
  • Articles - /articles
  • Forum - /forum
  • Groups - /groups
  • Profiles - /profiles
  • Search - /search
  • Contact - /contact
The links should lead to the Views page with the respective content type. So /blogs should lead to the Views page that displays all Blog posts.
  • Set up Panels & Views Blocks for Dynamic Content
Next, you need to work on Panels and Views module and create Blocks. This would allow you to display dynamic content to the users.

So go into the Views section once again and start adding the Views Blocks for Blog, Forum, and Articles post lists that you have already created. For the thumbnails on Views Blocks, you should opt for 200px X 200 px size.

Next, navigate to Panels and create a new page. This will be added to the Home Page. Use the layout design of your choice and then add the slideshow to the top section.

Then underneat the slideshow in the layout display boxes, start embedding the Article, Forum, Blog and other type of posts. Then, add the Views Blocks to the Panels region.

Now, it’s time for User Profiles and Groups. At the bottom of the Panels column, place the Views Blocks for User Profiles & Groups. It’s also possible to add an animated slideshow in the top section of Panels page for /index. So do accordingly if you want the animation.

Lastly, you need to save the Panels and set URLs of either /index or /home. To cap everything off, navigate into Basic Site Settings and then Configuration to set the above URL as the website’s homepage.
  • Permissions and Registration Settings
Setting permissions for the users is important for managing the social media networking site. Your website will have anonymous and authenticated User Roles for your members. Their permissions would determine what actions they can and cannot perform on the website.

First, navigate into /admin/people/roles and start reviewing the pre-defined User Role settings. You can also create a new role if you want.

Add User Roles for site admins, moderators, authors, paid subcribers, and others.

To set permissions for different User Roles, navigate into /admin/people/permissions. Review the permission set and make changes if necessary. You should be really careful and specific about what permissions you grant and deny. Registered users and anonymous users shouldn’t have any admin powers.

Here are the permission settings we recommend:
  • Registered Users - Use users’ personal contact forms, Change own username, Cancel own user account, Post/Edit/View comments
  • Anonymous Users - Make search, Use the site-wide contact form, View Comments
  • Article, Blog, and Forum Nodes - Create new content, Delete own content, Edit own content
The above aren’t a strict rule and you should set permissions as per your preference.
  • Review the User Profile & Group Configuration
The next two modules you need to work on are Prole and Group. With the Group module, you can create different Group Types based on which category users belong to. For example, the categories could be system admins, coders, and web developers. But you can create any organization as per your preference.

Once you’ve created the Group Types, add different Groups within each container. For example, you can have Python, Django, PHP groups under the “Coders” Group Type.

Navigate to Views and create a page displaying -- in a nested Table display -- the different Group Types and Group listings.

You can add new Profile types by going into /admin/config/people. Then the admins can specify custom CCK Fields and attach to User Profile pages.

The Profile module also allows you to create forms where you can request the name, email address, and phone numbers of the users who want to register on your website. You can also include fields like hobbies, interest, and work experience.

So that’s how you go about creating a social network website in Drupal 8. For further assistance get in touch with your hosting support team.
Author
kumkumsharma
Views
2,701
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top