• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Introduction to Drupal 7 - Blocks management and contexts
 

Introduction to Drupal 7 - Blocks management and contexts

on

  • 5,065 views

Blocks management in Drupal 7. Visibility settings by pages, content type and roles. Going one level up on blocks management using the Context module.

Blocks management in Drupal 7. Visibility settings by pages, content type and roles. Going one level up on blocks management using the Context module.

Statistics

Views

Total Views
5,065
Views on SlideShare
4,845
Embed Views
220

Actions

Likes
1
Downloads
54
Comments
0

21 Embeds 220

http://shtrak.eu 136
http://besa1.drupalstaging01.lablateral.com 24
http://trstaffing.drupalstaging01.lablateral.com 10
http://core.production01.lablateral.com 9
http://blog.drupalization.net 9
http://www.besa.org.uk 7
http://sav.drupalstaging01.lablateral.com 5
http://localhost 4
http://storematesdrupal.drupalstaging01.lablateral.com 2
http://www.trsstaffing.com 2
http://www.online-valuations.com 2
http://ewrailtemp.lablateral.com 1
http://notemp.studyacrossthepond.com 1
http://ad-techlondon.co.uk 1
http://adtech.drupalstaging01.lablateral.com 1
http://webcache.googleusercontent.com 1
http://studyacrossthepond.com 1
http://translate.googleusercontent.com 1
http://www.sav-systems.com 1
http://satp.drupalstaging01.lablateral.com 1
http://no.studyacrossthepond.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Introduction to Drupal 7 - Blocks management and contexts Introduction to Drupal 7 - Blocks management and contexts Presentation Transcript

    • Introduction to Drupal 7 Session 5.2 Blocks managementDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 1
    • Agenda• Drupal blocks• Regions• Managing blocks the easy and quick way• Managing blocks in contexts• Case study – arranging your website blocksDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 2
    • Drupal blocks• A block is a generic term that is applied to any self-contained piece of content, menu, or code.• They can be: – System blocks: login block, search block, etc – Modules blocks: latest news block, slideshow – Custom blocks – Programmatically build blocks (with coding)Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 3
    • Regions• In order to place a block into a given place, you need to have a region for this• Regions depend on the theme you’re using• To check your theme regions, go to admin/structure/block and click on the Demonstrate block regionsDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 4
    • Default Bartik theme regionsDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 5
    • Managing blocks• Managing blocks with the handles• Using the drop-down optionsDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 6
    • Managing blocks• From the contextual links in the front-end• Then edit the block from the back screenDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 7
    • Blocks tips and tricks• Removing block title – The <none> short codeDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 8
    • Blocks with configurations options• Some blocks have configurations – Menu blocks have list links and edit menu – Views block have views configurationsDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 9
    • Blocks visibility settings by Pages• You can set whether the block will appear – only a given set of pages – or on any pages, except a given set of pages• You can use <front> short code to target the home page• We want the slideshow to be visible only on the home page for exampleDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 10
    • Blocks visibility by content types• You can set instructions for a block to appear only when a given content type is seen• In our case we don’t use this option, but you can use it when for example you want to show a relevant articles block only on news articlesDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 11
    • Blocks visibility by roles• You can also set a given block to be visible for a specific user roles only• You can use this option for example to display a content management menu only for the Office Assistant user role• Or you can use this settings to show content for Premium (Paying) users only, etcDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 12
    • Blocks visibility by users• Very rarely used option• It’s better to define the necessary blocks with your client preliminary and set the blocks for them• Blocks management in the end is a pretty complex logic for a regular userDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 13
    • Blocks management with Context• Another way to manage blocks is with the Context module• Advantages – Contexts can be compiled in features – Contexts can be re-arranged with drag and drop from administrators with the Admin module – Cleaner way to manage blocks – Clean categorization possible – More options than the default blocks management capabilities• A bit not so advantages – You have to know what’re doing with a bit of though beforehand, or you’re re-make contexts all the time – If you have more than 1 block in 1 region, separated in different contexts, you don’t have control on the order of display of the blocksDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 14
    • Enabling Context and Admin modules• Enable the Context core module• Enable also the Context UI module to be able to configure contexts with user interface• Enable the Admin module to be able to edit contexts with and inspector and drag and drop• Go to admin/config/user-interface/admin to place the Admin options on the bottom right (because we have the Administration toolbar enabled on the top)Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 15
    • Let’s create some contexts• We want the slideshow to be displayed on the home page only• Go to admin/structure/context and click the “Add” link to create a new context• Place slideshow_homepage for a name of the context, always make it machine readable• Place a tag Home page for better categorization• Select a Path condition and add <front> in the field so that the context is valid for the home page only• From the Reactions, place the slideshow views block in the Features region, as we have it nowDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 16
    • Homepage slideshow context You can now switch off the block from the blocks management screenDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 17
    • Create a feature for your work• Taking only the newly created context for the home page with the block should be enoughDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 18
    • Time for questionsDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 19
    • ContactsKalin Chernev – E: kalata@shtrak.eu – T: twitter.com/kalinchernev – U: http://shtrak.eu/kalataDrupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 20