Controlling Block Display

Author's note: the Context section of this page would benefit from screenshots. During the presentation, I was able to demo the options, but obviously that doesn't work as well with static docs. I'll add them myself in time, unless someone beats me to it. End Note

Blocks and Menus

Every time you create a menu, a corresponding block is created that displays that menu.

You can also create custom blocks at admin/structure/block/add.

Now that we have these blocks, we need to display them.

The two commonly used methods of controlling block display are the core block display functionality, or the contributed Context module. Both means achieve the same goal; the context module provides more flexibility.

Core Block display

The core block visibility settings can be accessed at admin/structure/block.

To display a block in a region, use the drop down menu for the block you want to show:

In addition to setting the region for a block, you can also set additional features by using the "configure" link visible in the above screenshot.

Tracking Interactions

The final step here is to allow people to see the interactions that are occurring in the site.

To do this, we will modify a view that already exists at admin/structure/views

Scroll to the bottom of the page, and find the Tracker view. Clone this view, as shown in the screenshot below.

Browsing Posts, Part 2: Blogs for Individuals

Now that we have created our view of all blog posts, we need to add a display to only show the posts of individual users.

To accomplish this, we will use our pre-existing view as a base, and add a display. For this use case, we want to add a "Page" display.

In these instructions, we are using two advanced features within views: Relationships and Contextual Filters. This functionality is at the heart of many complex views, and the principles we introduce here can be used in many different situations.

Add new page display

Next, rename the display. This will make it easier to manage your displays over time.

Rename your display

Then, expand the Advanced options and choose to add a new Relationship.

You will want to select the Content: Author relationship; this will let us access the username of the people who have created content.

Browsing Posts, Part 1: All Posts

Before we can set up the first view that allows us to see all blog posts on the site, we will need to configure the permissions for the Views module. The Views module has two permissions - Administer views and Bypass views access control ; they can be set at admin/people/permissions#module-views.

These permissions should only be given to very trusted users who have been trained on how to set up views.

Finding Posts Once They Have Been Created

Once people can create blogs, they will need to be able to find them.

More specifically, people will generally want to see, at minimum:

  • Their own posts;
  • Other people's posts;
  • Comments on their posts/other posts where they have left a comment;

This is an abbreviated list, but we'll use it as the starting point to look at how and why we create different user interfaces for different purposes.

Post-installation Tweaks and Adjustments

After you have first installed Drupal, there are a few adjustments that you will make on most sites:

  • Add your primary administrative user - admin/people/create

    The first user account that you created during the install should only be used for site upgrades, and/or an emergency. Create an administrative account for daily work within the site.


Subscribe with RSS Subscribe to RSS - presentations