CodeKarate

CodeKarate

Description

Codekarate will help you become a Drupal Ninja.

Link: codekarate.com/posts

Episodes

Gatsby and Drupal Sitting in a Tree - Presentation

Apr 9, 2019

Description:

Here is a recording of a presentation I did at a local JamStack Boston meetup. This provides a good high level overview of how to use Gatsby with Drupal as a backend content source.

Some resources from the presentation:

Type: VideoTags: DrupalDrupal 8Drupal PlanetJavascript

Drupal 8 Rabbit Hole Module

Dec 4, 2018

Description:

Episode Number: 221

The Drupal 8 Rabbit Hole Module allows you to control what happens when someone views an entity page. Before you ask why this might be important, let me clarify, it's not a layout tool. It's a simple module that allows you to easily redirect or prevent users from viewing specific types on entities on your site.

Tags: DrupalContribDrupal 8Site BuildingDrupal Planet

Drupal 8 FlexSlider Module

Nov 20, 2018

Description:

Episode Number: 220

The Drupal 8 Flex Slider Module allows you to use the Flex Slider library to build out slideshows on your Drupal website. This video covers how to get Flexslider to integrate with Drupal views as well as Drupal fields.

Tags: DrupalContribViewsDrupal 8Image HandlingMediaSite BuildingDrupal Planet

Drupal 8 Configuration Read-only Module

Nov 19, 2018

Description:

Episode Number: 219

The Drupal 8 Configuration Read-only module allows you to lock down some of your environments to prevent users from making configuration changes. This lets you use the Drupal 8 configuration management system to push up all your changes, while preventing you from changing any settings, content types, views, or any other configuration on your production website.

Tags: DevOpsDrupalContribDrupal 8Drupal PlanetDeployment

Drupal 8 Editor Advanced Link Module

Nov 13, 2018

Description:

Episode Number: 218

The Drupal 8 Editor Advanced Link Module allows you to specify additional attributes when creating links in your content. This makes it easy to add a CSS class, an ID, open the link in a new window, or even specify a rel="nofollow" tag. The module is very easy to use, but there is a small trick to getting it set up. Watch the video to see how it's done and start customizing your links in no time!

Tags: DrupalContribDrupal 8Site BuildingDrupal Planet

Drupal 8 Editor File Upload Module

Nov 12, 2018

Description:

Episode Number: 217

The Drupal 8 Editor File Upload Module is a great module for allowing your content editors to upload files directly in your website content. If you have ever needed to upload a file, and then include a link to that file, then the Editor File Upload module will be useful. Rather than having to upload the file manually using FTP or through another module, then having to go back to create a link in your content to that file, this module lets you do it all in one step.

Tags: DrupalContribDrupal 8File ManagementSite BuildingDrupal Planet

Drupal 8 Image Widget Crop Module

Nov 10, 2018

Description:

Episode Number: 216

The Drupal 8 Image Widget Crop Module is a handy module for allowing your content editors on your website to crop images after they upload them. Have you ever uploaded an image on a website and had it automatically crop the image for you in a way that just looks wrong? This module solves that problem!

Tags: DrupalContribDrupal 8Image HandlingSite BuildingDrupal Planet

Drupal 8 Contact Storage Export Module

Nov 9, 2018

Description:

Episode Number: 215

In this episode, we cover the Drupal 8 Contact Storage Export Module. This episode covers a module that adds additional functionality to the Contact Storage Module (which we covered in episode 213). This module allows you to export your contact form submissions to a CSV file. It's a simple module that serves a very specific purpose. If you need to export your contact form submissions, this is how you do it!

Tags: DrupalContribDrupal 8Site BuildingDrupal Planet

Drupal 8 Linkit Module

Oct 31, 2018

Description:

Episode Number: 214

In this episode, we cover the Drupal 8 Linkit Module. This module extends the link functionality of your Drupal 8 WYSIWYG editor (like CKeditor) to make it easier to link to other pages on your website. Rather than having to go find a page on your website you would like to link to, copy the URL, and paste it in the link field, this module allows you to do it in one step!

Check out the Code Karate Patreon page

Tags: DrupalContribDrupal 8Site BuildingDrupal Planet

Drupal 8 Contact Storage Module

Oct 30, 2018

Description:

Episode Number: 213

In this episode, we cover the Drupal 8 Contact Storage Module. This module extends the Drupal 8 core contact module by saving the contact entries in the database. This makes it easy to go back and view, edit, or delete any of the contact form submissions on your Drupal 8 site. It's a handy little module that can save you from needing to install a more fully featured form module (like Webform or Entity Forms).

Check out the Code Karate Patreon page

Tags: DrupalCore ConceptsContribDrupal 8Site BuildingDrupal Planet

How to Install Drupal 8 Modules

Oct 29, 2018

Description:

Episode Number: 212

In this episode, we will cover five different ways to download and install modules in Drupal 8. Yes, that’s right, FIVE different ways! If you are just getting started with Drupal or are transitioning from Drupal 7 to Drupal 8, this is a great place to start. Once you understand all the ways to download and install modules, you can make the decision on which option works best for you.

Check out the Code Karate Patreon page

Tags: DevOpsDrupalDrupal 8Drupal BasicsDrushDrupal Planet

An Intro to Lando with Drupal 8

Oct 28, 2018

Description:

Episode Number: 211

Lando is what the cool kids are using for their local development environments these days. In this episode, I give you a quick introduction to Lando and show you how it can be used to create a Drupal 8 site in less than a minute. I also show you how you can integrate Lando into your workflow if you are hosting your websites on Pantheon.

Are you using or have you tried using Lando yet? What are your thoughts?

Check out the Code Karate Patreon page

Tags: DevOpsDrupalDrupal 8Drupal Planet

Code Karate is Back and Ready for Drupal 8

Oct 25, 2018

Description:

Episode Number: 210

I know it's been awhile since I last posted, but I think we are all ready for some Drupal 8 videos! Let me know in the comments what you want to see posted in the future.

Check out the Code Karate Patreon page

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we are on episode #210. Wow, it's been over three years since I last posted a video, and a lot of things have changed over the last three years, but a lot of things have stayed the same too... after all, you can still follow me on Twitter at smthomas3.

So I'm going to keep this episode short and sweet, but I do have some big news. I'm going to start posting Drupal 8 content, a lot of it. I've been stuck in the Drupal 7 world for a long time, and I just really haven't got the time to put out any new Drupal 8 content. But that's all going to change. So I am going to start posting Drupal 8 content on an almost daily basis going forward. I'm really going to keep doing it until I run out of things to say, and I do have a tendency to ramble on... so we might be here awhile.

So the next big announcement is that everything on CodeKarate.com going forward, and all the stuff I did in the past is all going to be free. Yep, you heard it here first! Just head on over to CodeKarate.com, enter your email, and you will get access to all my ebooks, all the stuff you used to have to pay for. Really I just got to the point where I didn't want to have to save my "best stuff" behind a paywall. I thought it would be better to just post all my best stuff on YouTube and on my website for free. Now what I am asking is if you do find value in what I am posting, head on over to my Patreon page. If you can afford a few dollars a month, it's going to help me to keep posting more and more of this Drupal 8 content. We all know when you get started with Drupal, it can be a little bit intimidating, it can be a lot to learn.

The goal here with Code Karate and the Daily Dose of Drupal is to put out as much Drupal 8 content as possible and try to organize it in a way that someone just getting started with Drupal can understand. So the goal is to keep it free, if you do find value please head over to the Patreon page and maybe just throw in a couple dollars a month, that would be awesome. Also, if you do that, there is a chance you can get a sticker, you can get your own Code Karate t-shirt, and some other cool things for helping me out that you can get by heading over to the Patreon page.

So with this first video, I wanted to mention those few things, but I also wanted to get the discussion going. What are you struggling with in Drupal 8. What's the content or videos that you want to see produced. The goal here is that I'm going to start with doing what I have done a lot in the past which is post videos on Modules and how to use them. But I also want to get into more in-depth topics such as Module development, site building, configuration management, building out Drupal API's to use with either Javascript frameworks or mobile apps, theme building, theme development, any of those types of difficult and in-depth concepts I want to get into that first. I am going to start with the modules and then lead into some of that.

But if you have things with you are struggling with or you would like to see, let me know and hopefuly I can get some feedback from everyone then prioritize what the community in general is really having trouble with. Thanks for checking out Code Karate, thanks for watching this video, and go ahead and buckle your seatbelt because Code Karate is back. We'll see you next time.

Tags: DrupalDrupal 8Drupal PlanetGeneral Discussion

Create Secret URLs with Drupal 7 Token Content Access

Jul 16, 2015

Description:

Episode Number: 209

Have you ever wanted to create a page on your Drupal 7 website and send it over to a friend or group of people… but you don’t want the general public to see it? You could always set it up so they just log in, but that’s an extra step and not all of the people you want to send this to have user accounts on your site.

Tags: DrupalDrupal 7Site BuildingDrupal Planet

Drupal Tutorial: Getting Started with Drupal 7

Jun 24, 2015

Description:

If you are just getting started with Drupal and are looking for some help on learning Drupal 7. You have come to the right place.

Type: TextTags: DrupalDrupal 7Drupal BasicsDrupal Planet

Drush: Getting started with Drush in Drupal

Jun 19, 2015

Description:

Drush... what a wonderful web you weave. My guess is you have probably heard about this mysterious thing known as "Drush" and are looking to find out:

What exactly is Drush? Is Drush something that will be useful for me?

The first one is an easy one. Drush is short for Drupal Shell and is a command line tool that makes interacting with your Drupal website a breeze.

Type: TextTags: DrupalDrupal 7DrushDrupal PlanetSystem Administration

How to A/B test your Drupal Site

Jun 14, 2015

Description:

Episode Number: 208

Are you testing your site? Until recently, we weren’t and it was costing us. Every element on your website should have a meaning and if you aren’t testing it against something else how can you be sure that you are maximizing your results!

Tags: DrupalDrupal 7Site BuildingDrupal PlanetTips and TricksUI/DesignJavascript

The Ultimate Drupal Site Builder's Toolkit and the #IslandOfDrupal Test

Jun 7, 2015

Description:

What if you had to go build a Drupal site on a remote island without WiFI? Yes that's right, no internet connection at all? What modules would you bring with you?

Type: TextTags: DrupalEntity ReferencePanelsRulesViewsDrupal 7Site BuildingDrupal Planet

Master your Drupal Sub Theme

May 30, 2015

Description:

Awhile back I posted a video on setting up a Drupal sub-theme. If you want, you can check out that video here. I think that the video does an alright job of explaining the steps you have to take to get a sub-theme to work properly. I don't however think it provides enough of the setting up a sub-theme "meat" needed to begin. The saying goes, the devil is in the details. Personally, I never liked that quote, but it is fitting here.

Type: TextTags: DrupalCore ConceptsDrupal 7File ManagementTheme DevelopmentDrupal Planet

Automatically Hide Content in Views Based on Date

May 21, 2015

Description:

Normally, I would do this video style, but I'm a wildcard people and today we write! Thanks to one of our Code Karate supporters, Pieter, I am going to walk you through how to use Drupal views, date and content types to automatically hide/show nodes based on date field. Let's get started.

Type: TextTags: CCKViewsDrupal 7Site BuildingDrupal Planet

Using Jquery Isotope to Display Content in Views, It’s Fancy.

May 10, 2015

Description:

Episode Number: 207

Taking a content type and displaying it in a Drupal View is core to any Drupal website. If you are new to views, you can check out our Drupal views video. As you venture into views you will learn hundreds of ways to manipulate content to change the way the end user is able to interact with the content. To help enhance this, you can use the Views Isotope module. This module uses the jQuery isotope library to dynamically filter views content. As the title states, it’s pretty fancy.

Tags: DrupalContent TypesViewsDrupal 7Site BuildingDrupal PlanetJavascriptJQuery

Mobile friendly navigation using the Mmenu Module

May 1, 2015

Description:

Episode Number: 206

As a request from David over at luxor.me, we checked out the Mmenu module. This little gem allows you to use various javascript libraries to create a mobile friendly navigation. The navigation it produces is similar to the slide in menus you find side a lot of mobile applications.

Tags: DrupalBlocksDrupal 7Site BuildingDrupal Planet

More control over your Drupal Admin menu with Administration Menu Source

May 1, 2015

Description:

Episode Number: 205

Sometimes you have a situations where your normal Drupal administration menu just won’t cut it. Maybe you have someone that needs to perform some administrative tasks on your site such as managing content and comments, or perhaps something more complex such as managing the Drupal blocks. This person might be a technical wizard, but there is also a good chance that they might not be. In fact, they might be the person in the office that calls you when their “computer is broke”.

Tags: DrupalDrupal 7Site BuildingDrupal PlanetSite Administration

Drupal ToDo Filter Module: An Easy Way To Add Checkboxes

Apr 24, 2015

Description:

Episode Number: 204

In this episode of the Daily Dose of Drupal, we looking at the ToDo Filter Module. As I mention in the video this is one of those modules that probably isn’t going to wow you and honestly won’t be used a lot. However, this module does have its place in your Drupal module repertoire.

Tags: DrupalDrupal 7Site Building

Drupal Views Module: Creating lists of content on your Drupal site

Apr 17, 2015

Description:

Episode Number: 203

In this episode we cover an overview of the Drupal 7 Views module. The Drupal Views module is probably the most popular Drupal module and is installed on almost every Drupal 7 website I build. It’s so popular in fact that it’s included in Drupal 8 by default.

Tags: DrupalViewsDrupal 7Site BuildingDrupal Planet

Installing and configuring a Drupal 7 Sub-theme - 3 of 3

Apr 15, 2015

Description:

Episode Number: 202

Update: If you are looking for a written article, check out Master your Drupal Sub Theme.

In the final video of the 3 part series, we look at creating and configuring a Drupal sub-theme. Specifically, we will be created a sub-theme based off of the Zen theme. If you aren’t familiar with Zen, it is a very popular base theme used by thousands of designers as a starting point when building a custom website theme.

Tags: DrupalDrupal 7Theme DevelopmentDrupal Planet

Installing a Drupal Site and Database - 2 of 3

Apr 13, 2015

Description:

Episode Number: 201

In part 2 of the 3 part series, we are looking at how get a Drupal website and database setup and running. If you followed part one, you will remember we are doing this all on our local environment using MAMP. As the video will show, we begin by going to Drupal.org/project/drupal and downloading the newest version of Drupal. At the time of this DDoD, Drupal is at version 7.36.

Tags: DrupalInstallation ProfilesDrupal 7Drupal PlanetDeploymentServers

Creating dynamic allowed values options for an entity field

Apr 9, 2015

Description:

If you are building out a Drupal 7 site you may some day run into a situation where you need to have more dynamic options for a field attached to a content type (or any other type of entity). If the default allowed values text area will not work for your situation, then you have come to the right place. In this tutorial, we will discuss two different ways to create a more dynamic options list for extending your allowed values.

Type: TextTags: DrupalFeaturesDrupal 7Module DevelopmentDrupal Planet

Setting and configuring a Local Host on Mac - 1 of 3

Apr 2, 2015

Description:

Episode Number: 200

It’s our 200th episode! For this video, I wanted to take a look at how to set up a local development system and then configure that to build a Drupal 7 site. In this video, I show you how to download MAMP, a local solution stack. For those not familiar with MAMP, MAMP stands for Mac OSX, Apache, MySQL, and Php. This full stack allows you to run a server on your local computer.

Tags: DrupalDrupal 7Drupal PlanetDeploymentServers

Module Investigator: Fixing an issue in the Drupal Subuser module

Mar 29, 2015

Description:

Episode Number: 199

In the last episode, we learned about the Drupal Subuser module. In this episode, we continue where we left off but take a look under the hood at the module code of the Drupal Subuser module.

By following along with this episode you will learn some things such as:

Tags: DrupalDrupal 7Module DevelopmentModule InvestigatorDrupal Planet

Selecting a Javascript Framework [Infographic]

Mar 26, 2015

Description:

Drupal 8 coming (queue suspenseful music)! One of the HUGE things with Drupal 8 is this term called "headless Drupal". Don't worry the Drupal drop isn't in any danger of losing precious head real estate, rather headless Drupal refers to using a different client-side (front-end) framework then the back end Drupal framework. From what I have read the goal is to have Drupal become the preferred back-end content management system.

Type: TextTags: Drupal PlanetTips and TricksUI/DesignJavascript

Creating a hierarchy of users with the Drupal Subuser module

Mar 19, 2015

Description:

Episode Number: 198

In this episode we cover the Drupal Subuser module. This module makes it easy to allow your users to manage other users on your site. This works great if you want to allow a site manager to be able to add in users of a specific role, but not have access to the full Drupal User Administration pages.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on episode number 198. And today we’re going to be going over the Sub-User Module. The Sub-User Module allows you to create a user and then have that user be able to create users underneath themselves so you could have and what our example is going to be is a manager user that can create a content reviewers underneath them and then you can give them permissions to control, if they can edit or delete those sub-users and you can do all kinds of cool things.

So we’re going to be going over that today, but before we get started make sure to follow me on Twitter at smthomas3 if you haven’t already and check out codekarate.com. Make sure you’ll get some of the other videos and posts and you can learn a lot about Drupal and click this little link over here for the free sticker giveaway if you haven’t already and we will send you a Code Karate sticker right to your door. So let’s go ahead and get started.

We have our development site here that we will be working on and I’m going to go ahead and turn on the sub-user modules. The two we’re going to be going on today are just the sub-user and the sub-user UI. The Sub-User Switch Module allows you to switch to a sub-user or login as a sub-user. We won’t be going over that one. You can see I’m using the dev version, you shouldn’t have to use the dev version, but I was doing some testing. It does require the relation module so you’ll need to have that downloaded and installed in order for this to work.

So we’re going to go ahead and install this. And the next step, once these are installed, is to go to the permissions page and set permissions for the sub-user module. So I’m going to go ahead and sort this just for Sub-User permissions. And you can see we have a list of permissions here. The important one that you need to have is to allow them to create enough authenticated user. So in this case you can see I have a manager role and a reviewer role. Well what I would like to do is to allow the manager to create other accounts and possibly give those accounts a reviewer role so that I could either create just authenticated users or an actual authenticated user with reviewer role.

So in order to do that I need to make sure they have the manager account or manager role has create an authenticated permission check. I’m also going to give it create a reviewer permission. So let’s save that and what we will do is we will go ahead and create an account called Manager Quick and we will give it the manager role and in this case you’ll notice there’s a field, it’s user relations, so the store relationship that will allow for the management of the user. So I’ll go ahead and allow that. And just to check, you’ll notice that when you come to your account page, when I click over here there’s a sub-users option here. Under Sub-Users, I now have this manager option. So now this manager is technically a sub-user of Code Karate. And so if I edit this, you can see that it’s just like a normal edit page, there’s a sub-user limit.

We will go ahead and login as this manager. And you’ll notice if we go to your My Account page as the manager you’ll see sub-users here. It says the user currently doesn’t have any sub-users which make sense, but you can add a user. So if we click add you get the normal or what looks like the normal user add form. You’ll notice one difference, you don’t see any role selection and I’ll explain why in a second. That’s actually something that should be there, but it’s not showing up currently.

But let’s go ahead and create a reviewer. Okay so now a reviewer has been created. If I come back to my account page and go to sub-users I can see that reviewer one has been created. I don’t have any access to edit this user and currently the user only has the authenticated user role so obviously this isn’t right. So what we can do is let’s come back to our admin side and let’s go back to the permissions page. And let’s give the manager permission to edit sub-users and delete sub-users. So we will go ahead and save that and now if we come back our manager account and we refresh the page, you’ll see I now have Edit and Delete links.

So if I edit this user you will notice the role option does show up and it only shows those roles that I have permission to create for. So I can give them the reviewer role now. I can save that, and now when I come to the sub-users page you’re going to see they have the authenticated and reviewer role. So you might be wondering why you can’t select the actual role when you’re creating the account and there’s actually a bug out here on drupal.org which hopefully…by the time you’re watching this might already be fixed.

If it’s not you can see there’s a solution here and in the next video I’m actually going to show you not using necessarily this solution but how you could debug this and fix it on your own so we’ll get into a little module development and you’ll look at the details of the sub-user module and figure out how you could fix this to kind of work. And then of course you could have posted this issue yourself but we’ll go through that in the next video. But you’ll see what the sub-user module does is it allows you to really create a hierarchy of users of I guess relationships between users.

So, in this case, the manager is the sub-user of the Code Karate account but it also has sub-users of its own. So a manager could then manage multiple reviewers, manage their accounts on their site and they could be in charge of possibly reviewing content. They would only have the permissions that a reviewer would have. Make sure you’re careful of course when you’re giving out these permissions because these…whatever roles you allow to create accounts, they can possibly do things that could harm your site so you want to be very careful with the permissions. You, for example probably don’t want managers being able to create administrators.

So just keep that mind, it’s a really simple to use module, besides that one bug it seems to work really smooth and it allows you to go ahead and create all different kinds of user hierarchies on your site which can be really good especially if you have a lot of content and you want people to review it or you’re creating some kind of social networking site. I can see a lot of users for it.

So go ahead and give the sub-user module a try, make sure to check out codekarate.com, check the next video if you’re interested in learning a little bit of module development on how you could debug the problem that we found earlier on not being to actually select the role when you’re creating the account.
So we’ll do a little module investigation in the next episode. But that’s it for this time, make sure you get your free Code Karate sticker and I will see you next time. Goodbye!

Tags: DrupalDrupal 7Site BuildingDrupal Planet

Adding Git to an existing Drupal project

Mar 13, 2015

Description:

I recently received an email from someone who finished reading the 5 Secrets to Becoming a Drupal Ninja eBook. The question was how to set up Git for an already existing Drupal website. The question is a great one because almost everyone that uses Git now had this question at some point.

Type: TextSeries: Introduction to GitTags: DrupalDrupal 7Drupal PlanetVersion Control

Drupal 7 Excluding Node ID from URL

Mar 12, 2015

Description:

Episode Number: 197

In this installment of the Daily Dose of Drupal, we are looking not at a module, but rather how to exclude a node from a view using the node/content ID. If you are new to views, you can check out our Drupal views introduction.

Full Text: 

Hey everybody and welcome to episode 197 of the Daily Dose of Drupal. I am Adam and today we’re going to be looking for something a little different. We’re not sure…you’re not going to be focusing on any specific module. Today we’re going to be looking at how to accomplish something in Drupal. And what we’re going to accomplish is we’re actually going to figure out how to display a view listing all of the nodes of a content type but excluding the node that we’re currently on in the view.

So that’s what we’re going to be accomplishing and I’m going to show and make more sense as we go along. But before we do that, of course, make sure you head on over to codekarate.com if you’re not already there and also make sure to check out our free sticker program we got going on. So in the corner you can click on that and we’re giving away free Code Karate stickers, trust me they’re completely free, no strings attached, we won’t charge you anything.

We ship this nice looking sticker to you if you just need to…all the thing we ask you in return is that you help us spread the word. So tweet it out to your friends and get other people to get some stickers that they can stick and spreading Code Karate word. Also while you’re at Code Karate make sure to check out all of the other things and again give us any thoughts on other modules or other things you want us to take a look at and we will do our best to get to those.

Alright, let’s get to the objective today. So what I want to do is again I want to display a block that list all of the nodes of a content type and then…but I don’t want to show the current node that I’m on. So to start, what I did is I created a content type called Blog and I added a bunch of…or just three different nodes for those blogs, so I got one, two and three in here. So if you see here I have blog test 1 and again let’s get it first to display all of the nodes of that content type. So to do that we can just simply create the easy view.

So we go to Structure, click o Views, add a new view, I’m going to call this…we’ll just call it blog post and then we want to up type content and we want to include it in just being blogs, we won’t include any of the rest of them We’re not going to create a page so we’re going to instead create a block and we’re just going to leave all the defaults fine and then you could see here below in our preview we’re seeing blog test 1, 2 and three getting displayed in all of our different blog types. So let’s go ahead and save that and I’ll just see how it looks like. So if we go back to structure blocks to get the block added, scroll down here to the view blog post, let’s add that to our first sidebar, save that and actually I’m also going to restrict that only to show on our blog content type.

So I’m going to come in here and select content types and click blog, and then if I close this you’ll see right here all my blog posts are showing up and I got one, two and three. We’ll that’s good and everything but for the goal of today it’s exactly to get blog test 1 not to show up because I’m already on that node. This doesn’t make much sense so if I go to two, two shows up which I already need a link back to the same page I’m already on so we need to get rid of that. So to do that all we need to do is edit our view and add a filter. So a filter with that is basically doing is it’s filtering the results before it gets displayed.

So to filter that I need to add a NID or the Node ID of the piece of content. So I’m going to go ahead and add that and in the Options menu here you want to do provide default value, under type we’re going to select content ID from the URL and remember in Drupal 7 content ID, Node ID same thing. So what’s that going to do is it’s going to grab the content ID or Node ID which if you look up in the bar here that’s the 10. So that’s our Node ID. So we’ll go ahead and grab that and we’re going to keep everything else default until we go to the bottom here under the more.

We want to inverse our rule so we’re going to click Exclude and what that’s basically doing is it’s flipping the rule. So if we read this here it says if selected, the numbers entered for the filter will be excluded rather than limiting the view. So what that means is it’s going tom say okay grab the 10 and if it’s the same as the Node ID we’re on which is the 10 then don’t show it. So we’re going to apply that filter and we’re going to go ahead and just save this and look and see if it works. So now you see what’s on blog test 2 or node ID 10, we don’t see blog test 2 over here because it’s the same. So excluding it, so if click on blog test 3, the three doesn’t show up on the list, blog test 1 that doesn’t show up on the list.

So again if we go back to the view just to show you, that’s how you exclude the node ID that you’re currently on. Again just adding a content filter, grabbing that ID from the URL or the node ID and then just making sure you come into the More settings and clicking the opposite or exclude checkbox. So that’s a really simple way to do this task, we don’t need to spend much more time on it but it’s definitely a handy thing, becomes in line, it’s definitely when you’re displaying blogs or similar type posts, nice way to limit that and make your user experience just that much better.

Alright so to end it today I want to leave you with a little quote, change things up a little bit. The quote is information without execution is poverty. It comes from a man named Tony Robbins and I think that’s very important in today’s world and even in with coding is, take the information that you learn from Code Karate or other resources and put that into practice. Not using information is worthless or poverty as Tony Robbins would say. So just get out there, just do whatever you think you need to do and make your dreams happen. Alright guys until next time, take it easy.

Tags: DrupalBlocksContent TypesViewsDrupal 7Drupal Planet

Building a Dynamic display block with Minipanels

Mar 8, 2015

Description:

Episode Number: 196

Sometimes you need to display something dynamically based on the page the user is currently viewing. Sure you can accomplish some of this with blocks, or even just panels, but sometimes it's nice to have the best of both worlds.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on episode number 196. Today we’re going to be doing something a little bit different than normal. We’re not just looking at a specific module but we’re going to look at how to build what I guess I’ve been calling kind of a dynamic display block with mini panels.

So you might want a little familiarity with panels if you’re going to follow along but you should be able to keep up even if you don’t have too much experience. So what we’re going to do, first I’m going to show you what I mean by dynamic display. So on the Code Karate site if you go to a Drupal Commerce related post if it’s tag with Drupal Commerce and you scroll down to the bottom you will see a block here that says we received our free collection of Drupal Commerce videos. If you go to a Git tag or I guess technically a version control tag post, you will see a completely different block here.

Just getting started with Git block and so what we really built is a way to base on the taxonomy term of the post, choose what kind of block or which block we want to display here and it’s just using panels so there’s probably ways you can do it especially if you wanted to spend a little time with some code you can do it more efficiently but it’s still a pretty easy way to create this without using any code at all. So make sure you’d have the panels module downloaded on your site and I’ll go ahead and get started with how to create this.

But before we do, make sure to check out codekarate.com. We have a whole bunch of things changing all the time on the site so you can check out the EBook, check out the Drupal Commerce course and just let us know if you see anything that you think we should do videos on the future. So I have our test site here and I’m going to go to the modules page and show that Panels and Mini-Panels are enabled so you can see mini-panels on and panels are also on. And if you go to our homepage there’s two articles here. This one is a test article and you can see it’s tagged with test and this one is called inspiring quotes and it’s tagged with the tag inspire.

So what we’re going to build is we’ll just build a mini-panel that will display something different depending on which post we click on depending on the tag. And we can go ahead and we’ll be able to put that block anywhere whether it’s on the sidebar, whether it’s below the post. You could actually put it within the post itself if you wanted to really did use panels. One thing to keep in mind when you’re doing this is you want to test this especially with caching because your page is completely cached. There are some things depending on tags so I just want to keep that in mind. Just test it beforehand but you should be okay to follow along with this.

So let’s go ahead to structure mini-panels and we’re going to create our first mini-panels. Let’s just call this Dynamic Display, we’ll leave everything else blank and hit Continue. We’ll then want to make sure we have a required context of node because we’re going to want them on a node page and you can leave the identifier and keyword, just set the defaults and hit Continue. For the layout it’s going to be a really simple layout so I’m just going to go to a single column.

You could make it as complex as you want but I’m going to keep it very simple. I’m just going to display one little piece of text depending on what type of article they’re on. So now we have our mini-panels or I guess similar to panels but editor where you can add content. So we’re going to first add a piece of content and I’m just going to use custom content here but you could use all different types of things. You could put other blocks in here, you could put comment form, you could do anything else that you could normally do with mini-panels or panels and add it into this actual mini-panel to display dynamically but I’m just going to go ahead and use custom content.

So I’ll do one, this one is going to be for…if the keyword or the tag is inspire so I’m just saying do you like inspirational post and I’ll click finish and then I’m going to add another one for that test tag and just say do you like post with the test tag. Just keep in mind that this is a really simple example but you can use it to put anything you want in here. So I’m going to go ahead and just finish this for now and let’s go ahead and look or add it to the sidebar and then we’ll look at how it looks just right now. So if we go down here and find mini-dynamic display, I’m going to put this in the sidebar first column just at the bottom and click Save.

I’m also going to come in here and configure it and only display it on article content types. You could of course determine how you want to do this and you might say, couldn’t we just use two different blocks and for this specific example you can’t because you can’t do it just based on taxonomy term if you want it to individually specify the pages, you could specify that, I only wanted to show the inspiring one on this page and the test one on the test page but that doesn’t work if you’re going to scale to hundreds or a couple of hundred posts on a site especially if you want it all controlled on taxonomy term.

The other thing to keep in mind with mini-panels is it doesn’t have to just taxonomy term. It could be controlled on specific field on a content type and I’ll go ahead and show you that a little bit but for now we’re just going to check just the article and now we’re going to go ahead and go back one of our articles and we should be able to see both of them, and it is not showing up. Okay so I think the reason that it’s not showing up is that in order for the mini-panel to actually get that node context that we pass in, we have to be using panels and page manager.

So what we’re going to do is we’re going to go ahead and turn that on for this article, and to do that we go to Structure Pages and you’ll see there’s a node view by default but by default it is disabled so we’re going to enable it. And then we need to make sure that our article page is actually using a variant in here. So we’re going to go ahead and add a new variant and we’re going to go ahead and do this just for articles so it’s not going to change any other content type. So to do that we add a variant and select Selection Rules, we’re to look for node type, click Add and find the article here.

This means this variant will only show up for article content type and everything else so all the other content types will go back to their normal display. So we’re going to go ahead and hit Continue and we’ll go ahead and keep this as flexible for now just in case we wanted to change it and we’re going to leave everything else on the panel settings page at its default and this is going to get us to a layout designer. So here is where we want to come in and add all of our fields, so we’d want to add our body, we’ll just add that quickly and I’ll also add the tags field so we can see that. I’m just going to leave everything as default so we can see it working. I’m just going to show that for now.

There’s more we can add but really what you want to do is you wanted to use panels to design out that article page and the it’s going to allow us to show the mini-panel in the block because the context of this panels page, this page manager panels page is going to then be pass into that mini-panel So that’s the only way that the mini-panel can be aware of the actual node that we’re going to need and we need that because without having the node available you’re not going to specify specific fields or specific taxonomy terms to use to decide which one to display. So that is important, so we’re going to click Create Variant and I’ll click Update and Save, you can see we are saved now so I’m going to go ahead and go back to the homepage. You’ll notice that the article page is going to look different, it doesn’t have the image, it’s not designed out quite the same.

We could change that of course but you will notice we have this little block here, this mini-panel and it has both. Do you like inspirational posts and do you like posts with a test tag? So what we’re going to do now is dependent on which article we’re viewing. We only want to see one of these. So how do we do that? Well we go back into mini-panels, so go back to structure mini-panels and we’re going to edit our mini-panel here. We’re going to go into content and we have our two different pieces of content. If we click the little Gear Icon over here there’s a visibility rule. And so what these Visibility Rules are and these are very dynamic and very flexible on what you can do but you can control what shows up based on specific conditions.

So we’re going to add a new rule here and we’re going to look for node tags I believe, node article tags field. So we’re going to select that, click Next and this is for the first one so we’re going to select the tag that we’re going to show and keep in mind this doesn’t have to be taxonomy. This could be a field you added. Maybe you’ll only ever going to have three blocks or three pieces of custom content and you want to add a dropdown with the three fields and based on what you select you want to show the specific one, you can do that.

The Visibility Rules, as you can see there’s a bunch of options you can actually put in php code if you don’t want it to be specific to one of the node fields. You could use similar blocks, you could use URLs, only show it for specific user, those types of things. But for this we’re just using the tags field so this one is only going to show with the test tag, is selected. So we’re going to click Save, now if I did this right and if we come back, if I click on the first article that’s tagged with test, you can see do you like posts with the test tag, if I come back to the other one you’ll notice it says do you like inspirational posts. So as you can see this is really dynamic and flexible for how you want to build out your site to show different dynamic blocks based on the taxonomy terms of the posts itself.

So you can get really crazy with it and put all of different kinds of things in these blocks so you could put the blocks anywhere but it’s very contextual in a way. It only shows what you want based on what is actually in the content itself. So it’s pretty cool and you can do all kinds of cool things similar to what we did with the Code Karate site and if you do use this, let me know, I’d like to take a look and we can definitely share it out and show off all the cool stuff you can do with mini-panels.

So that’s it for this time, I think we went a little long but I think it’s pretty useful and something that a lot of people would be able to use on a lot of different Drupal websites. Make sure to check out codekarate.com, sign up for the newsletter if you haven’t already and we’ll see you next time. Goodbye.

Series: Panels SeriesTags: DrupalPanelsDrupal 7Layout ToolsSite BuildingDrupal Planet

Drupal 7 Range: Set two values for a Drupal 7 field

Feb 27, 2015

Description:

Episode Number: 195

You ask and you shall receive. That is exactly what happened. Roman, the supporter of the Range Module, asked us to review his module. So that is what we did.

Full Text: 

Hey everybody and welcome to episode number 195 of the Daily Dose of Drupal. I am Adam and today we’re going to be looking at a module suggested by the creator of the module Roman Pasca or on Drupal at Terren and that module he maintains is called range. So what this module does is it’s a pretty simple module that attaches to CCK and allows you to add a field for two different numbers or range.

So I’m going to showcase that in a second and give you a few examples of some used cases that would work with Range Module. But before we do that of course we need to head over to codekarate.com, make sure to check out everything what’s going on there. We just finish up our contest so that if you did enter the contest for our free Drupal Commerce course make sure to check your email. See if you want or get a discount code.

Also on Code Karate make sure to sign up to get the 5 Secrets EBook and also just check out anything you see on the site, love to hear feedback from you so let us know also like Roman did, make sure to tell us any modules you might want us to check out. So let’s get started, so the Range Module, so the Range Module is like I mentioned before, a module that’s going to allow you to do two different fields or two different numbers on the same CCK Field.

So you read through it here, there’s not a lot of set up, but it obviously does have a lot of functionalities actually built into the module. So what…the version is 7.13 here. Obviously it does have an alpha version for Drupal 8 so that’s pretty cool. If you’re looking to get ahead and do a Drupal 8 site you could use this module if needed. So make sure again if you are following the video that you’re using 1.3 otherwise there might be some differences that aren’t going to be covered in this video.

So let’s go ahead and get that module installed, so once we hop over to our site here and we’re going to hop over to our module’s page and make sure we turn the module on, scroll down a little way. You’ll see the module here is going fall under the fieldset called numeric range. There’s nothing co configure on it but make sure you just go ahead and turn it on and save the configuration. So once you have the configuration saved, that’s really all you need to do. Now when you go over to your content types, so under Structure Content Types you can now add this as an option or a field.

So I’m going to go and manage my fields on Houses content type that I created earlier. You see that I already have one in here and I wanted to get one in here so that I can walk you through it and then we can add another one as well. So one used case that I came up with is if you wanted to have potential users or realtors enter in specifics for houses that they might want or want to sell. So for example you could say for Bedrooms, I went in and say okay give me your lowest number of bedrooms and your highest number of bedrooms that you would allow me to have or you would want to sell. So you could enter that, you could also…and we’re going to add another field here for price or bathrooms or things of that nature. Another example would be is via a consulting company and especially in website development and you wanted to give your clients a range of fees.

So you want to say how much are you willing to spend, give us a range from zero to 10 or whatever they think is comfortable for them. So what we’ll do here is let’s add another range field. So we’re going to do Price, and then again on the dropdown here you’ll see three different ones that come along. There’s a decimal, a float range and then into the range. So you’re probably familiar with what a decimal range than a float or excuse me, an integer ranges but you’re probably not too familiar with what a Float Range is and to be honest with you, either was I but when I look it up, basically the main difference is float stores data a lot and takes up a lot less space than a decimal does.

I believe we found out about 20 times less which is pretty significant, but the caveat is it float and it stores it’s done is accurate. Basically, it can change a rounding issue. So for example if you’re using money as a range you don’t want to use Float because you want to be specific about the amount. If you’re using for example height or distance to the sun, you might be able to use a decimal value there it doesn’t have to be as accurate.

So for this example we’re doing Price so I’m just going to do decimal because I want it to be pretty accurate. I don’t care if it takes up a little more storage. And then here we go; so there’s some settings that we can specify the range for decimal and it says Precision. So it’s 200 digits and it’s stored in the database so we can store up to 10 digits, it’s the least end up to 32 is the most. So we’re going to keep it at 10, we’re going to store out full length, anything over that will get dropped and then the number of digits to the right of the decimal, we only want it to be two so keep it there and then we can say what’s our decimal marker and we want it to be a decimal point and not a comma.

And then again this thing will look very similar to any other CCK Field you’ve looked at, there’s a bunch of different configurations. It’s at minimum, it’s maximums, you can do a field prefix which is what I want to do so I’m going to give a dollar sign on that so four. And then again here’s some of the additional ones for your range so you have your from and your two. So you can say…I’m going to change this to say Minimum Price, I’m going to change the two to say Maximum Price. And again you can add prefix and suffixes as well. I will…all other suffix of just, I’m good. And then again if you want default values, again a lot of us will look pretty familiar.

Well let’s go ahead and save our settings and now let’s add in and if you go and add content to our houses we just scroll down here and you’ll see that now we have a minimum price of we can set there and I actually put the suffix right there so that doesn’t look really good so I probably want to get rid of that, but that’s where that would appear. So like I said, a minimum price of 50,000, maximum price of 120,000. And again I can go to decimal values If I wanted, but I won’t for this example. And for bedrooms Let’s say I want 0 to 3, we’re just going to give it title, we’re going to save this and then you’ll see here it adds a decimal value for me so it goes out to that 00. So again this is an as relevance since I’m that larger purchase or probably doesn’t need a decimal value but you’ll see how that works but just again displays it but we give can get rid of those semicolons since it doesn’t really make any sense there but you see how that works. So anyway that’s pretty much the Rang Module, again there’s three different options, there was the decimal which we showed you, the Float and then the Integer. So those are the options to input in and there’s a pile of a lot more examples on those, the ones that I came up with but needless to say it’s not the module you’re going to use every day or on every site, but it definitely is a module that will save you some time if this range issue means to come up. So again guys make sure that you go ahead and think [inaudible - 0:07:43.9] the module and all the other ones. He looks like he’s committed to so that’s awesome. Thanks again for recommending it Roman. Other than that make sure to check out codekarate.com. Again check out our EBook there and also our course and all anything else that might interest you as well. We love to hear feedback as well. So until next time guys, see you.

Tags: DrupalContent TypesFieldsCCKDrupal 7Drupal Planet

Drupal 7 Touch Icons: How to add Apple specific icons

Feb 22, 2015

Description:

Episode Number: 194

Today, there exist many different options to digest content. One of the most popular options is Apple products like the iPhone and iPad. A unique thing about iOS is that they use specific icons when users want to add your website as a bookmark on their home screens. This icon is then used to quickly launch your website, similar to how you launch a bookmark in your browser.

Normally, websites don't have this icon available so what almost always ends up happening is Apple using a screen shot of the webpage as the icon. Having a generic screen shot can effect your branding message.

Full Text: 

Hey everybody and welcome to episode 194 of the Daily Dose of Drupal. Today we’re going to be looking at a module called Touch Icons. You might not be too familiar with what Touch Icons are but they basically are they allow when a user is using an iOS device and they bookmark a certain webpage, it’s the icon that would appear on their home screen.

So it’s a module that definitely kind of get overlooked but a module that really is helpful beings that iOS adoption is so high. So we’re going to take you kind of what that means and how that kind of looks once it’s done. So there’s a few ways to go about doing this. I’m going to show you all three ways that I know. I’m sure there’s others but these three will definitely work. So there is a Drupal module that will handle almost all of this for you and it’s the Touch Icons module.

So what this module basically does is it allows you to upload this Apple Touch icon to a distinct place and then it will reference that when a user wants to add as a bookmark on their mobile device. So that module is pretty easy to get installed so just download the zip file. Again I’m using 1.0 beta 2 and make sure if you are watching this on a later date you’re using the same version. It looks like it hasn’t been updated in a few years but it might change, you’ll never know. So just make sure to double check that.

So once you the module installed we can come over to our website here and get it enabled. So right there we’re going to enable it, we’ll make sure we save it and there’s no configuration you’ll see on that page specifically. When you do enable the Touch Icons module it will appear under your individual theme that you’re using. So modify that, we can go under Appearance and then use your theme user.

We’re using the default bartik. And then if you scroll to the bottom here you’ll see a field set for IOS Touch Icons and there’s two different versions in here. There’s the IOS Touch Icon and then IOS Touch Icon Pre-Compressed. Basically the difference is the pre-compressed version allows you more control over your ICON and it doesn’t’ allow IOS to do some special effects with your icon so that is if you look an IOS device you’ll typically see rounded corners and it has like a shadow effect to it. If you upload just to IOS Touch Icon it’ll do all of that for you. As the module reads here, it has a rounder corner and a glass effect overlay to the icon which is kind of nice. But some IOS devices don’t…basically don’t allow for this Touch Icon just by itself so it’s always best to upload both versions in your sight.

So once you get the module installed then you can easily upload an icon just to…this system. So we can click Upload Icon and you can find an icon. Here’s a little bit of a caveat, as IOS continues to grow and come up with new versions it obviously increases the size of the Touch Icon that’s needed. So from the little research I did, you best want and you’ve wanted upload as 152x152 image. If you have only here little quick, you’ll see here here’s the Apple Touch Icon that they’re using and this is obviously is specific to Apple and if we just look at the image real quick you’ll be able to see right there it says it’s 152x152 pixels. So that’s the icon I would recommend uploading. It’s also important to note how they save icon. You can see here that they save the icon as Apple-touch-icon.png.

So again, when somebody comes to apple.com it wants to bookmark that page. This icon right here you’ll see what will appear on their mobile device image. So on the home screen or in a folder or whatever, similar to any other app you would download. Okay so back to the sight here, so again I can just browse out to an icon. I’m just going to pick one that I downloaded here and when I upload this, again it’s called Apple-touch-icon.png and I’m going to do the same thing for my pre-compressed and again that’s the same exact name except for it’s got –pre-compressed on it and it’s a PNG as well. So once I do that I can save this and I see here now I have both of these uploaded to my system.

There’s the one and there’s the other one. So that’s all there is to the module really, so now when somebody would go and add an icon off f our website, this is what would appear and it would look. Again it went up here and it would look similar to this, so that will be a Drupal icon and again you can change this to modify that to whatever you’d want but again use that 152x152 size. So the other way I want to show you is that you actually probably don’t this module necessarily and there’s a lot of other ways to do it and it obviously makes it really easy to get that uploaded especially if you don’t have FTP access to your website so that would be the module I would use. But if you want to do it differently, you can actually pull up your FTP client and you’ll see here and you can actually upload these files directly to your directory.

So in Drupal the root directory is the directory in which your index.php file is in. So if we look here under the coat folder, we scroll inside of that, you’ll see right…there it is. Right there there’s our index.php so this is our root folder, so we easily can come over here to our icons that we have before and this is again this is on the left site here, here’s my home or local directory. I could go in here and I could drag this apple-touch-icon-png right into my root directory. And then in theory if I do that, I’m just looking here and then if I go to my development site here and I go appletouch-icon.png you’ll see it’s right there.

So that’s in my root directory so it’s right there, no folders or anything else needed and then that’s referencing this image or this image right here. So that would work as well as an option but the problem with that is if you have to update Drupal core or any major updates to your site, that will get erased so you’d have to redo it again which again one of the other good idea is you just have to drop it over again but let’s say you don’t want to use the module and you don’t want to put it in your root directory, it also allow you to specify this specific place for Apple to look for these images. So to do that, all you need to do is you need to come in to your index file so I’m just going to pull up one just for the…there’s maintenance-page.tpl.php files were the head of the document is located.

So that’s where we need to tell Apple to look for our Touch Icon. So I want to say I can just simply add a link here and I can do around and I just type in Apple Touch Icon so that’s what it is. And then I can do an Href and then this is exactly and then this is exactly I can tell where I want it to look. So instead of adding it to my root directory like I did before, I just went in here and I add it to my sights all themes images folder and you can see I have them both in there. I’m just going to grab this one. This is called Appletouch-icon.png.

So when I copy the URL to clipboard I’m going to come I here and paste that and you’ll get a lot of stuff I don’t need but if I can go all the way back down to the /sites folder so it’s now looking in sites all themes, images appletouchicon.png and then I can close that off right there and there we go. So now instead of having it to be in the root directory, it now can look for inside my theme which I don’t have to worry about updating and losing going forward. So that is it, listen guys, there’s three different ways to do it, one of them is again to…two different ways are to ignore using the module and simply upload to the…your individual theme right there or if you do want, you can upload it directly to the root directory. Again the root directory is located right inside your cold folder there, wherever the index.php file is located. Also if you do want to use the module, the module works really easily as well. Again all that works off of your appearance or your theme and then you can upload your icons right there for both pre-compressed and compressed or uncompressed Apple icon.

Again it’s really important to note that you want to use 152x152 size as in that will work for the different IOS versions especially the new stuff with iOS 6 and the iOS 6 plus versions. So there we go, so that’s all there is with the module, pretty simple, but again it’s a really nice little thing to add for users especially if you want them to bookmark it and have your branding be cohesive throughout your website. But one thing to note, if you do not have a Touch Icon, by default Apple will most likely just do a screenshot of your website. So it kind of ends up looking pretty white and plain typically.

So it’s always nice to have a logo attached to your brand. So anything else, any questions about it, make sure to leave them in a comments. Otherwise make sure to check out Code Karate, closing in to find out some contents we have going on as well as check out our courses we have as well and sign up for our newsletter. We love to hear from you and love to interact. So until next time, have a good one.

Tags: DrupalDrupal 7Drupal PlanetTips and TricksUI/Design

Drupal 7 Interval Field module

Feb 19, 2015

Description:

Episode Number: 193

The Drupal 7 Interval Field module provides a simple way to create a duration or interval field on any Drupal 7 field-able entity. A common use for this might be on a content type that generally keeps track of dates. Sometimes it easier to summarize a group of dates to a user or visitor using an interval field rather than selecting multiple dates.

An interval field is useful for keeping track of data such as:

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. I am Shane Thomas, you can follow me on Twitter at smthomas3, also make sure to check codekarate.com, learn a little bit about our Drupal Commerce Course and our 5 Secrets EBook. We are on Episode Number 193 today and it’s going to be a short one and we’re going to be looking at the Interval Field Module. If you ever had a situation where you need to allow a field to show basically a duration, so two months, three days, four years, something like that on your Drupal site.

The Interval Field Module is just the solution for you. So it’s not something that you can use too often but there are a few situations where it can be helpful. So we’re going to go ahead and make sure we have it installed on our test site here. As you can see I have the 7.x-1.0 version installed. And so we’re just going to go to a content type. I have content type called Training. I’m just going to add a duration field to this. I’ll call it Duration and it’s actually going to be an Interval Field. So select Interval, as soon as you turn on the module you’ll have a new field type.

There’s only one widget so we’ll leave that at its default. So we click Save and now it allows you to set a few options here. So the first one is the allowed periods, so what you select here will be selectable by the user when they’re entering the value for this field. So let’s say we want minutes, hours and days. Let’s put months too, so there we go. We’ll leave out the other ones and we’ll set the default value to two hours and click Save. We’ll move this up there and now we’re going to go ahead and create a training content. We’ll create some training.

Alright so we’re going to go ahead and call this one Week Long Conference and let’s say it’s 4 days. You notice there’s only the four options that we selected here. I could add some text if I wanted to in the body and I’m just going to leave that. So you can see I now have a duration field that says 4 days. Pretty simple, this is something sometimes you can use in replacement of a date field or an addition to a date field. If you have something that spans a long duration sometimes it’s hard for people to understand how long that really is.

So a Duration Field or an Interval Field can help with that. Let’s go ahead and add another one here; let’s say we are scheduling a month long class so we want to say 1 month. Notice that it says one month here but when you save it, it notice that this is the singular so it’ll take the S of it. So if we click Save, you’ll notice it says 1 month and not 1 months. So it’s a super simple, module, there’s not much to it but it’s something that I think can be useful in specific situations where you want to really keep track of that interval versus just having a set of dates.

So go ahead and check it out, let us know what you think and if you have any other suggestions for our future videos in the Daily Dose of Drupal, make sure to head over to codekarate.com, click on Contact or send me a message on Twitter or something like that. Just get a hold of me. Until next time, see you later.

Tags: DrupalFieldsDrupal 7Site BuildingDrupal Planet

Drupal 7 Options Element: A quicker way to add radio and checkbox options

Feb 12, 2015

Description:

Episode Number: 192

We kept things simple for this episode of the DDoD. The options element module uses Javascript to create an easy way to create radio button and checkbox options for fields on a Drupal content type. Before this module you had to add key|value for each options you wanted. Using this module the key and value is broken down into two fields making it easier to distinguish the difference.

Tags: DrupalContent TypesFieldsDrupal 7Drupal PlanetUI/DesignJavascript

An introduction to Git (part 5): Using Git with Drupal and Git hosting services

Feb 5, 2015

Description:

In An Introduction to Git Part 4, you learned the basics of Git branches. You are now ready to push your Git repository to a Git hosting service such as Github or Bitbucket. After that, we will bring it all together and discuss possible ways to use Git in your next Drupal project.

Type: TextSeries: Introduction to GitTags: DrupalDrupal 7Drupal PlanetVersion Control

An introduction to Git (part 4): Git branches

Feb 4, 2015

Description:

In the last section, An introduction to Git Part 3, you learned about adding and committing files to your Git repository. In this section, you will learn about Git branches and how using Git branches can help your Drupal development process. You will also learn a few different Git branch methodologies you can try out in your own Drupal projects.

Type: TextSeries: Introduction to GitTags: DrupalDrupal 7Drupal PlanetVersion Control

Site5 Hosting: A shared hosting solution for designers and developers

Feb 2, 2015

Description:

Code Karate has recently posted numerous times on the importance of hosting and finding a reliable hosting service for your Drupal website. In this post I will introduce Site5 Hosting and demonstrate how it can be used to set up a Drupal website. If you are looking for a Drupal host, Site5 provides great service and support. If you are not sure yet, the instructions below are still useful for many hosting provides as it goes over the basics of CPanel (used by many shared hosting providers).

Type: TextTags: DrupalDrushDrupal PlanetSystem Administration

An introduction to Git (part 3): Adding and Committing

Jan 29, 2015

Description:

In An Introduction to Git Part 1, you learned what Git is and how to download it on your computer. In An Introduction to Git Part 2, you learned how to configure Git and create your first Git repository. In this section you will learn how to add and commit files to your new Git repository.

Type: TextSeries: Introduction to GitTags: DrupalDrupal 7Drupal PlanetVersion Control

An introduction to Git (part 2): Your first Git repository

Jan 27, 2015

Description:

In An introduction to Git Part 1, you learned a little about what Git and Version control is. You also installed Git on your computer. You are now ready to configure Git and set up your first Git repository. Whether you are using Git for the first time on a Drupal project, or for the 100th time, creating your Git repository always follows the same simple steps.

Type: TextSeries: Introduction to GitTags: DrupalDrupal 7Drupal PlanetVersion Control

An introduction to Git (part 1)

Jan 20, 2015

Description:

If you are not already using Git on your Drupal websites or projects, now is the time to learn. Over the next week or two, I will be going over a brief introduction to Git in 5 parts. In the following post, I will provide a quick overview of Git and Git hosting services. In subsequent parts, I will walk through examples of Git commands and what they do. In the 5th and final part I will bring it all together with examples of how Git is commonly used with Drupal.

Type: TextSeries: Introduction to GitTags: DrupalDrupal 7Drupal PlanetVersion Control

Drupal 7 Superfish: An easy way to get dropdown menus

Jan 16, 2015

Description:

Episode Number: 191

Just like your grandparents, the Superfish menu module is an oldy but a goodie. Since 2010, Superfish has been helping site owners implement the infamous dropdown menu. Over the years Superfish has been improved to include various features for touch screens, and responsive needs.

Tags: DrupalDrupal 7Drupal PlanetUI/DesignJavascriptResponsive Design

Drupal Auto Assign Role Module: Control your Drupal roles

Jan 15, 2015

Description:

Episode Number: 190

The Drupal 7 Auto Assign Role module allows you a lot of flexibility in deciding what roles users receive on your Drupal 7 website. If you have ever needed to allow a user to select their own role, or if you have ever needed to automatically assign a role to every user on your Drupal site. This is the module for you.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 190 and we’re going to be covering the Auto Assign Role Module. But before we get started I am Shane Thomas, make sure to follow me on Twitter at smthomas3. Also make sure to head on over to codekarate.com, check out the EBook and all the other useful Drupal information.

So let’s go ahead and get started; The Auto Assign Role Module, it’s a really simple module but it does some pretty powerful things. It allows you to really control how users get roles on your Drupal site. So there are options to allow you to Auto Assign a role anytime a user assigns up for your site but you can also set it so the user can select their own role. And this is very powerful if you’re building out a site where…depending on what kind of user you want to have or what type of users you have coming to your site.

You may want to give them different permissions for…and since if you’re building an education site, you might want a teacher and a student role and the user would select that one they sign up. In this case we’ll go through one example with a reviewer or a manager role just as simple example since I already have those roles on this test site.

So make sure to go over to your test site and turn on the Auto Assign Role Module. Once that is installed we are going to go ahead and go to the configuration page and there are three options here and we’ll go through each of these. The first one is automatic.

So if we click on that you can see we can enable automatic role assignment which essentially means if any user creates a new account on your site they will be automatically whatever roles you check down here. Otherwise you can also turn on Automatic Role Assignment for Admin created accounts and this means any role that you would create as an admin would get or any user would get the role that you select down here. So if you want to make sure that either all admin accounts are all user created accounts end up getting a specific role, this module can be used to do that.

I’m not going to go through a demo on that because it’s pretty straight forward. The per role pages, we’ll go through that one last and we’ll start or we’ll go second with the User Choice. This one is pretty cool because you can actually allow the user to select their role on the user registration form. So the first thing we have to do is enable it. So we change this to Enabled and then we select the roles that they should be able to select from.

We don’t want to allow them to become an administrator of course but we will allow them to select either a manager or a reviewer role and this will just show any roles that you have on your site. So if you need to change your roles you can always go to people permissions and then roles. You can select if they should be able to select one or more than one role when signing up.

We’ll just keep it with one and then if you want radio buttons or select box, if you want it to be required I’ll go ahead and say yes, how do you want to sort it, what kind of description and what title do you want to show up. Let’s go ahead and hit Save and I will open up a new window here and we will go to the site and click on the Create New Account button. You’ll now see there’s a role selection here where I can select either Manager or Reviewer. You can see the description shows up there, the field set title and the actual field title.

I’ll go ahead and sign up for one here and I will select to be a manager and click Create New Account. Now I don’t have the ability for users to be able to create and sign into their own accounts. It’s still set up to require admin approval but this works regardless of how you have that set up on your Drupal site. So if I come back here and go to the people page you’ll see there’s a test role user I just created. It is blocked because I have to manually approve them but it does have the role of manager.

So that’s an easy way to allow on your user registration form a user to just select the role they want. The other option is to configure per role pages and this basically means you can create different paths or different sign-up forms and depending on the sign-up form that they go to is the roles or the role that they will receive.

So we’re going to create one for the manager role and we give it a title. We give it a path so we’re going to give it manager-signup. You can add it to a menu if you want if you want to actually to display in a menu item and you can select the display type. If you select standard it will show the normal user registration, user login, requesting your password, Drupal tabs, if you show it individually it will not show those tabs. I’ll leave this one at standard and I’ll change the other one to individual so we can see what the difference is there. So here’s the manager signup, so let’s also add a Reviewer signup page, so we give it a title and a path, we’re going to select individual this time and go ahead and click Add.

Now if we come back to the site you’ll notice we still have these options so we could turn that off if we wanted to but if I go to manager-signup you can see it’s the manager signup title which means if I sign up for this form I’m going to become a manager and receive the manager role. And also notice how the tabs are showing up here.

If I go to reviewer-signup there are no tabs. There we go, so I just created a quick reviewer account on that reviewer signup page so we can ensure that I would get the reviewer role. So if we come back to the people page and refresh you’ll notice here’s my username, here’s the role I would have receive and there we go. That’s the Auto Assign Role Module. So as you can see it allows a lot of flexibility with controlling how roles are assigned throughout your Drupal site.

So this is incredibly useful if you’re building out as I mentioned before, some kind of social network site or education site where there are different roles and different permissions that need to be applied to those different users. So go ahead and give that one a try, make sure to check out codekarate.com and let us know if you want anything that we don’t already have up there and we’ll see you next time. Thanks for watching.

Tags: DrupalUsersDrupal 7Drupal Planet

Drupal Commerce Course

Jan 9, 2015

Description:

After creating hundreds of Drupal videos and blog posts on various topics, and after receiving many comments and email's, we started to realize a few trends over time. One of the things we received a lot of questions and interest in, was creating ecommerce sites in Drupal.

Type: TextTags: DrupalDrupal CommerceDrupal 7Drupal Planet

Drupal 7 Smart Trim: A simple way to shorten long text areas

Jan 8, 2015

Description:

Episode Number: 189

The Drupal 7 Smart Trim module allows you complete control over how you want text to be displayed when shortened. Put another way this is the module to use if you want to display a teaser or a beginning part of a longer text area.

Once installed you are able to set a variety of things. These include: shorten length by either words or characters, what to display for the ellipse (...), if you want a "read more" link to appear and what you want the link to say and lastly if you prefer to use the Drupal summary option.

Tags: DrupalFieldsViewsDrupal 7Site BuildingDrupal Planet

Using Drupal views pager feature to display users

Dec 31, 2014

Description:

From time to time we get a question that we feel would be beneficial to more than just the person asking. Yesterday, we had one of those questions.

Hi Shane,

I just bought your eBook today and have enjoyed some of your tutorials too.

I come from the WordPress side of development, but recently sunk my teeth into Drupal and I'm working hard and fast to get up to speed as quickly as I can, which is one reason I bought your eBook today.

Type: TextTags: DrupalContent TypesFieldsCtoolsViewsDrupal 7Drupal Planet

Drupal 7 Draggable Captcha - a more friendly way to prevent Spam

Dec 29, 2014

Description:

Episode Number: 188

Note: This is episode 188 NOT 187 as stated in the video!

The Drupal 7 Draggable Captcha module is not like most captchas. A captcha is a way to catch or capture spam and prevent a bot from completing a form. This is one of the most widely used ways to prevent SPAM on a website. Drupal has many different types of captchas available and the Draggable Captcha is one of the more fun and easy ones.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 187 and we’re going to be going over the Draggable Captcha Module. Before we get started, I am Shane Thomas, you can follow me on Twitter at smthomas3, also make sure to head on over to codekarate.com, check out all the other host that we have going on and look at the EBook and let us know what you think and if you have anything that you want to learn that we aren’t currently covering.

Before we get started with the Draggable Captcha Module you may want to look at episode number 70 where we cover the Captcha Module because the Captcha Module is a requirement of the Draggable Captcha Module. So we’ll go over briefly what the Captcha Module is here but if you want a little more in depth coverage you might want to watch that video.

So what is the Draggable Captcha Module? It’s simply a nicer version of the Captcha which if you know is simply or typically where you type in the characters and sometimes it’s hard to read what those characters are. This Draggable Captcha allows you to drag an image from one…from the left side over to the right side to select the correct image and based on that it tells that you are basically a human and not a bot.

So we’re going to go ahead and just see this in action so we’re going to head on over to our development site and ensure that we have the Captcha and the Draggable Captcha Module installed and working. As you can see we have the Captcha Module on and the Draggable Captcha Module on and we can click any of these configurable buttons that bring you to the same page and this is where you actually set up which forms you want the Captcha Module to display on.

So we select the default challenge type and then we select the forms that we want the challenge type to show up on. And there’s a couple of different options here that we can go through and we’re not going to go through all of these but you may want to actually see what this going to do before you actually try it out. So you can click on this example sub-tab up here and here it shows you the Math Question Captcha which is the default or it now shows the challenge Draggable Captchas. There’s the mini and there’s the regular size.

So as you can see if you drag it over it turns green if you get it right. If you get it wrong it turns red and this mini version does the same thing. So let’s go ahead and just test out by changing the default challenge type to Draggable Captcha and we’re just going to turn on the user login to use Draggable Captcha as well just to show how it works. And again you can go to the Episode 70 and see exactly what all these settings do in a little more detail.
So let’s go ahead and we click Save. So I am going to grab the URL here and open up a new window and you’ll see if I go to this /user page because it’s only on this specific form that the captcha is showing up. So in order to login I also have to complete the captcha.

So if I try to login without filling in the captcha it’s going to tell me I need to go ahead and fill that in. If I fill it in incorrectly it’s not going to let me log in but if I fill it n correctly then it will let me submit the form. And you may not want to do this obviously with the login form but with the password reset form or any of the other forms that you think are vulnerable to bots, you can use this captcha as it’s a nicer, easier to use captcha than just a standard one.

It does have a warning that it says…it’s probably not the most suitable for a highly secure forms because it’s not as secured as some of the other captchas out there but it is a good kind of first line of defense. So go ahead and give it a try and let me know what you think. Again check out codekarate.com, follow me on Twitter at smthomas3 and we’ll see you next time on the Daily Dose of Drupal. Good bye.

Tags: DrupalDrupal 7Drupal PlanetSpam Prevention

A Code Karate Christmas

Dec 23, 2014

Description:

Ho! Ho! Ho! 2015 is fast approaching which means the Holiday season is upon us. As a little "gift" to you, we have put together our rendition of "Let it Snow". Of course since everything we cover on CodeKarate.com is Drupal, we thought it would be fitting to do a Drupal version of his holiday classic.

Hopefully this brings a little smile to your face. From all of us from Code Karate we wish you a happy holidays and new year! Onto 2015!

Type: VideoTags: DrupalDrupal 6Drupal 7General Discussion

Drupal 7 PRLP: An easier way to resetting Drupal passwords

Dec 18, 2014

Description:

Episode Number: 187

The Password Reset Landing Page or PRLP module is honestly one of the simplest modules you have come across. The sole purpose of the module is to provide the ability for users who request a new password to be able to reset their password on the password reset landing page instead of having to do so on the user edit page.

Tags: DrupalDrupal 7Drupal PlanetEmailSite Administration

Drupal 7 Rules Filter: Manage and search your Drupal rules

Dec 18, 2014

Description:

Episode Number: 186

The Drupal Rules Filter Module is a simple module that makes it easy to sort through a long list of Drupal Rules. This is a module that is especially useful on those larger scale Drupal websites that rely heavily on the rules module and have many contributed Drupal modules installed.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 186. I am Shane Thomas, you can follow me on Twitter at smthomas3. Today we’re going to be going over the Rules Filter Module. The Rules Filter Module makes it easy to manage large lists of rules. So if you’re familiar with the Rules Module you may know that if you’re building a larger Drupal website and using a lot of contributing modules that use Rules, the list can become a little bit unmaintainable.

There can be a large number of items in the list and just makes them hard to sort through and find what you’re looking for. Before we jump into that make sure to check out codekarate.com, check out the 5 Secrets to becoming a Drupal 7 Ninja EBook, check out all the other videos and post and let us know if you have any ideas or things that you’d like to see.

So we’re going to go ahead and get started. If you head on over to the Rules Filter page on drupal.org you’ll notice that it’s not a very popular module yet, however it’s relatively new so you can go ahead and you have old sites that use a lot of rules and it will be something that may help you if you’re still actively working on those sites. One thing to note when you’re installing this is it requires the List JS Plugin.

So I’ll show you in a little bit what that means and how you install that but we’re going to start by going to our development site. So if we first go to the Rules page on this development site you’ll notice it looks just it normally should. It’s a relatively long list. I have a few contributed modules like Drupal Commerce on a few others that add rules to this list. It’s not too big yet but it could be getting there if I add just a few more modules. So we’re going to start by turning on this Rules Filter Module, and one thing you’ll notice, if you notice the way that my Module’s page works, if you’re familiar with the Module Filter you’ll know that that’s how this is working but the Rules Filter is built to work pretty much the same way.

So it looked very familiar if you’re used the Module Filter Module before. So I can go ahead and turn on the Rules Filter Module you’ll notice I have Rules and Rules UI on, so I click Save and as soon as this loads I will head on over to the Rules page and you’ll notice that it still looks the same and I get this message saying The List JS Plugin has not been installed. So if you click this link here to download the List JS Plugin it will bring you to this website.

You click this Compress button to download the compress version of List JS and then depending on however your local development setup is, whether you’re using another server or whether you have it locally, you’ll need to make sure in your sites all libraries folder you create a List JS folder all lower case and you drag the list.min.js into that List JS folder.

There’s also a Drush command that you can use so you can use Drush which I highly recommend. You can run a Drush command Drush Rules Filter Plugin to download this List JS Plugin. So now if we refresh this page you’ll notice it looks much more the module’s page. There’s an Easy Search here and you can see it’s instantaneous. As soon as you start typing it filters down the list. There’s also categories on the left which help you search through based on different modules or tags on the Rules. So you can go ahead and check out this module.

There’s really not much more to it in that. It’s a really simple easy to add and easy to use module that depending on your site might be useful. I wouldn’t say you’ll need it if you’re just using a few rules or there but it is something that can be very useful if you’re building out a large scale Drupal site with a lot of contributed modules and a site that really relies on using the Rules Module. So go ahead and give it a try, let us know what you think and we’ll be back again next time. Thanks for watching.

Tags: DrupalRulesDrupal 7Drupal PlanetSite Administration

Drupal 7 Sweaver Module: Change your theme style with no CSS code

Dec 14, 2014

Description:

Episode Number: 185

The Drupal 7 Sweaver module makes it easy to change the style of your Drupal theme without having to write any CSS code or dig through any template files. The Sweaver module provides a simple to use designer toolbar that sits at the bottom of the page and allows you to instantly change the look of your Drupal theme.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 185. I am Shane Thomas, you can follow me on Twitter at smthomas3. Also make sure to follow Code Karate on Twitter at codekarate and check us out on Facebook, Google Plus and any of those other social networks. As I mentioned we’re episode 185 and today we’re going to be going over the Sweaver Module. And this is a module I recently stumbled across that basically allows you to easily change the look or the appearance of your website.

So rather than writing CSS code or using the CSS Injector module or something like that, you can use this module to quickly change styles and your theme on your Drupal website. It comes with a Caveat I guess you can say is in that…it isn’t the most reliable module, it’s a little funky to configure and to use but it does work pretty well and if you don’t know CSS or don’t want to learn or don’t want to actually create a new team, something like that.

This module allows you to quickly and easily make changes over top of your existing theme. So it’s a nice module for someone who’s maybe just getting started and doesn’t want to actually do a lot of the development on their own. So we’re using the 7.X-1.3 version of the Sweaver Module and we’ll go ahead and turn it on. So as you can see we have a pretty basic standard Drupal 7 installed right out of the box. And we’re not going to be able to get to all of the features of the module. There’s quite a bit but we’ll at least get a look at and you’ll get an idea of what it can do and if it’s right for you.

So once the module is turned on here we’ll go ahead and look at the various permissions it offers. There are two permissions; one is to configure all the settings and one is to actually use the front end editor. As you can see the Administrator has the options from those which is fine.

The menu or the configuration pages are located in Configuration User Interface Sweaver so we’ll go ahead and go there. Now there’s quite a bit of configuration you can do on this module. It’s very very configurable, you can change it and move things around, really optimize it for how you want it to work. This checkbox is the important one to make sure the editor is enabled. If this isn’t checked you can’t really use the module.

So I believe you’re going to need to keep that checked pretty much most of the time. You can specify specific paths, you don’t want the actual editor to show up on. You can specify certain selectors to exclude certain classes and certain properties that are allowed. We’re going to leave this page all at its default. We’ll go ahead and go to the Editor tab up here. Here you can configure where things show up in the editor.

You’re going to see that in just a second but you can go ahead and move things around to different tabs or sub-tabs within the editor itself. We’re looking at the selectors tab now and you can see here’s all the different selectors you can actually select and to change the style of. If you are not familiar with CSS, some of these tags and selectors that we’re going to go through might seem a little different but if you are familiar with HTML on CSS you’ll obviously recognize these right away.

So that last tab allows you to edit the selectors that you can use. Here you can change it or add properties so if you want to add another CSS property that’s not supported, out of the box you can add one and it should work. If you do have a property you’ll need to make sure come into the types and select where that property needs to show up.

So if I edit the block type you’ll notice it selects which property should be showing up when you select that type of item. There’s a whole bunch of different plug ins, we’re going to start with the defaults to just manage styles and the images plug ins but we’ll come in and we’ll add a few of these after we show how the basic used cased works. You can have it show the Delete tab if you want to be able to delete the different styles, you can have it auto saved as well and then images just allows you to upload different images for your theme. Okay so enough with the configuration, a lot of that probably didn’t make sense but once you see how it works on the front end you’ll kind of be able to understand what those options do.

So when I come back to the homepage on my Drupal 7 site, you’ll notice a little toolbar or style section down here. What this allows me to do is style various parts of site. You’ll notice as I hover, you can see in red dotted borders of what I’m selecting. So my first thing I’m going to do is let’s say I want to change this blue color. I know you can do this in the Theme settings but not all themes have color module integration. So I’m going to go ahead and select this, you can see the red around the border there and you see I have different options. I can change the font so I can do different things with the font. You’ll notice how some of this text gets bold when I click the bold. You can change the background which is what we’re going to do here in a little bit.

There’s borders and spacing so if you want to space that a little more you can do that, you can add padding, you can add border, you can add margins and then you can change the height and the width. So what we’re going to do is change the background. We’ll change it to some version of some red up here and when it looks pretty good and you can of course enter in the color directly. You’ll notice nothing seems to have changed. Well because this theme uses an image as well.

We need to change the background image to No Image. Just like that you’ll notice we now have a little bit of a red color there in the background and you can play around with that and get it to the color you want. The next thing we’re going to do is let’s change this area down here, this white to a different background color. Let’s change this to something grey, just a light grey maybe. And we’re going to copy this because we’re also going to need to change this area here to that same grey. You’ll notice you can just paste it in and now that matches up. And now as you can see the theme has changed. None of this is saved yet though.

So if I close out of this or I want to it as an anonymous user I’m not going to see these changes. In order to see the change or to publish this change I have to click this Save button here and you have to give your style a name. So I’m just going to call this Red Style for now. You can call it whatever you wanted, just so you remember what style it is and you can click Save and Continue Editing or you can click Save and Publish. I’m going to click Save and Publish and you’ll know that or you’ll not that it says the style has been published, you’ll also see there’s additional tabs down here and you can save over top of it or create a new style.

You can load an existing style or you can publish the changes that you’ve made. So there’s the basic used case, as you can see there’s a whole bunch of options in here. From fonts to your background, your borders. Pretty much anything all of the basic CSS properties are configurable right out of the box. So let’s go ahead and look at some of these other plug ins that you can use with the Sweaver Module.

So a quick go over on this Editor tab one more time and you’ll notice that these different properties are those sub-tabs that were on the left side when you’re on that style tab in the Sweaver Module. So this is how you can reposition these into different areas or if you add additional properties you can position them where you want them to actually show up. But let’s go ahead and go to this plug-ins tab and turn on the advance plug-in, we’ll also turn on the Switch theme and the Theme Settings plug-in. If you have the Font in Your Face Module you can turn on the Font Face plug-in and that will allow you to change the fonts and then give you more flexibility with what types of fonts you want to use. And there’s a few other plug-ins that you can also play around with that we’re not going to be going over but you can definitely look at them and see if they help you build out your theme.

Okay so once we save that we’re going to go back and you’ll notice there’s a few more tabs that are going to show up here. We now have an advance Switch Theme and the Theme settings tab. So we’re going to go to the advance and you’ll notice there’s a watchdog section which is just a list of all the changes that you’ve made in your style tab. There’s also an option for custom CSS. So if you have something that you just can’t get working or you need to override this small piece you can just add some custom CSS right here. The Switch Theme allows you to do exactly what it sounds like.

You can click and switch the theme. So is says you’re now switched to 7. One thing you will run into when you’re working with this module is you’ll notice that this toolbar or designer bar down here. Sometimes it stops working. You’ll notice that there’s a few little tweaks or corks with it. if that seems to happen, typically a quick refresh of the page seems to…for the most part you get rid of most of your issues and then it gets back to working again but just keep that in mind that it’s not exactly a perfect module. It works pretty well but there are some of course when you’re really using it that you might run into.

So as you can see if you switch the theme it seems to make it show up double. You click around a little bit and you refresh the page and then it seems to start working again. So we’re going to look at the Switch Theme, we’re going to look at the Theme Settings. This allows you to change your theme settings directly from in this toolbar here. So what we’re going to do is we’re going to change this logo. So we’re going to change the logo image settings. You’ll notice in an overlay it pops up this logo settings form which is the same formats on your theme page or you appearances page. So I’m going to go ahead and select the logo, click Apply and this logo now appears. So I’m going to save this and I’m going to give this a new style even though it is pretty much the same thing, we’ll call this one Code Karate and I will save and publish this.

Now if I go to Load you’ll see I’ll be able to select between my two different styles. Another thing I’m going to show you what you can use here is the Images tab. The Images tab allows you to upload various images. You notice you can double issue again. Alright so we want to be able to upload various images maybe for a background. So if you want to actually have a background as your image or an image as a background up here you can go ahead and start by uploading an image. So we’ll start by just uploading this snowflakes image since it is winter right now and we’ll call this one Snowflakes and we’ll also go ahead and upload one called Snowfall just so you can see that you can upload multiple images here and we will upload that one as well.

And now let’s go ahead and style this, we can get the toolbar to show up and let’s say we want to change this background image. You’ll notice that when I click on this image background there’s two new options here, Snowfall and Snowflake because we just uploaded these images. So if I go to Snowflakes you’ll notice my background images now turns to that snowflakes image. If I go to Snowfall it’s going to show this little animated gift which isn’t the best quality but you get the picture. You can go ahead and put any image you want in there and it’s going to show up as your background.

So now we have Snowflakes theme, we can change the colors, we could match around this and I could also then save this. So let’s say I wanted to change these colors back to white, if I wanted to save it we call this one Snowflakes. We’ll actually call it Winter, so we wanted a winter style theme. Alright we can save there, so now if we want to change back to the Code Karate one we can just go to load style and we’re back to the Code Karate, if we want to go back to the Winter one we just head Loads Style and it’s back to the Winter theme. So as you can see this allows you to create styles on top of your theme. It doesn’t actually change any of your theme settings. So if I were to uninstall this module or disable this module it’s going to go back to the theme that the original based Drupal theme. So I can show you that quick and then I can pretty much wrap this thing up.

There’s a lot of options here as you can see. It’s a little buggy but it does allow you to do some things pretty quickly as far as making theme changes across the board. So if I just uncheck the box for the editor you’ll notice that I can still see my theme which is good because then you can turn this editor off after you get it to a point where you’re happy with your style. But as soon as I disable the module, everything is going to go back to the way it was before. You can…after you publish it you can look at this as an anonymous user. You may have to clear the cache just because of anonymous…your pages maybe cache so go ahead and if you’re going to test that you might need to clear your cache but I’m going to go ahead and turn this module off and we’ll see that everything goes back to the way it was before I’ve started working with the Sweaver Module. We’re back to normal.

The only difference is the actual logo because I uploaded that from technically the Theme settings page is still going to show with the logo that was uploaded. So that’s the Sweaver Module, a lot to it. it’s fairly complicated, a little buggy but it works pretty good and it allows you to quickly and easily change styles on top of your theme and give you a whole bunch of flexibility with how you want this website to look with having to write any CSS code. Make sure to check out codekarate.com, check out the EBook, post comments if you like it, if you don’t like it and we’ll see you next time. Thanks for watching the Daily Dose of Drupal. Bye.

Tags: DrupalDrupal 7Theme DevelopmentDrupal PlanetUI/DesignCSS

Smart Paging: How to display a node on multiple pages

Dec 11, 2014

Description:

Episode Number: 184

The Smart Paging module is one of those "nice to have" modules. This module allows the ability to break content on a particular node into multiple pages. It is important to remember though that this doesn't mean you have to create multiple nodes or Drupal pages. This module works off of the same node. Neat!

Full Text: 

Hey everybody! Welcome to Episode 184 of the Daily Dose of Drupal. I am Adam Learing and today we are going to be covering the Smart Paging Module. I kind of stumble across this one by chance, it peaked my interest but basically what the Smart Paging Module is going to allow us to do is break our content or long form content on the multiple pages, basically improving the user experience when somebody’s reading it.

So I’m going to set this in one long node they’re going to see multiple pages of content. There’s also…it can be used of course if you’re doing the 10 best Drupal modules and you only want to do one post but have them broken across five different pages. This is a god module for that type of used case. So we’re going to get to that just a second buy as you’re typically used to before…before we do that we’re going to do a little publicity, Code Karate of course is where all other module and all the kinds of other crazy stuff that can be found, head on over there, check out all new post, check out our EBook, go ahead and follow us on our social networks.

We do have a new YouTube channel or not new I supposed but just upgraded one, a new Code Karate Twitter account, some other cool stuff going on at Facebook as well. So make sure to head on over to all those, like us, tweet us or whatever you need to do, appreciate anything you can do. Alright so that’s that. So now let’s get to the module and again I’ll show you how to use it and get you a couple of use cases in a second.

So obviously the first thing to let you know is I’m using the 7.20 version here. This is the most updated version available. Inside the module here there’s some other stuff that you all want to check out, some integrations that work with them like WYSIWYG, meditated module and SEO stuff. I’m not going to let you cover and of that. In this video I’m simply going to show you the basics of how it works but know that it does integrate well with smaller module out there. Again there’s good information as far as how it’s working on the backend so if you’re interested on that, go ahead. Theirs is also an installation here, 7 Steps but we’re going to take you through those right now.

So the first thing you’ll do again is download your module and drop it in your module’s directory and then go ahead and enable that. So I did that, so I turned it on and then you want to go over here to configure and then I’ll kind of take you through some of these options here. The first one is you want to…most likely you want this enabled, Clean URL pagination and it also allows you to specify the word that you’re going to inject into the Clean URL and I’ll show you where that shows up eventually.

But basically you could see it from the example, this would be codekarate.com/node/1 if you’re using clean paths that could be codekarat.com/awesomepost and then it would say page/0of 1 and it would go on and basically it would be a Clean URL. But you don’t have to say page, instead you wanted to say article or banana. I mean you could have it say whatever you want. Obviously page is kind of the default, the one I would use and we’re going to continue using that here. Just going down here, some other options here.

Using this Javascript page here, obviously this just basically it just loads your next page, you’re out here having to reload the page so that’s always nice. It makes a little easier for users to get to the next page faster. You can use the Next and Previous buttons to page one page at a time instead of going, jumping having to select page two, page three, page four. So if giving that track will allow that, let’s see here; there’s some default value of stuff as well. The module allows you to basically break content three different ways.

The first one being a manual setting, so you can use these placeholder here, a comment basically a page break. You can customize that if you wanted. I wouldn’t see a point to it. You can also limit on character count so it’s going to count your text and every time it reaches 3072 characters it’s going to make a new page break or you can do it simply by words. So every 512 words it’s going to make a new page. You can customize all of this on the individual content type.

These are the defaults for all smart page and filters but you can customize that on individual basis if you’d like. Also here; you can see here a content suffix title if you want that description to provide actually good explanation of that but this would just say page 2, page 3 and so on so you can change that to something specific to your site if you wanted but page works for me. Okay so now that we have all the default set up, the next thing you need to do is go into your text formats.

So if we come over here in the content authoring you can go to text formats and by default here…basically Drupal is going to have the three. I always choose to use full HTML as my default but if I only have it configure you got to make sure that you enable the smart paging option here and this is pretty important; by default…I’m sure this [inaudible - 0:05:38.8] didn’t want but by default this is what it would look like when you came in here. So what I did is I selected the part Smart Paging checkbox and then I disabled the BR as a line break option and I basically said convert line breaks into HTML for smart paging capabilities.

This option right here is one of the smart paging modules installed so I just want to make sure that you got these two checked for sure. And then actually again it’s up to you if you prefer. The mart paging appears here and we’ll go ahead and save. The other Caveat just to make sure that in case you choose not to use full and you want to use filtered by chance. You want to make sure again these same ones selected here so we do these two here but another thing you’re going to want to make sure is down here in the Filter settings. You allow to eject a comment as a possible HTML tag.

I believe over here if you look at these directions here you got to verify that comment tag are included and limit allow the HTML tags list. So we just want to include that comment here if we did. Make sure we space it there but that basically allows for comments to be accepted HTML using full HTML of course all HTML tags are allowed. So I don’t actually have to do that on the full side. Okay so now we have filter setup. The next thing you need to do is go to your actual content type that you want to use it on.

So head on over to content types and I just have a basic Drupal installed here so I’m going to go to my basic page manage display. And you see here I have a smart paging option available. I click on this Cog, again here is where I can overwrite some default settings if I want. If I wanted the character it would be less or word might be less. I’m not going to change any of this right now. Oh right here is Show Smart paging settings during content any of this content type or use this below for every content of this.

So I’m going to say I want every piece of the content that’s a page to use this same one. I’m not going to change every individual node. You can if you want and we select in this…that box there but I’m not going to for this example. So just to let you know you can do it on individual nodes as well. So okay, so there we go. So now we have our set there, let’s save that and then all we need to do is create a piece of content so let’s add some content…oops I’m going to jump back, I’m sorry I forgot to mention something here. Right now I have the page break method sit at automatic page break on word limit. So every 512 words I’m going to get a new page so right now it’s way…I’m going to show you two options as well, we’ll start with that one so again we’re going to save that, I’m going to add some content to our basic page so we’re going to do word count break and then you can see there’s some boring [inaudible - 0:08:57.2] here. I will quite a bit…and again its’ going to break 512 words so it gets kind of crazy, let’s show…so we have 1,024…let’s do 512 and get me two paragraphs.

So I should basically see two pages here because after that temporary I should get a page break to the second page. So we’ll test that, so paste that in, just basic text here so right here it should be the end of the first page and then the start of the second page should be here so let’s see if this works. Again we’ll switch ours to full here, save that and there we go. So I was actually off one word so it should be a combination of one of the two so basically I’m kind at be off by one possibly but close. So there’s my second page.

You’ll notice up here here’s my example of what that page came in to play so I could have change that to whatever I wanted to. I could have said banana or whatever but it doesn’t…so that’s the word count break, say I didn’t want to do that anymore because obviously it seems like the count might be off one so say I want to do it by character instead . So if I go back to my content type here and edit this, I can say do it by character limit instead. Character limit is set to 3,072, we’ll just leave that for now. Let’s grab some more content though. It’s going to give five paragraphs for that, just do this. Okay so come back to our basic page on content. So let’s paste that in, so now we have a lot more content right…we’re going to have a lot theory and more pages, save that. Let’s go look at that page. So now you can see I have six pages here.

So I go in next and then again here it allows me to jump to a page if I wanted after using Java Script which we have enabled. So that’s the character limit rate. So now let’s say we said, no we to find here the control, we want to actually be able to control all the content ourselves, again we can change that really quickly, content types, basic page, manages display, edit here. All we need to do is set this to manual placement of placeholder. This is the placeholder we have to use, that comment and again remember we enabled.

Smart paging on the full filter and then also in the filtered HTML type format we allowed for comments to exist, go edit that content again. And now we just input this comment in in whatever we want to get in the pages so I’ve been here three times so when I…say this for page, they should have four different pages. So every page break is a new page so this would be one page, two page, three page and then I don’t have another one so that should be the fourth page, we’ll save that, we’ll get it one more time and there we go. So now we have four pages. So every page break, I was to get this menu page.

So that’s pretty much it guys, I mean it’s really simple module. Of course some examples like I mentioned would be top 10 modules, every module could be its own page. You can use that for if you’re writing a guide and you wanted to just break on every section or every chapter of a guide. Every chapter can be its own page.
A lot of cool used cases for this module, really simple to install and configure as well. So if you have any question about it, make sure you leave them in the comments below, otherwise again head on over to Code Karate, we love the support, anything else…you can get a Cheat Sheets there for free on Drush and Git. Yeah I think that’s it guys so until next week, stay cool, see you.

Tags: DrupalContent TypesDrupal 7Site BuildingDrupal Planet

Drupal Role Assign Module: Controlling who can assign what roles on your Drupal site

Dec 5, 2014

Description:

Episode Number: 183

By default a Drupal site has a lot of flexibility when it comes to assigning user roles and permissions. There are times however when the default flexibility is not quite enough. The Drupal Role Assign Module extends this flexibility a little by allowing more fine grained control over setting user roles.

The Drupal RoleAssign module allows you to allow other roles to assign users roles... confused yet? An example might be helpful. Assume you have the following Drupal roles on your site:

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 183 and we’ll be going over the Role Assign Module. But before we get started I am Shane Thomas, you can follow me on Twitter at smthomas3, also make sure to head over to codekarate.com, check out some of the other post and discussions and look at the EBook and some of the other free resources we have so you can learn Drupal.

So the Role Assign Module is a pretty simple but powerful module that allows you to have more fine grained controls over your roles. And what that means is that you actually have the ability to specify what roles specific users can assign to other users. So it allows you to basically keep a certain site user from assigning administrator roles to other users and we’ll go ahead and walk through an example.

As you can see in this example I will be using the 7.X-1.0 version of the Role Assign Module. So let’s go ahead and get started; we’re going to hop on over to my development site here and go to the modules page and turn on the Role Assign Module. There are a few things you have to do to set this up, we’ll go ahead and start by going to the permissions page and I will click on Roles so you can see the different roles I have on my site and I have added a manager and a reviewer role. The manager role is a role that I want to be able to manage other users.

So I want this manager to be able to create other manager and other reviewer users on this site but I do not want this manager to be able to create administrator users. So if I go to the permissions I can set that up. So for my Manager Role here I will give them access to the Administration Menu. It’s going to ask me if I want administration pages and help and that’s because I have the Admin Menu Module installed here. Scrolling down I am also going to give this manager role the ability to create edit and delete article content and if I keep going down the Role Assign Module will show up here and there’s a permission for assign roles.

I want the managers to be able to assign roles however if you look, they also need the administrator’s permission. The Administrator Users you got to be careful with of course because it gives this role a lot of additional functionality to when managing users so be careful with who you give this to. The important thing to note is I’m not giving the administer permissions. Any user that has both will be able to select any role. Any user that only has the administer users and the assign roles will be able to set only those roles that you’ve selected. So we will click Save and go to Role Assign which is an option that shows up right up here and you now have the checkboxes next to each role that you have on your site. It doesn’t include the authenticated and anonymous because any users are going to have the authenticated role by default.

So we’re going to want a manager user to be able to set the manager and the reviewer role. So if we save that we will now create a manager account to test this up and we’re going to give this user the manager role. You can see since I am an admin I can set any role I want here so I’m going to click Save. It looks like I already have that email address. So we created that user, I’m going to logout and now login as that user.

Once I’m logged in you can notice that if I go to add user I can only select the manager and the reviewer role because those are the roles that I selected for or using the Role Assign Module configuration page. If I only wanted managers to be able to add reviewers I could uncheck the manager option from that page and then a manager would not be able to create other managers. You can also notice when I edit I have those same options.

So that’s really all there is to the Role Assign Module, however you can use it when building out different configurations for what you want your users to be able to do when it comes to permissions and roles on your site and it’s very useful for those roles that shouldn’t be admins but still need to have the capabilities to manage certain users and to setup basic permissions or basic features or functions that different users can do on the site. So go ahead and check out the Role Assign Module, let me know what you think, check out all the other resources on codekarate.com and we’ll see you next time. Thanks for watching.

Tags: DrupalUsersDrupal 7Drupal Planet

Drupal 7 Override Node Options Module

Dec 4, 2014

Description:

Episode Number: 182

Drupal: Configuring Override Node Options Module

All the best modules are simply built, and override node options is exactly that. The purpose of this module is to give you individual control over the fields with the authoring and publishing fieldsets on Drupal nodes.

Within permissions you are able to set access control (based on role) to show or hide these fields. Some of the fields include sticky at top of page, promoted to front page, authored by and authored on.

Full Text: 

Hey everybody! Welcome to Episode 182, I am Adam Learing and today we are going to be looking at the Override Node Options Module. This module basically allows us what the title says. It allows you to override certain fields on the node when you’re creating it. So if you look at this image here you can kind of get an idea. So you see here that there is different options that you can then allow different roles to either see or not see based on the configuration.

So for example we’re looking at authored by option, authored on promoting different page, promoting publishing options, stuff like that. I believe it is only for the authoring information, yeah right here, it says only for authoring information and publishing field options so as you’ll see as you’ll go through it’s just into those two field sets but anyway, we’re going to be taking a look at that.

I am using the 7 version, 7.1.13 so you make sure that you…if you’re not using the same version as me, do take that into consideration. Pretty [inaudible - 0:01:13.4] recent module and we’re going to get into here in a second. The other things I want to of course do is head on over to Code Karate and just show you a few things. If you haven’t yet, check out our Cheat Sheets, we have both one on Git and Drush, check those out. Those are completely free.

Also if you’re on Code Karate check out our other post and check out our EBook as well, Five Secrets to Becoming a Drupal 7 Ninja. Alright so let’s get to the module. So we go ahead and we’re going to download the module which I have already done and we will enable the module so I’m going to head on over here to the modules and you’ll see here under the Permissions section, Override Node options and just click on that to get that enabled. Alright so once it’s enabled then all is left to do is set the permissions but before I do that I want to show you what the default would look like.

So I’m going to double check and make sure nothing preset here. Okay so as you here this is the override node options section and nothing is checked so it’s all at default as it will be one when you download it. So what I’ve done is I have two different roles on my site so if I go up to People here, permissions and roles you’ll see that I have just…all three actually, these are the default ones.

I have Administrator, Authenticated and Anonymous. I have created another authenticated user which is Bugs here. So he’s an authenticated guy, so once I head on over here and I have given him some pre-permissions but basically if I come over here and I’m going to add a basic page content type you’ll see it here I can do a title, the body or like you expect and I don’t see anything else. There might some defaults that I’ve given him for permissions. As you see those options right there. It’s kind of important to keep those in mind.

So I head back over here to the Permissions section and you’ll see here that I’ve given him comments and that’s the Administrator comments and that’s why he then can see this comment setting section here. This is very important, very very important to note here to right here; Administer Content, this permission. If you give a role of this permission right here, it will override and not basically make the override node options module irrelevant.

So if I click on this I will get obviously…right here, I’ll just do it. So if I click Administer Content I come in here and save it and then over here back to my authenticated user bugs and refresh, now you can see I have all these options which is maybe what you want for your certain user but it’s using this Node Override Module, you’re not going to want that box checked for this role.

One thing that you can note though is…okay so here we have the Published, Promoted the front page and Sticky at the top of the list. Those are the three fields in there but once this is over with module I can show only some of these or all of these or whatever I’d like. So I’m going to uncheck that box so I do not want that and if I head down here to the Override Node Options section you’ll see it’s broken down to every bite each content type I have, article and basic page but let’s say I want to be able to give this authenticated person the ability to make sticky tops, the pages and…let’s see what else I want. Let’s just do front page.

So Promote with a Front Page option, so let’s go ahead and save that, come back over here and now you’ll see that I have this two options now available to me. Again remember I took off the administrator content roles so if I would uncheck these two boxes. I’m going to do this just to show you here, you can see that it goes back to the default and then these two fields are going to disappear into the whole publishing options, the field set is going to go as well which are these.

So we’re going to turn those back on real quick here. You’ll see there’s Sticky and Promoted Front Page I have it checked. You can do other ones too, like you can get Authored on, Authored by, you can do bunch. I’m coming back here, let’s see a few more things here now. So now I can see the Authored information which I just checked and then the Publishing Two Fields I just checked as well. So that really all the Override Node Options Module does but again it does allow you fine and gain control on certain fields.

But again it’s a two fields in the authoring, it’s the fields in the authoring information and the publishing options field sets. These other three you see above are handled by different permissions. For example like I showed you the comment section, menu section and then URL sections. So like Menu, if I get rid of that, URL is down here somewhere…where is that one, get rid of those. So I save that then again I can really control what this person will see in the end. So now you see those rooms are gone, comments are still there. I could get rid of that if I wanted.

I can really decide on what I want this user to use [inaudible - 0:07:19.1] excuse me, so now it’s gone up and now these are the fields I’ve checked. So obviously this whole modules…Field Permissions are important when you have non-technical people using your site and you don’t want them to see stuff that they don’t understand. So you can really get and find your control so they only see when they’re creating content, the stuff they don’t need to see and then they’ll ask you questions like what this mean, do I need to click this or not or people in the website and for customer, same thing. Only give them what they need. Don’t give them anything else because it just creates headaches for you.

So anyway, that is the module, if you have any questions about the module make sure you leave them in the comment section below the post. Otherwise head on over to Code Karate and check it out, let us know what you think about everything, check out the Cheat Sheets, check out the EBook and that’s it. Alright guys, until our next episode, talk to you later.

Tags: DrupalContent TypesFieldsDrupal 7Site Building

Drupal Shared Hosting: Deciding if shared hosting is right for your Drupal site

Dec 1, 2014

Description:

Over the summer I was able to attend three different Drupal Camps (Drupal Corn Camp, Twin Cities Drupal Camp, and Drupal Camp Atlanta). While talking to other attendees or during my sessions, I made it a point to ask about hosting providers and what other Drupal developers, designers, and site builders were using.

Type: TextTags: DrupalDrupal 6Drupal 7Drupal PlanetGeneral DiscussionSystem Administration

Drupal 7 File Resumable Upload Module

Nov 26, 2014

Description:

Episode Number: 181

The Drupal 7 File Resumable Upload Module is a great way to allow your Drupal site to upload large files. This is especially helpful if your server limits the size of files you can upload to your Drupal site. The module simply replaces the standard Drupal file upload field with a better alternative that allows:

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 181. I am Shane Thomas, you can follow me on Twitter at smthomas3 and also make sure to head over to codekarate.com, check out all the videos and articles along with the 5 Secrets to Becoming a Drupal 7 Ninja EBook.

Every once in a while we get a module that I think is really cool. We end up reviewing a lot of modules over here and we put together a lot of videos but sometimes we run into modules that we see that we will be using on a daily basis and this is one of those modules.

The File Resumable Upload Module is going to be something that I can see a lot of Drupal developers needing and it’s relatively new. So we’re going to go through how that module is going to allow you to upload larger files, upload multiple files at once and resume interrupted uploads. So if an upload would stop for some reason you could resume it and pick up right where it left off. The one thing about this module is it does use HTML 5 so it’s a pure HTML 5 solution. So if your browser doesn’t have support HTML 5 it will just fall back to the standard file upload widget.

So we’re going to go ahead and get started and show how this can be set up on a test site here. The first thing we’re going to look at is a content type that I created, that we’re going to tool through. I just call it Large Files. All I have is an Image Field and a File Upload field and we’ll be using those fields to show how this File Resumable Upload Widget can actually work. So we’re going to start by making sure we turn the module on, you’ll have to of course download it and it’s actually very quick and easy to install and get working. After we enable the module we’re going to look at the permissions.

You’ll notice there’s a permission to upload via File Resumable Upload so if you want, depending on the types of users you want. If you want authenticated users to be able to use it or even anonymous of if you have other roles you can set those permissions. And we will now go and look at our content type here. So we’ll go to our large files content type, location here and we will look at the fields. And you’ll notice that if I edit it’s going to look pretty much the same as it always has, just a standard image field, same options but there is going to be this Resumable Upload Settings.

We’re going to go ahead and show how it looks currently before we turn on the Resumable Upload and it looks like a Standard File Upload Field. It sets our limit at a 100 megabytes, I also have this one, the file upload set at 10 just as an example. You can see it looks as we’d expect but let’s go ahead and turn on one of those File Resumable options. So if we come back into our Image Field we can go to the Resumable Upload settings section here and expand that.

Here we can enable the Resumable Upload, you can also then set a maximum upload if you want and this can be actually larger than your server size limit or the limit that is set in your PHP maximum post and file upload sizes. So this can be really cool if you’re using or needing to upload large files and maybe a couple of hundred Megs and you know that you don’t want to set the server to allow you to upload those larger files.

You can use this to kind of get around that. We’re going to save this one and we’re also going to edit the file upload field and I set this as an example as a maximum file upload size of 10 and you saw that it showed up that way when we try to create the first one. We look at the Node Add page. If we set this, let’s go ahead and set this to 120 megabytes and you’ll notice that’s larger than even our PHP limit and it’s larger than the maximum upload size that we’re setting here.

We make sure we check the Enable Resumable Upload checkbox and you’ll notice I also am allowing three files to be uploaded here. So if we click Save, now if we go in and add a large file, give it a title, you’ll notice our File Upload Widget has changed. This one is set to allow unlimited amount of images so you can see there’s no limitation here. This one said you can drop the three files here. You can click the Browse button just like you normally would or you can actually drag and drop items directly onto the page.

So for instance I have a couple of pictures here, I will just start to drop in and you will notice they just begin to drop in this list and as I click Upload it’ll start uploading this, if I click Cancel in the mid-upload and I re-click upload, it’ll pick up exactly where it left off. So it’s basically is able to keep track of where the upload left off and pick back up and to continue to upload those files. We can also do the same thing with some bigger Zip files here.

You’ll notice that one of this is actually over 100 megabytes which is what the PHP File Upload Setting is and you’ll notice that this file will be able to be dropped in. Oops that’s the image field. If I go down to the File Upload Field and I drop it in, you’ll notice that it’s able to pull this in. You can also pull in this one and even maybe this image file or this MP4 file.

So now if I click Upload, let’s go and start this upload and this is of course going to take quite a bit of time just because these are much larger files. So hopefully here in a second we will see it start to actually show some progress. You'll see now it’s showing that it’s 3.3% so if we click Cancel we could then remove one of these files, click Upload and you’ll see that it picks back up where it left off because it was uploading all of these files at the same time.

So even if I remove one and I continue to upload it’ll still keep track of each individual file and how much it had uploaded from that file. And I’m actually going to remove this one as well just to speed this up a little bit. Okay you’ll see that we’re just about uploaded and there it goes. So now you can see our larger files has been uploaded so we’re going to go ahead and save and you’ll notice that we have our files uploaded here, our big video file that we uploaded is there and if I would have left those other ones of course and waited long enough with those other larger files would have been there as well.

So that’s really all there is to the File Resumable Upload Module. It’s extremely simple to install and configure and it’s really useful especially if you’re using a shared hosting provider or a provider that is limiting you upload size to a set amount. This is a good way to I guess get around that so you can upload some of those larger files that you may need on your Drupal website.

So go ahead and try it out. I think it’s going to be useful for a lot of people, let me know what you think, make sure to check out codekarate.com and we’ll see you next time.

Tags: DrupalDrupal 7File ManagementMediaDrupal Planet

Drupal 7 Protected Pages Module

Nov 21, 2014

Description:

Episode Number: 180

In this video we look at the Protected Pages module for Drupal 7. This module allows for password protection on paths in Drupal. In other words, this module will prompt a visitor to a specific page to enter a password before they are able to see the content.

This is one of those modules that exists to just make this use case simple. There are a ton of other ways to accomplish this with permissions and roles in Drupal, but it is always nice to have a simple way to accomplish this task.

Full Text: 

Hello everybody and welcome to Episode 180 of the Daily Dose of Drupal. I am Adam and today we are going to be looking at the Protected Pages Module. The Protected Pages Module is a module that allows you to provide a password to your customer client and then with the password they can then access the page. Well without that they will not be able to access and instead they’d get a prompt that says Enter Your Password. A couple of different use case I’ll talk about it along the way.

Some of them could be if you obviously just have sensitive information, you only want certain clients to see or for example at Code Karate we could use this for…to put our Cheat Sheets behind this. We only wanted certain people with a password to get that. We could use it for that used case. So a lot of different use cases, also there’s a lot of different options you could use besides this module but this module is quick and easy way to get this done.

Really quick before we jump into the module, again just head on over to codekarate.com, make sure to check out our 5 Secrets to Becoming a Drupal 7 Ninja EBook as well as our Cheat Sheets that are available. We both have one in Git and in Drush so check those out. Alright let’s get started. So for this video I am using 7.24 of the Protected Pages Module, so once you get that downloaded and installed, just head on over to your Modules Page and then enable the Protected Pages Module.

Once you enable, the first thing you’re going to want to do is go to your Permissions and once you’re in Permissions, scroll down to you’ll find the Protected Pages section and in that there’s three different information that you can configure and the one that’s the most important is the middle one here. Access Protected Page Password Screen.

This just allows you to…allows that user to be able to get to that page. Without it you can’t even get to it so it’s kind of defeats the purpose of the Protected Password Module. So I always make sure to check the roles that I want and in those cases I want all my roles anonymous, authenticated and the administration role. Of course you can configure the other ones based on the roles that you might have on your site but for this simple case we’re just going to use those three.

Alright so once you get those Permissions set, go to your Configuration Protective Pages and there’s some settings in here that you can configure. The first one is the protected pages that you want. Protected Pages works off of nodes or pages. So what you can do is you could use a View or you could use Panels or you could just use a regular basic page content type.

In this case I’m just using a basic page and you see that I’ve added one down here, so node/1 is a protected page and if I edit this I would be able to set the password of the page so I’m going to set that here and save it. So anytime I would go to node/1 I should be prompted for a password. You can also see there’s a said email button here, if you click on that you can select recipients and then I’ll show you how you can configure the subject and body here but this is basically email that I’ll send to them. Letting them know, hey you can go to this URL and here’s the password that you need to use to access it or it provides a drop out of a box easy way to contact people that you want to have access to that. If you hover over here to the Settings tab there’s a bunch of different settings that you can configure.

You can use a global password and up here you have a setting that says you only want to allow pure page passwords so that would be individually or you can allow both or you can only allow it global. Of course this would be if you wanted to just have one password for all your protected pages, that’s where you would enter that. This one is the last one and it’s kind of an interesting one. The last one in this section anyway.

The Section Expire Time, as you can see from the description below, this basically is how long the session holds until they re-enter their password. It of course if it’s set to 0 it’s unlimited and the session will never expire but you could set that to 5 minutes, 10 minutes, whatever you prefer. And then the below sections are just…the configurations on different elements within the protected pages settings.

So this will be the email subject, the email content, we also have stuff as far as on the page itself, protected pages…this is like all the prompts. So you can configure all that if you’d like. I’ll not leave them all default. So now if I go over here as a used case and I said I am an individual and I go to node/1 you’ll see that I have a protected page enter passwords. So I have to enter a password but again I would be providing that email and click Authenticate and once I enter the correct password I now can see the content behind that page. So for your eyes only and just show you that is the content that I created. So if I go over here to content, again I was the admin and I see this page, so there you go.

So that’s why I wanted to show them and again this could be anything, this could be a view in there, it could be a panel page, it could be whatever you wanted it to be, it could be an invoice, whatever. Of course right now it just said simple node. Then again if I go back to the page I see the same thing but it’s because I enter the password correctly. So anyway, that is the module, real simple module, not too much to it but it has a definitely some used cases for privacy as well as showing clients specific things.

Alright so that is everything so make sure again to let us know what you think of the module. If there’s any other modules or similar you want us to review, let us know. Otherwise, again head on over to Code Karate and check on what’s going on there and let us know on any other thoughts you have. Alright thanks guys.

Tags: DrupalUsersDrupal 7Drupal Planet

Drupal 7 FullCalendar

Nov 19, 2014

Description:

Episode Number: 179

The Drupal FullCalendar module makes it easy to build an interactive calendar using the power of Views. The Drupal FullCalendar module uses the JQuery FullCalendar plugin to make it easy to create an event calendar that allows event dates to be changed by drag and drop.

In this episode you will learn:

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. I am Shane Thomas and today we’re on Episode Number 178. Today we’re going to go over the Full Calendar Module. The Full Calendar Module uses a jQuery plugin called Full Calendar that allows you to use Views to display interactive and draggable calendar events. So it’s somewhat similar to the way Google Calendar works, if you’re familiar with that.

So we’re going to take a look at that and see how you can make your own Event Calendar. Before we get started; make sure to check out codekarate.com, check out the EBook. We recently released and Git Cheat Sheet and a Drush Cheat Sheet which are just kind of helpful little things if you’re just learning about those topics and go ahead and follow me on Twitter at smthomas3 if you have not already. Let’s go ahead and get started.

The first thing you’re going to want to do is have the Full Calendar Module downloaded. I’m also downloading and installing the Colors Module which the Colors Module just allows you to display a nice legend to that color codes different types of events. The next thing you’re going to want to make sure you have is the actual Full Calendar plugin. So you can see it’s at Full Calendar.IO, there’s a Read-Me file within the Full Calendar Module that you can use and it walk you through how to install this.

One thing that’s important, I’ll click over is this warning right here. You need to make sure you’re using 1.5.X version of the plugin, not the 2.0. So let’s go ahead and click on the Download and you’ll see the current version is 2.1.1 but in this case you’re going to want to click on this all releases links. It’s a little hard to see. And scroll down until you find the 1.5 version. So 1.5.4, you can download the zip folder and drop only the Full Calendar sub-folder into your sites all libraries.

So that’s the important part. There’s Demos folder, there’s a J Query folder then there’s a Full Calendar folder within this zip. Only take the Full Calendar folder portion and put that in your sites all libraries folder and you should be good to go. So once you have that all dropped in, you can then go ahead and turn the module on. So I’m going to start with just turning on the Full Calendar Module. So we will save that and we can click Configure and it’ll allow you to select the path to Full Calendar and which version to use.

One important thing you can do is come to the Status Report page and you can confirm that the Full Calendar plugin found the correct version of Full Calendar that you actually dropped in there so it says 1.5.4 and I believe there are has been some movement on this Full Calendar Module to get it up to date with the newer 2.1 or 2.0 versions but I’m not sure exactly the status of that. The next step is to create your content type. In this case we’re going to create the content type called Calendar Events.

We will go ahead and not promote it to the front page and we will hide the comments and we will click Save and Add Fields. One more important thing to note, you have to have the Date Modules installed, you’ll need the Date Modules, you’ll also need Views, I didn’t go over that but you want to make sure those are installed so we’re going to create a new field called Calendar Date, select date and we’ll use just the Pop-up Calendar so that it’s just using the Date Popup Module and we’ll save that.

We will collect an end date and then you can see we have here month, day, hour and minute as the date to collect or the attributes to collect. So click Save, we can live everything else at the defaults here and that’s all you need for your content type. You can of course add additional fields or information if you want. We’ll just stick with that for now.

The next step is going to be to create our new View. I’ll just call this View Full Calendar and we’re going to show Content of Type Calendar Event. We want to create the page and we’ll leave the path at full calendar. I’m going to leave this unformatted list for now just to prevent seeing some error messages. We’re going to eventually change this to full calendar but it’s a little bit easier to make sure you have a Date Field added first so you don’t see a bunch or error messages showing up. So I’m going to go ahead and hit Continue and Edit. We’re going to turn the pager off because we don’t want the pager to show up. We want to display all items.

We also then want to make sure we change this so it’s showing fields and not just content and we need to add our Date Field. We search for Date, here’s our Calendar Date Field. We’ll add that, I’m going leave this at its default and hit Apply All Displays. The next step is to change this from unformatted list to now our Full Calendar Display. And you have a bunch of settings you can configure here so if you want the initial display to be something besides a Month, you can change that, change where your week starts. You can change at what the week mode is going to be whether it’s fixed, liquid or variable.
I’m going to leave it at the default, you can change some of the heading settings, the header settings, how the time and date is displayed. You’ll also have some style settings that you can configure. You can also customize how the fields are displayed. We’re going to leave everything at the default but know that those options are there. The other thing we’re going to want to do is change this Use Ajax to Yes.

So let’s go ahead and click Save, we are now going to go view the page so I’ll just open that up in new tab and you’ll see we now have an empty calendar. So let’s an event; so go to Add Content Calendar Event. So I’m just going to call this Test Event 1, I’m going to ignore those errors for now and I’m just going to set it for 1 hour from 7:30 to 8:30, put a little bit in the description and click Save. Now if we go back to the Full Calendar page you’ll see we have our event. The cool thing about this calendar is you can then just move this event to whatever date and it says the New Event Time has been saved.

So you can see I can change the date very easily, I can go into week view here and let’s say I decided I want to stay to be or this event to be a little longer. I can just drag it and now it’s going from 7:30 to 9:30, I can move it through a different day, Exactly as you’d expect, Similar to how Google Calendar works and it makes it really easy to organize a calendar and move events around. So you can imagine having a lot more events. Here you can organize your calendar easily but what if we had different types of events? We may want these different types of events to be color coded in different ways and the Full Calendar Module allows you to do that as well. It also allows you to have additional configuration options. So let’s look at some of those things and they are add-on modules that come with Full Calendar.

The first one will look at is this Full Calendar Options Module. Let’s go ahead and turn that on, hit Save and if you click Configure here you’ll see these are the options that you can turn on. Anything that is checked will have a corresponding option in the view. So in your calendar view you’ll have initial options that you can then set. We’re not going to go through all of these but you can look through them. I’ll just show you that they show up so let me refresh and go into settings. Let’s get out of this overlay. Looks like it doesn’t want to let me open this up. It’s a little bit of a hiccup here with Views.

Let’s try to open it back up then and see if that works. I have run into this before with the Full Calendar Module. It seems like there’s a few little bugs with how it works with Views. Typically it seems to start working again after a while. So I don’t know exactly what is causing that. It seems like everything else was working before. Okay so I think I figured out the issue here with the View and it turns out that you don’t actually need this Use Ajax to be turned on in order for Full Calendar to seem to work properly.

So once you go ahead and if you are receiving some of those same View errors that you saw me running into. Go ahead and turn Use Ajax to know and save it and then you should be able to get into your settings. If you remember we turned on that module, so let’s go ahead and look at the extra options that are now available. You can see we can set what the first hour should be, set the minimum and maximum time, the default event minutes, there’s a whole bunch of additional options that you now have at your disposal when creating your Full Calendar View. So if we set those we can of course change those and click Save.

The next module we want to look at that comes with Full Calendar, there’s actually two of them. It’s the Full Calendar Colors and the Full Calendar Legend. We’re going to go ahead and turn both those on. As I mentioned before, you’ll need the colors module, not the color but actual colors with an S as they are different modules. So once we change those to on and click Save, we now have the option to add a calendar legend to our calendar. So the calendar legend is just a block so we’re going to go into blocks and look for the Full Calendar legend. We can set that into sidebar first can click Save.

If you’ll notice we now have the Full Calendar legend, I’m going to actually move it up here a little bit and put it in that spot and click Save. If you come to the configuration page for the Full Calendar Legend block, you’ll see there is a legend type. You can change this to Bundle or Taxonomy. So what this will allow you to do is it allows you to categorize and sue different colors based on content type if you select Bundle.

So you may have a Calendar Event Content Type, you may have a doctor’s appointment content type or an appointment content type or a to-do list content type and you want those various pieces of content to show up with different colors on your calendar. So that is one option or you can classify through taxonomy which is probably a better option and easier option but depending on how you have your Drupal site setup. You may have a user both of those.

I’m just going to leave it at Bundle for now just to show that it works. If we now go to Full Calendar you’ll see over here there is a legend that shows blue for calendar event. I can still move my events around and change the length of time and everything works as it did before. If I add an additional content type and I add it to the view then I would have different colors based on the different types of content that is being displayed within this calendar. And as I mentioned before; go ahead and use taxonomy as well, just change that setting on that block and you can add a taxonomy field to your content type and categorize your content that way so they show up with different colors.

So that’s it for the Full Calendar Module, it’s a really cool module, it’s not too hard to configure, as you saw we ran into a few little issues but those are relatively minor hiccups and now it’s working great and I have a nicely displayed calendar working on my Drupal site that is interactive and very Ajax friendly.

Go ahead and follow me on Twitter, as I mentioned before, smthomas3, check out codekarate.com, we have a lot of cool stuff coming out and let us know what you think and we will talk to you later. See you.

Tags: DrupalDrupal 7Drupal PlanetUI/Design

Drupal 7 Imagefield Focus

Nov 14, 2014

Description:

Episode Number: 178

In this episode we look at the Imagefield Focus Module. This module adds another option to the image styles on a content type field. With this module you are able to specify a focus and crop area of your image. Once you have selected either or both of those areas the module then resizes and focuses on the certain area you specified. As you will see in the video, this module can be used when displaying a staff page showing only head shots and then loading to a full page where the entire image is shown all with the same image.

Tags: DrupalFieldsDrupal 7Image HandlingDrupal PlanetUI/Design

Git Cheat Sheet

Nov 12, 2014

Description:

There is a saying that "All good things come to those who wait". While whoever said that was most likely not referring to our Git cheat sheet, but the saying still holds true. As of right now, you get get your coding hands on the Code Karate Git Cheat Sheet by clicking here or going to the cheat sheets page (it is the same thing).

Type: TextTags: Drupal 6Drupal 7Drupal PlanetTips and TricksVersion Control

Bluehost Drupal Hosting: How to use Bluehost web hosting with Drupal

Nov 7, 2014

Description:

So let me guess: You either have a Drupal website or are going to create one and need a place to host your Drupal website.

Let me guess one more thing. You are looking for a simple, affordable, and reliable Drupal hosting option. There are tons of good options for hosting your Drupal website, in this article we will discuss how you can setup Bluehost Drupal Hosting for a new Drupal website, or for an existing Drupal website.

Type: TextTags: DrupalDrupal 6Drupal 7Drupal PlanetSite Administration

Drupal 7 Exclude Node Title Module

Nov 7, 2014

Description:

Episode Number: 177

Have you ever had to try to hide a title on a page in Drupal? Maybe you created a page to be your front page and don't want the Node title to show up. The Exclude Node Title module makes this situation or any other situation in which you need to hide a node title, as simple as a few clicks of the mouse.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 177. I am Shane Thomas, make sure to follow me on Twitter at smthomas3 and if you get a chance to take a look at codekarate.com, look at the EBook, check out some of the chitchits we’ve been releasing and let us know what you think or if you have any other ideas.

Today we’re going to be going over the Exclude Node Title Module and this is one of the simplest modules you’ll probably find out there but it’s also useful in a lot of situations. This will be a really quick video so we’re going to go ahead and just jump right in. The Exclude Node Title simply lets you hide the Node Title of various nodes on your Drupal site.

So the first thing we want to do is make sure we have the Exclude Node Title downloaded and installed which in this case we do. It has a number of permissions that go along with it. You can administer Exclude Node Title which of course is for the admins, you can exclude any node title, exclude your own node titles and this important was Use Exclude Node Title which simply means if you have the checkbox and you are trying to exclude that title you’ll actually see it.

The default permissions are usually pretty good to go so you don’t need to do much configuration there. So we’ll go ahead and leave that. There are configuration page for the Exclude Node Title modules under Configuration Content Offering and Exclude Node Title and it allows you to do a number of things and it’s all based on content types. So the first option, you can remove the Node Title from Search Pages if you would like, we’re going to leave that unchecked.

Here’s some information about translations if you want those to be synchronized but the important part is right in this section, the Exclude Title by Content Types. So essentially what you’re able to do is you go to the content type you want to hide the Node Title for. In this case let’s go to article. You can hide it for all articles or specific nodes. So let’s go ahead and select all nodes. Before we do I’m going to go back to the homepage. There’s a bunch of different contents in here but on the second page there’s a number of articles so as you can see with this word article are article pages on the site. So you see the title there if we go to the actual node page, you do not see the title because I had that configured earlier. But we’re going to go ahead and hide the title for all nodes and we’re only going to hide the teaser in this case just to see how that’s going to work.

So if we save it and we come back to this page you’ll notice the node title is now gone on all of those article nodes. If I go to the page though the node title is displayed. If I want to change that so it does not display on a full node page or the full content page, I simply click that checkbox and save and now the title will be gone.

If there are specific nodes, let’s say you have a page that you’re displaying on the homepage of your site and you did not want the node title to show up on the homepage, you could simply select the content type so it could be basic page but we’ll use article and select User Defined Nodes. Let’s only check full content for now and we’ll click Save. If we come back to our list of articles and we refresh, you’ll see that the article title is now there.

If we go into the article make sure we save this, I believe this was one was already checked. You’ll see there’s a check box here. Exclude title from display. If we uncheck that the title will show up and if we check it the title will go away. So let’s look at a couple of other articles here, now the title is gone. If we go to a node that is not an article, so this one is not an article node. You’ll see there is no checkbox so you can’t hide that node title.

So it’s pretty flexible in what it allows you to do. If you go to another article here you’ll see it’s not checked by default. You can check it, click Save and now this title will not be displayed. So there’s a number of reasons why this might be useful. So whether you need to hide a title on a specific page or there’s specific content types where the title just doesn’t create a lot of value and you want to just hide that from the user. You can use this module to do that.

So go ahead and try it out, there’s a lot of situations in the past where I’ve used the template .php file to hide titles or use a CSS in the past to hide title on a few pages. So this just kind of consolidates that and allows you to do it through a nice interface rather than having to write a whole bunch of small snippets of code depending on the site or the specific used case you need. So let us know what you think, check out codekarate.com and we’ll see you next time. Goodbye!

Tags: DrupalDrupal 7Drupal Planet

Drupal 7 Publication Date Module

Oct 31, 2014

Description:

Episode Number: 176

In this video we look at the Publication Date module. This module allows content creators to use the date in which the content on their website is published and NOT just when it is created. In other words, if you create a post a week prior to publishing it, this module will use the date in which the post goes to published. Again, this is a simple module but can be extremely helpful if you post a lot of content or have a habit of writing content days or weeks prior to publishing.

Full Text: 

Hello everybody and welcome to Episode 176 of the Daily Dose of Drupal. I am Adam and today we are going to be looking at a module that kind of came to me through some of the channels I’m subscribed through Drupal and that is the Publication Date Module.

This isn’t actually a very simple module and actually it comes in handy really well with Code Karate so I definitely wanted to take the time and show everybody this module and just give an idea of that it can do. So before we jump into that and do that demo I wanted to again just direct you over to codekarate.com.

A lo t of things have been changing here in the last couple of weeks we got a new logo which you can check out and we have a post about that so read about that and kind of how our brand has transformed over the last 12 months and even further back from that.

Also we just release our first cheat sheets which is in Drush and then coming soon hopefully within the next week of this post, one on a Get as well. So make sure to sign up for those and you’ll receive those absolutely free. Alright so let’s get down to this module. Again we’re looking at the Publications Date Module and we’re going to using of course the Drupal 7 version of this module. There is a Drupal 6 version available but I’m going to be using 2.0 Drupal 7 version. So what this module does is it allows you to have content posted or published based on the Publication Date.

Typically when you post content with Drupal and uses the created date or revision date, well that isn’t necessarily that date you are publishing it to the public. For example at Code Karate we will write blog posts that haven’t set unpublished for maybe a week at the time. So once we go to publish them we want to use the new published date or the current date and not the date in which we created it so people can easily sort it by the newest content on the site. And that’s what this module is going to do. It’s going to allow you to use the actual date when the content goes live.

So what you do, again really simple, we’re just going to turn this module on, let’s go to modules, location date and you can see I already have it on. There is nothing to configure with this module but once you turn it on it does add a field to your content types so if I jump over to a content type I have here and I scroll down and look under my Publish option setting.

This Publish On field is the field that adds to your content type. If you look at the modules page it talks a little bit about that and you can also use in a template file by adding this field Node Publish Add. So if you wanted to use it in a template file you could do that as well but we’re not going to need that for this video so we’re going to hop back here again so it’s Unpublished on and then you can see there’s a Publish field as well.

So I’m going to show how to just add and how it works. So if I want to add a new piece of content, so say I want to post a blog article or something to my site and I’m going to want keep it live in a week or I’m writing it today. So I’m just going to come in here and select his one and I’m going to put…so I’m going to put that and place some text in. So in theory this is a short little post that I’m going to do.

So I’m going to come here and say I don’t want to publish it that’s why I’m publishing everything right now. So this is just something in the Q, I’m going to save it and you’ll load here, I’m going to see this field printing right here. This is actually the created date timestamp. So I’m recording this at 10/30/2014 at 6:50 in the morning. So you can see that this is not the published date. But technically it is at the moment but there’s nothing published, it’s unpublished. So we’re just going to let this been here in one minute and then I’m going to publish it and you’ll see the change. So if we hop back to this, I’m actually using this, it integrates really well with views.

So on this view you can see I’ve added the Publish Ad field so this will show the newest published date once I publish the content so you can integrate with views which is kind of handy. So now that my time is switched to 6:50 to 6:51i could show you the difference. So if I go back into my content up here, let’s note one thing here. Note that nothing is appearing in my field.

This is where the content will appear but if I go to my content and I see I publishing date test which I just created and then I go ahead and select my publish options and select Publish. Now I’m going to leave this Publish on field blank. But according to what it said here is if you leave blank it’s going to use the time of submission, the time it goes published. So if I click publish and then I go look at the view where it’s going to be displayed, I’ll see right here it says 6:51 and it’s kind of the value that show in that but right there it’s the thing I just created so it says there October 30, 2014 at 6:51 which remember if I went to create it it was 6:50.

I didn’t actually have to input the publish date to get it. Now once you’re already saying, well there’s always around this and you can and it’s true. There’s a way to do this, one each is if you go into content, instead of…say we don’t have the Publishing module on, you could just cut me into other information and go ahead and delete that Altered On Time and then save it and then it’ll automatically use the current time of the submission which is leave blank to use the time. But that’s just another step to do, it’s kind of up to you whether you want to use it or not, if you post another content like we are, it comes in handy to use something like this but maybe of course it is your choice, it is a simple module at the end of the day but that’s what it does.

Again it integrates very well with views, you can use it in template file as well. So there’s a couple of different uses for it, you can customize of course the different display options for the timestamp. It doesn’t have to display in this format, by any means you can customize that using a custom date field. So that is the Publication Date Module.

Okay I think that’s it for today. Again make sure to head over to Code Karate and check on everything on what’s going on, love your feedback and a new logo and your thoughts are always helpful and again make sure you get that cheat sheets, they are free and available for you. Alright guys until next time. Thanks.

Tags: DrupalFieldsViewsDrupal 7Drupal Planet

Finding the right brand

Oct 29, 2014

Description:

If you have been around CodeKarate.com for awhile you have noticed that our branding has been, well inconsistent. In less than a year, we have managed to swap in and out three different logos. Each logo I suppose tells a story of Code Karate and played an important role in getting Code Karate to where it is today. As we embark on what we believe to be a turning point in Code Karate we wanted to share with you our old logos and show off our new logo.

Code Karate First Logo

Type: TextTags: Drupal PlanetUI/Design

Entity Reference View Widget

Oct 24, 2014

Description:

Episode Number: 175

If you have ever built a site using the entity reference module, then the Entity Reference View Widget module is a module that you should know about. It isn't always necessary, but can be a lifesaver if you have a lot of referenced content that you need to sort through and select from on your Entity Reference fields. This is a good replacement for using a traditional autocomplete field for your entity reference fields..

In this lesson you will learn:

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 175. I am Shane Thomas, you can follow me on Twitter at smthomas3. Also make sure to head over to codekarate.com, learn about the EBook, check out all the various posts about Drupal and learn how you can get your own Drush cheat sheet for free.

Today we’re going to be going over the Entity Reference View Widget Module. This is a really handy module and if you’ve watched other of my videos on the Entity Reference Module there’s a number of them and how the Entity Reference Module can be used to build out really complex functionality on Drupal websites. So this is just another module that adds on top of that and it works really well at allowing you to easily select related content or reference content.

So we’re going to go ahead and come over to our test site here and we’ll show you that I have the module installed. So if you see the Entity Reference Module is on and the Entity Reference View Widget Module is on. I also have two different contents we’re going to look at, one is called Conference Room and one is called Room Items. So essentially what we’re going to want to be able to do is when we create a Conference Room content type we want to select the Room Items that are going to be available in that Conference Room. So Room Items is a very simple content type which is a title and a body and we’ll go ahead and look at conference room which is the same thing right now which is the title and the body field.

We want to go ahead and add a reference field so we can select the various room items that are going to be in this Conference Room. And this can work of course in any type of related content, select Entity Reference as the field type and the important part here is under the widget section, select View. This becomes an option as soon as you have the Entity Reference View Widget Module enabled. So we’re going to click Save, we will leave the rest of these at the default here, click Save. And now you need to select the view.

I already have one I was testing earlier, however in most cases you might not have a view available here so you have to create one. So in order to create one we’re going to go into Views, make sure you have the Views Module on of course and the Views UI Module. So we’re going to add a new view, we’ll call this Room Items Entity Reference and we’re going to show content of type Room Items. We do not need to create page or a block here. So let’s go ahead and say we want to continue and edit. So let’s add an Entity Reference View Widget to our view and let’s just click Save to see how that works. So now we can refresh this page here and select the Room Items Entity Reference View.

We will leave all the rest of the defaults except we will change the number of values to Unlimited and click Save. Now of we want to add a Conference Room, we go to add Content Conference Room and you’ll see there’s a title, there’s a body and then there’s a Room Items section here. So there’s no items have been added but you can click Add Items and it launches this widget here where we know that this doesn’t work. You click on it and it doesn’t do what you’re expected to do. You can’t really actually add the items, you can click that and doesn’t work. So what we’re going to do is we’re going to make this work. So now that this is set up on the content type, it’s all on the view. So we have to configure the view correctly.

So the first thing that I typically do is change this from Show Rendered Entity to show fields. I also change the unformatted list to a Table which is easier to look at. So now we have our title field, let’s also add a few additional fields. The important field that you have to add is this Entity Reference View Widget checkbox. So we’re going to add that and we will move it to the top. Now let’s go ahead and save and see if it looks a little better. Should at least be usable at this point, so if we come into the Room Item Section click Add Items, you’ll see now we can select the various items as…looks like five items to select from, you click some of the items, you click submit.

Now if you close out, the items will show up as reference, you can uncheck it, if you click Add Items you can change these items using this view widget. You will notice that it kind of works but it doesn’t work really well because if you click Add Items we have Whiteboard and Projector B selected. It doesn’t show you anywhere that these items are already selected. So if we select Projector A it just adds that item to the list. So there’s a number of things we can do to clean this up.

The first thing we’re going to do is clean up the fields a little bit. So we’re going to remove the label here, we will add a label to the title field just to clean up that view. We will also add the post-date field and we’ll have add the updated Date Field. These are not necessary of course to get it to work, just going to make it a little easier to read and provide us a little additional information. It’ll also show that you can add any fields that you want to this view. So let’s say that the next step is going to become into our content type for Conference Room, go to Manage Fields and go to the Room Items Entity Reference Field.

There’s a checkbox here to past the selected entity IDs to the view. What this does is any items that you checked when you reopen that views widget is going to automatically be passed into the view. And while that’s important is because if you pass in the already checked items you can then remove those from the view so they can’t be selected multiple times. It’s also nice to close the window after you submit the items so you don’t have to click the little close box from the top corner. So we’re going to check those boxes.

Now we will come back tour view and this is where the important piece happens where you actually can filter out the already selected items. So in the advance section in your view you want to add a contextual filter. Since this is a content, this is a node, you want to find the node NID. If this were other types of content such as users you’d use the User ID whatever the ID field is. You want to add that contextual filter. In the More section there’s two checkboxes we need to check. We want to allow multiple values and we actually want to make sure that these items are included from the view.

Once we have that we should be about good to go so we will save. We will try to add a new Conference Room, when I click add items you can see we have a More Information here. We can select a couple of the items, click Submit and they automatically pull in here. If you go to Add Items you’ll notice now that there’s only three because it’s actually excluding any of the items that are listed here inside that view. So now they’ll only be two. If we do not want those anymore we simply check them and they’ll be back on this list.

You can also use this to select or unselect it all. So as you can see it’s very handy and one more thing you can do which is useful if you are going in searching a large amount of items. You can add some things to your view to make it work even better. Now you can make the table sortable so you can click and sort things. We can also add a filter to the view that you can actually use to search. So if you want to search title we will add a title filter and we want to expose this filter so it’s an exposed filter and we will say for the operator it contains and we will click Apply All Displays.

We’re going to change this Ajax to Yes and then click Save. I want to see if this is actually going to work here. Let’s go ahead and try to add some new contents so we’ll just start with blank. We’ll call this Room 1, we’ll leave the body empty and we’ll go to Add Items. So you’ll see we have some items here, if we want to search for projector you can see it limits down our items, you can select that, click Submit, you can also then come back in here and add some additional items. So as you can see if you had a ton of items to search through or you have a ton of reference content that you needed to sort through being able to add sortable columns to your table and also expose filters. It makes it a lot easier to do.

So that’s all we’re going to go over today. The Entity Reference View Widget Modules are really cool little modules so give it a try. Make sure to check out codekarate.com and let us know if you want to see any videos in the near future and we’ll see you next time. Thanks for watching.

Tags: DrupalEntity ReferenceDrupal 7Drupal Planet

Drush Cheat Sheet

Oct 21, 2014

Description:

As developers we always are looking for ways to become more efficient. After all, time is money.

One of things we found that always cost us more time than needed was remembering Drush commands when building our Drupal websites. Obviously, Google will find thousands of sites with this information, but just having a sheet laying on our desks seems to provide the answer faster. Remember time is money.

Type: TextTags: DrupalDrupal 6Drupal 7DrushDrupal PlanetDeploymentTips and Tricks

Drupal 7 Absolute Messages

Oct 17, 2014

Description:

Episode Number: 174

In episode 174, we look at a new way to display administrative messages. In other words, absolute messages is a module that changes how status, error and warning messages are displayed. For the most part, this is a nominal improvement, but does allow for hiding and showing of messages.

Tags: DrupalMessagingDrupal 7Drupal PlanetSite AdministrationUI/Design

Drupal 7 jQuery Countdown Timer

Oct 15, 2014

Description:

Episode Number: 173

In episode 173 you learn about how to make a simple countdown timer using the jQuery Countdown Timer module. This module, which uses jQuery, allows you to specify an end date which the countdown timer will countdown to. The countdown timer is available as a block and can be placed in any region that you desire for your website. Also, at this recording their was a minor bug that didn't allow for countdown dates to extend beyond 100 days (wouldn't display the third digit).

Full Text: 

Hello everybody! This is Adam and coming to you with Episode 173 of the Daily Dose of Drupal. Exciting. Today we are looking at the JQuery Countdown Timer Module. This is a very very simple module but definitely comes in handy if you’re using Countdowns to certain dates or releases or anything like that. Really simple and has nice interface and kind of cool display.
So we’re going to quickly jump in to that here and show you and I’ll just show you how to fix this small little path with this module. But before we do all that we always need to do our housekeeping things. One of which is you head over to codekarate.com, make sure to check out all the videos.

We’re approaching 200 of the Daily Dose of Drupal videos as well as a handy of awesome blogs as well. of course make sure to check out the 200+ page EBook on becoming a Drupal 7 Ninja. We definitely have a lot of good feedback from that, definitely worth your time as well. Anything else? Obviously Twitter, you can follow us on Twitter, following shane @smthomas3 and myself @adamlearing, you can do that as well.

Let’s get to the module. So again, we’re using the JQuery Countdown Timer Module and at the time of this video I am using 1.5 in Drupal 7 as my version. So kind of important to note because if you’re watching this later on, they might fix this bug and then we’re going to go over. So just note that I am using the 1.5. Alright, so simple, begin and install, again just drop it in to your sites’ all modules or wherever if you’re using all these sites. It could be in this site module’s folder but otherwise drop it in, make sure you enable the JQuery Countdown Timer Module and that’s all you need. It does require the date API Module as well so make sure you have that and installed it and enabled.

So once you get it enabled, all you need to do is go under your structure and inside your structure blocks and what this does is it just creates a one block for you and it’s called the JQuery Countdown Timer Block. So we can first load it, I should say it will in the disabled field so just turn it on and enable it and then we’re going to configure it. Pretty simple standard configuration of a block.

You’ve probably seen it in the past here in Drupal. You can give it a title if you want. Obviously you can use None to display nothing or just leave the field blank. It gets up the font size of the display and then here’s where you can set basically the date that we’re going to countdown to. So I set this to 2015, November 10th. Let’s just change this to 2014 so I can show you something. You’re going to set where you want it to appear and then if you want it all in some certain pages, we’re trying to say only show on front page.

So I’m going to save this block and then I’m going to refresh my homepage and if I scroll at the bottom you’ll see that it says I have 31 days, 0 hours, 43 minutes and a bunch of seconds remaining until the countdown date which is awesome. That’s what its working, what we expect. One thing I notice is there’s a 0 here in the third field. Without using this patch where I’m going to show you it will not display that third value field.

So for example if we hop back into here and change this to 2015, so that’s going to be 300 and some days until today because we’re filling this on October 10th of 2014. So if I save the thing and refresh again my homepage, this 31 should become 390 something…96 days. So without this patch, what we would do is first we would only display the 96. It would correctly to say down here it would be 396 days but the timer would only say 96 which would lead you to believe 96 days and actually it’s 300. So that means we have to use a patch.

So if you actually look on the J Query Countdown Timer page underneath Issues, you can actually find that somebody posted a patch for this. Right here, code to provide 3 digit days in countdown. So if you click on that and you have scroll down here and read some of the comments, you end up coming across this patch by Silicon Mind, if you open that up it shows you the patch that you can implement into the JQuery Countdown Timer JS file and doing this will allow you to get the 3 digit timer to display which is this.

So I’ll hop over here quickly and show you the code. So this is the finished one, I already patched this file but if we look at the file, it can kind of show you a couple of things that change. So for example if we needed to change the difference of the days left, update duo, so if we look at that, you can find it here, you can see here we patch that, we patch this, basically we just change the number scheming there. For those of you who are not familiar with patching, basically how it works is you see a minus sign. That basically means this line needs to be edited or taken away and change to the line below it.

So update duo, whatever one do, so this line right here, before that line said 0 common, 1 common. I changed it to the 0. Below hand there’s more changes but again it’s really simple, you just got to find it and replace what needs to be replaced. They also give you the line numbers up here on the code files. It makes it a little easier to find. So anyway, after you input all these changes, save it and then refresh your page, you’ll be able to see the three digits displaying in the counter timer if applicable. Of course it has to be…it has a relative value on this, it be over a hundred days away.

I will include.js file on the post here and put at the bottom of the page so in case you just want to drop it in, but again it’s important to note that when we’re filming this we’re using 1.5, my guess is this will get included on a later version of the J Query Countdown Timer so you might not even need to implement the patch. It might just come downloaded with the module.
So just note that just try it out first, if it doesn’t work then use the patch that’s provided. Alright that’s it for today’s video on the Countdown Timer. If you have any questions, post it on the comments, otherwise until next time, see you.

Tags: DrupalBlocksDrupal 7Drupal PlanetJavascriptJQuery

Creating a Drupal 7 Entity Reference View

Oct 10, 2014

Description:

Episode Number: 172

The Entity Reference module not only allows you to reference entities within your Drupal site, it also allows you to do so using a custom created entity reference view. This allows you to leverage the power of the views module to control how the entity reference selection field is displayed.

Just getting started with the views module? Check out our Intro to Drupal views.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re going to be going over how to create an Entity Reference View. If you followed past episodes of the Daily Dose of Drupal you know we’ve covered the Entity Reference Module quite a bit and we’ve even had an episode where we covered how to use the Entity Reference Module to create relationships within Views.

Today we’re going to be actually creating an Entity Reference View and you’ll see a little bit what that does and why it might be useful. I am Shane Thomas, you can follow me on Twitter at smthomas3, also make sure to check out codekarate.com to check out all the videos and posts and learn more Drupal. So let’s go ahead and get started. I have a simple development site here with a couple of articles on it and we’re going to use the Entity Reference Module to just create a way to relate or reference related articles.

The first step is to make sure that we turn the Entity Reference Module on if it’s not already. As you can see we’re using 7.X-1.1 right now. So we’ll go ahead and save that. The next step is going to be to create our Entity Reference Field so I’m going to go to the article content type and go to Manage Fields. I will be adding a new Entity Reference Field and we’ll just call it Related Articles. We will go ahead and leave it at checkboxes and radio buttons so we can easily allow multiple articles to be referenced.

Here you can select a couple of different options. We want to be a node and we want the article to be the option we select here. And here’s the important part, for now you can originally and we’ll show you how this works. There’s two different modes, there’s the Simple Modes with the optional filter which is what we’ve used in the past and there’s a Views Filter by an Entity Reference View.

So let’s start with a simple mode and we’ll see how that looks and then we’ll come back and we’ll look at actually creating that Entity Reference View. So let’s go ahead and save this and now if we come back out here and we create a new article, you’ll see at the bottom I can select Related Articles. But actually we’re going to want that to be a checkbox instead of radio buttons there. So we’re going to go ahead and change that to allow multiple values. So we’ll go ahead and say that it can be an unlimited amount of values and we’ll save that. And now let’s look at creating an actual Entity Reference View.

This is useful if you want to control how the ordering and the display of this field actually shows up. So as you can see right now it’s just showing Test Article 1, Test Article 2, Test Article 3. We may want to sort this by various different things. So we can go ahead and use Entity Reference View to do that. So we’re going to go ahead and add a new view here and we will go ahead and select that we want to display content. Let’s call this Article Entity Reference. So let’s call this Article Entity Reference, we’ll display Content of Type Article.

We don’t want to create a page or a block. We’re actually going to be creating the Entity Reference View so we don’t need a page or a block. We’ll go ahead and click Continue and Edit. Now you can click Add here and you can add Entity Reference as an option. This will add the Entity Reference View. As you can see it shows all content that’s published and is a content type that is Article. You can sort by postdate or whole bunch of different things since it’s using the power of Views. So let’s just keep it simple and let’s just save it. You need to select Search Field.

So when you’re creating Entity Reference View you need to select the Search Field. So if you come in here you can select the various search field and this shows any field that you’ve added to the View so you can see there’s content title. And this is the fields that will be searched when using the autocomplete widget. So if you are using an autocomplete it will search through any fields that you check in this selection right here. So go ahead and use that, click Save and now we have our first Entity Reference View.

Let’s go ahead and just see how that shows up, we’ll come back into our content type, go to article manage fields, go to our related articles field and edit that and we’re going to change the mode now to Filter by an Entity Reference View. There’s only one Entity Reference View showing up and that’s the one we just created, Article Entity Reference. If you have any arguments that you need to pass in you can pass arguments directly into the view. In this case we’re not going to do that. So we click Save, now if we go to Add Content Article you will see that everything looks the same except now there’s a link here which actually links out to the Article and that’s because it’s actually using that View which has the links set up already. So let’s go ahead and take a look and see what else we can add here.

So we will go to our Views. Article Entity Reference View. If you click on Title you can see it’s because there’s this checkbox for link this field to the original piece of content. So if we uncheck that that link will go away. We may also want to change our sorting. So instead of sorting by postdate, let’s sort by title and let’s go ahead and go descending since I believe…we’ll start with ascending and see if that changes it. I don’t remember the order that was in so we’ll try that out. We could additional fields here, let’s try adding…let’s see if we have anything in here that we want to add. We can add the author user ID, you could link that or reference that to the actual author itself and use username or any other field that’s on this content type. There’s not a lot of fields.

This is just an article content type but you can see how you can use the power of Views to build this however you want. So let’s just show this for now and see this turns out. So we’ll save that. If we go into Add a new article now you can see not it says Test Article 1, Author you ID and Type Article. So you can see you can do a whole bunch of stuff within Views. If you’re familiar with Views you’ll know that you can pretty much change this to look however you want. You can then create articles and reference other articles within it.

So if I create a Test Article 4,we can upload image if I wanted to, I could pick articles that this is related to and I can click Save. I thought that was the title in the Tags field so we’ll try that, and there you go. So it works, you can then change…if you’ve used Entity Reference you know how to change the display, how this displays on the actual Node View page.

So you pretty much have the power of Views in your hands and you reference content with ease. Go ahead and give it a try, let me know if you have any questions about how it’s useful or how to get it to work and we’ll see you next time. Thanks for watching.

Tags: DrupalEntity ReferenceViewsDrupal 7Site BuildingDrupal Planet

Drupal 7 Search Krumo Module

Oct 3, 2014

Description:

Episode Number: 171

The Drupal 7 Search Krumo Module extends the Devel module and makes it easier to debug PHP variables while developing Drupal modules or building Drupal themes. It adds a simple search box that allows you to quickly search through the Krumo output that is generated by the dpm function.

If you want to try it out quickly, simply download and install the module and run the following code on the variable you want to debug:

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 171 and we’re going to be going over a few module development tips to help you easily debug variables and when you’re building a Drupal modules and when you’re working with PHP.

As always I’m Shane Thomas, you can follow me on Twitter at smthomas3, also make sure to check out codekarate.com, take a look at the EBook and look at all the other videos and post on the website. If you have been developing Drupal Modules for a while or just getting started, you may have heard of the Devel Module.

This is a very helpful module to easily help you develop Drupal Modules and debug code as you are working through building your Drupal Modules. But today we’re going to look at the Search Krumo Module, adds on to the Devel Module and makes it just a little bit better.

The first thing we’re going to do is take a look at our Drupal website. We have a simple Drupal 7 website and for this example we’re just going to assume we want to take a look at this little search form here. We just want to look at the form array that builds this search form and we want to use the Search Krumo Module and see how that can help us do that.

The first thing is to look at the modules we have installed. I have the Devel Module turned on right now. I do not have the Search Krumo Module on yet, we’ll be turning that on shortly. I also have a simple example module. So let’s go ahead and take at what is in that example module. Just a really simple info file and the module file has a Hook Form Alter function and I have some code that checks to see if it’s the Search Block form because we only want to look at that specific form.

So typically, the way I’ve done it in the past and I still do it sometimes to this day is I use a print statement, something like this. So I may print out the form variable, if I click Save, if I come back to our Drupal site here, if I refresh I’m going to see the output. As you can see I get output saying it’s an array, there’s a search block form element, it’s a text field you can go through and I can see all of the information. This is kind of nice sometimes because you can see it laid out in the structure.

However it very quickly becomes a little unmaintainable or unmanageable when it gets to be very long. There’s a lot of forms or variable you will debug in Drupal that are extremely long and just not practical to use a print statement like that. With Devel you can use a DPM function which is a simple print function that prints out a nice easy to click through option.

So if we use the DPM function instead of just the simple print function you’ll notice in the status area of your Drupal site there is the variable printed out you can click through. So I can see there’s a search block form, I can even see the default value here we can click through and see all of the different…basically all the different options and settings for that specific array that we’re going to take a look at. So that’s another option that comes with you with the Devel Module. Searching through this can still become a problem when it gets to be very long and that is where the Search Krumo comes in.

So let’s go ahead and turn that module on and click Save and keep in mind with my code I still just have this DPM function here and I’m printing out the form variable. Now if I come back here and I refresh you can see there’s a search box here. Everything else looks the same, you can see I have this little Get Path option. Let’s go ahead and search for default value. If I search you can see it highlights every word, it finds the default value. You don’t have to search just the index of the array. You can actually search for values within the array so I can search for instance Terms here and then you have the terms 1 highlighted.

So as you can see that works out really well and makes it very easy. You can notice if I hover over a Get Path it’s going to allow me to copy this variable. If I wanted to change the default value I just click the Get Path, I can copy that, paste it in my code. Let’s say I want the default value to Search. I do need to change this Var to Form because that’s the name of my variable. I will come at this out for a second. Now if we come back here, the default value is now Search.

There’s also another function that is added when you use the Search Krumo Module and it’s the SDPM function. It’s almost the exact same thing, there’s only a very small difference so you can use that. You can still search for the default value, it will open it up and show you. Now if you click Get Path you’ll notice it replaces the variable name with the correct variable name.

So now I copy this over, I can paste that in and I can say I want this to be search with an exclamation point this time instead of just Search, comment that out and refresh. I forgot a semicolon here so I’ll add that semicolon and refresh and now you have Search with an exclamation point as the default value for that form or that text field.

So that’s really all there is to it with the Search Krumo Module are really simple but extremely handy module if you’re developing themes or modules with Drupal. Anytime you’re working with PHP variables on a Drupal site, the Search Krumo Module is incredibly handy. So go ahead and try it out, let me know what you think. If you have ideas for future videos let me know, make sure to check out codekarate.com and we will see you next time.

Tags: DrupalDrupal 7Module DevelopmentTheme DevelopmentDrupal PlanetTips and Tricks

How to use n:th child to style views

Oct 1, 2014

Description:

The Problem

Style this using views and CSS. What you are looking at below is a view being displayed as a grid. This is by far the easiest way to display content in a nice looking grid view, but as you will read there is a MUCH better way.


Type: TextTags: DrupalContent TypesViewsDrupal 7Theme DevelopmentDrupal PlanetTips and TricksUI/DesignCSS

Drupal 7 jReject Module

Sep 26, 2014

Description:

Episode Number: 170

In this DDoD we look at the jReject module. This module allows you to display a modal popup notifying the user / visitor that their browser is outdated and wont work well with the site. In the video, you will see that jReject comes with a wide variety of customizations to fit your brand and preferences. Another important thing to note is that jReject unlike other similar modules allow you to display a popup based on other browsers besides the common Internet Explorer.

Full Text: 

Hello everybody and welcome to Episode Number 170 of the Daily Dose of Drupal. I am Adam with Code Karate and today we’re going to take a look at the J Reject Module. What the J Reject Module does is it allows you to set different browser blocks basically. So you don’t want users to use IE 7 for example, in your website. You can pop up…Java Script pop up that says, hey this website is not optimized for it, this version of your browser recommend you upgrade.

This j Reject Module works nice about this. It allows you to provide them different options to upgrade too and you can also set with multiple different types of browsers which you don’t want to have your users using. So we’re going to get into that in a little bit but first as always, make sure to head on over to codekarate.com. There obviously you’re going to find 169 other Daily Dose of Drupal videos, as well as our 5 Secrets To Becoming A Drupal 7 Ninja EBook. Make sure to check that out. We appreciate how far we can get.

Also let us know if you want to see any other videos made, you can always touch based with us under the contact page on the website. Alright so let’s get going. So back to the J Reject Module. Pretty simple module, once you get it installed there’s one little extra feed thing you need to get running which we’ll show you how to do here. But otherwise just go ahead and download the module from drupal.org and then once you do that you’ll also want to get the turn wheel J Reject Java Script files and stuff. You can use that through Get if you’re comfortable of using Get commands. Otherwise you can simply go to Get hub on the branch and download the zip file from their and drop it into your module’s directory.

So that’s what I’ll show you right now, it’s just that version. So if you download the zip file and hop over to your FTP client or however you’re doing that. And then once you have the J Reject Module installed it will be under your module’s folder here. So that’s under Site’s All modules and J Reject, and then make sure you make a folder inside of J Reject and call it J Reject and then you drop in all of the stuff from Get Hub in there. So that’s when you download the Zip folder, you’ll get all these files within and as you see they’re all laying within this J Reject sub-folder. So that’s all you have to do to get the module installed and the library set up correctly.

So come on over to your configuration page. I’ve already turned the module on but under Configuration System there’s a J Reject Configurations area. Go into there. By default this is going to be not enabled so make sure you check the J Reject enabled that’s just going to turn it on and allow all your configurations to take place. And then there’s just a bunch of different settings that really lets you customized exactly what you want the pop-up to look like including text, colors and such. So you have here headings, couple of paragraphs, you can customize how you want your message to be displayed to your user.

The closing message, what the message is going to say and then if you wanted to just redirect them, after you click Close you have different URL. Otherwise it will just close out the model box and then it’ll load the page that they’re currently on but you can redirect. Underneath the Option settings. So you can allow them to close it, you can obviously allow them not to close it which is a little risky from user experience area but if you want you can uncheck these boxes and allow them not to close the pop over. You can also set the overlay colors, how much opacity you want, fades and stuff like that. So it gives you all the options you need here.

And one thing to note is you can do an integer fade in and fade out so just make note of that. So the last two one are browsing configurations. So this is the kind of the meat of the module. This is setting all of the browsers that you want the pop up to show up on. So if the user comes into your site and is using Internet Explorer 7, the pop-up will show. If they are using Internet Explorer 8, the pop up will not show because they don’t want the box checked.

You can also segment on Firefox, Chrome and Safari and Opera. So there’s all kinds of different options and that’s really what makes this J Reject Module better than the other ones that are out there in Drupal, is you can specify other browsers besides just Internet Explorer. Even though Internet Explorer typically is the ones with the most issues from the display side.

So once you get those set just make sure you apply while saving the configuration and then the last one is the Browser Alternatives, and these are the options that are going to appear in the pop up for that to download and upgrade the browsers. Typically, I don’t include Internet Explorer because I hate Internet Explorer so would uncheck that. And I also don’t like Google Chrome frame, that just loads Google Chrome within the Internet Explorer browser, not that useful. I’d prefer them just not using Internet Explorer at all. So I always give them options for these four and then I’ll save the configuration.

So now once they go to…if they’re using a browser that I don’t like, Firefox, Safari, Opera and Chrome will be the options they can download and these basically just takes them to those respective websites and it allows them to download from there. Alright so now I’m going to hop over and show you what this display is by using probably Internet Explorer as my browser. Alright everybody, so now we’ve hop over to Internet Explorer I’m going to show you what the JReject display looks like when you’re using a browser and you’re specifying a user to use.

So as you see now there’s nothing appearing on my screen and that’s because I’m using the most updated version of IE. I believe I’m probably using IE 10 but within developer tools in IE you can switch the version so if you go to that and in the under here document mode, we’re going to switch that to 7 and once I click that to 7 it’s going to reload my page for me and once it does then my pop up and my J Reject pop up is going to appear.

If I minimize that here, now you can see I have Mozilla, Safari, Opera and Chrome and if you remember, those are the ones I specified for it to show up on. So then again all of these links do is they link off to the newest…actually the website for these browsers so the download would be on that page. I also…like I said I didn’t change the text here but again you can customized all these text within that, customized the background color, you can obviously make this close window not even show up so they have to download a new browser or go to a different website. Again I don’t recommend doing that but that is your choice.

So that is what the JReject Module does. So other than that, again make sure you download both the JReject module and the Library and install them correctly on your website. Other than that you can head over again to codekarate.com and check out our EBook and connect with us in a lot of ways. Alright, talk to you later.

Tags: DrupalDrupal 7Drupal PlanetTips and TricksJavascriptModal Forms

How we beat the (insert word) out of SPAM comments

Sep 24, 2014

Description:

As with all sites that are growing you inevitably are hit with SPAM. In our case, we were getting around 50 SPAM comments a day, besides the obvious benefits of knowing how to acquire "Cheap Louis Vuitton handbags", all these comments were getting annoying to clean out on a daily basis.

Type: TextTags: DrupalCommentsFormsDrupal 7Drupal PlanetSpam Prevention

Drupal 7 Honeypot Module

Sep 19, 2014

Description:

Episode Number: 169

In this tutorial you will learn about the Honeypot module. The Honeypot modules is a SPAM prevention module that uses a hidden form field to catch SPAM bots from posting onto your site. This tutorial shows you how to configure the module to work on various forms on your site.

Full Text: 

Hello everybody and welcome to Episode 169 of the Daily Dose of Drupal. Today we are looking at Spam prevention, it’s specifically the Honey Pot Module. As your site grows and you become more famous and get more visitors you inevitably are going to be hit with spam comments, spam user accounts and pretty much everything else. So unless you’re interested in cheap a little bit time handbags, the Honey Pot Module is a good resource to get rid of spam comments.

Before we jump into the module and show you how to set it up make sure to head on over to codekarate.com and then once you’re there check out the EBook, check out our other posts, interact with us in any way. Also you can check us out on Twitter, Google Plus, all kinds of places so make sure to interact. Alright let’s get started. So the Honey Pot Module here on Drupal, basically how the Honeypot Module works is it adds invisible field to any form that you specify and as a user you don’t see this field so you won’t fill it in but basically it doesn’t see the form right so it fills it in and then once that field has any information inside of it, it automatically spammed or caught it spam and then not posted to your site.

So that’s how the Honeypot Module works and setting it up is actually even easier than that. So go ahead and download it. We’re using the 7 version of this. It does have an 8 version already out so that’s nice. Pretty widely used here with 35 and a half thousand installs. So anyway, let’s get the module installed here, there it is, we’re just enabling it, once it gets enabled you can then go here and configure and then we’ll kind of work through the configuration page and that’s about it for the Honeypot Module.

So you can do a default protect all forms, that’s kind of what it sounds like. You can add the Honey Pot functionality to all forms on the site. I don’t necessarily doing that, I’d recommend setting it to only once that you specify. You can obviously block submissions via Honeypot so any…or excuse me, not block, logged at these submissions. This gets over, it can just get a lot in there. Of course if you have a lot of spam comments so none certainly needed but you can turn it on and just end up in your Reporting tab underneath Logs. This one is the invisible field, what the name of the field will be.

You can leave a default URL, sometimes you can change it to just a homepage and basically that’s just what the bottle COs, CO of field called Homepage and then it obviously want to add a homepage element to that but we’re actually tricking it. So I’ll leave all of your homepage for the example. Honeypot Timer, this one is kind of an interesting feature as well with Honeypot. Is it basically says if you load a page and if you submit the form within as specified here, 5 seconds we’re automatically going to think that spam and not that let that comment go through.

So you can set this time to 0 to say, don’t worry about that or you can set it to a higher or lower, 5 seconds seems to be a good general rule. So then here below is all of the forms that you can individually enable the Honeypot to work with. Some of the ones that we recommend with the user registration form, how it eliminates spam accounts. Any form that you get…that goes outside of your site. So it’s the contact forms and then the big one will be Comment forms. So I always would check all of the comment forms. So anything that you allow users to comment on is very likely to get spam comments. So eliminating those will cut down your amount by a ton.

This note forms, that kind of skip over that. The reason note form isn’t that relevant is because you don’t typically give access for users to create nodes on your sites so it’s not usually relevant to use the Honeypot Module on that. And that’s the other reason why I said don’t necessarily do it in all forms because it’s very much a wasted functionality. So this is what…I’m going to get the contact form too here. So these are the ones that I would say by default I would use. Again just a user registration forms, any other generic contact forms you might have and then comment forms as well. So you can go ahead and save that configuration. And that’s it.

So the Honeypot Module is now enabled on these forms that I set and again the form field to use, the end users are going to be hidden so you’re not going to be see any difference with your comment forms or either with your users but to bot they’re going to see a hidden field in there and they’re going to attempt to fill that form in. Alright guys, well that’s it for the Honeypot Module, make sure to check out all, I’ll have a blog post coming out here shortly as well, detailing how we sue the Honeypot Module at codekarate.com and the success and issues that we had using that as well. Alright until next time, see you.

Tags: DrupalFormsWebformDrupal 7Drupal PlanetSpam Prevention

Drupal 7 Entity Registration Views, Access and Wait List

Sep 18, 2014

Description:

Episode Number: 168

Following up on the previous Daily Dose of Drupal episode on the Entity Registration module, this episode looks at some of the additional Entity Registration add on modules.

In this episode you will learn:

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 168 and if you remember from last time we’re working with the Entity Registration Module. The Entity Registration Module allows you to set up events and allow users to register for these events so it’s great for training or webinars or anything where you want someone to be able to register for specific event on your Drupal site.

Before we get started I am Shane Thomas, you can follow me on Twitter at smthomas3, also make sure to check out codekarate.com, sign up for the newsletter and learn about the EBook, The Five Secrets to Becoming a Drupal 7 Ninja.

If you haven’t watch the last episode you might be a little lost so you might want to go back and watch the first entity registration video, but if you’ve already watched that we’re going to go ahead and get started. Basically the only things we’re going to do today will be to look through a few of the other modules that come with the Entity Registration Module.

So last time we went through just the Registration Module itself, this time we’re going to go through what the Registration Entity access module does, what registration views does and what the registration waitlist does and how those can be used. So let’s first open up our training event that we created and this should look familiar from last time. It has two registrations already completed. As you can see there is a registration form.

The first module we’re going to look at is this Registration Entity Access. So let’s go ahead and turn that on. Once that module is turned on we’re going to come back over here and refresh. Everything should be about the same. So let’s go ahead and click on Settings inside the Manage Registration and this is on our event. You’ll notice at the bottom now everything else should be the same however at the bottom there is a section called Roles That Can Register. And what this allows you to do is it allows you to change…in this case on a per event basis what roles you want to be able to register.

So it gives you a little bit more access control especially if you’re creating a ton of events or other types of registration forms that you want to be able to control access to. If you have other roles in their certain instances where you want only certain types of users to fill out the form then this module can help give you that flexibility. And that’s all there really is to the Entity Registration Access Module, so that one was pretty quick and easy.

We’re going to look at the Registration Views Module. But before we do we’re going to actually look at creating a view because you can actually create a View since it is all entity based. You can actually create a view without having to turn that module on. So if we wanted to for instance show just Registrations since Registrations is an entity, we can do that and we could specify specific type. In this case, Training and if we look here, let’s go to the Registration Types so you can see that. We only have one type here which is training that we set up in the previous video.

So we could select that or if we have other types they would be listed there. Let’s call this Training Registrations and we’ll allow it to create a page, keep everything else at the default and we’re going to I guess display table instead. So we’ll click Continue and Edit. Now if we add some fields, you can see the Registration Entity has a couple of fields that we’re going to want.

This company field is the one that we added. We may want the date it was created, name field which we added as well. Let’s see, we could put in the URL if we wanted to and well go ahead and show that, just leave these at their defaults and if you look at the preview down here it shows the two registrations both were using the test company but different names and you can see there’s URL that brings you directly to the Registration.

So as you can see you can build a view without turning on that entity or Registration Views Module. And the view works, however there are a few additional fields and additional things that that module allows you to do. So let’s go ahead and take a look at that. So let’s go back to our module’s page, let’s turn on the Registration Views Module and now if we come back to our View here, so go ahead and refresh and now we will try to add some additional fields.

You’ll notice that there’s now a Registration Delete link or Registration Edit link and even the Registration View link. The module does a little bit more than this but we’re going to show the basics but essentially it allows better integration in with Registrations into Views. So if you are doing a lot with Registrations you want to show them in Views, you probably want to turn this module on anyways because it adds some additional relationships too I believe. So there’s a lot of additional points that happened when you turn that module on.

As you can see you now have Edit links, Delete Links directly built in for your registrations. So again that’s a pretty simple module. If you’re working with views and you want Entity Registrations to work well with Views, that’s a good module to turn on. Like I said you don’t absolutely need it if you’re just creating a basic view. However with the relationships that added that it allows you to have as I mentioned and it is additional field, it’s a nice thing to turn on. So let’s go ahead and look at the last module here which is probably the most interesting one.

It is a registration wait list and what this is going to allow you to do is specify a wait list so if your event fills up you can still allow users to register for your event but they will be put in a wait list which means if someone were to back out you can go ahead and fill it with someone that’s in that wait list. So let’s go ahead and turn that wait list module on and the first thing is going to do as it says in the description it provides a special registration state.

So if we go to Structure Registration, Registration States you’re going to see there is a Wait List option. This one wasn’t there before. As soon as you turn that module on, this one will show up. So let’s go ahead and go to our Training Test 1 Event. So we’re back here, if we go into Manage Registrations and go into Settings and scroll down towards the bottom there’s going to be an Enable Wait List checkbox. So we’re going to go ahead and check that and then you can specify the wait list capacity. So if you wanted to allow three of four or five people on the wait list you could specify that, we’re going to leave that 0 which means as many people could sign up for the wait list as possible. I’m going to go ahead and change the capacity on this too.

The capacity again is the maximum number of registrations and that’s because I already have two registered and this is going to help show that the next registration is going to go to the wait list. I’m going to specify that authenticated users can register just to show you that that access module works. So I saved it, now I need to go to the site. Here I’m not logged in and I’m going to go ahead and log in as the Test User. Go to Training Test 1 and go to Register. Since I’ve already registered once out of this user it’s telling me I have to register some other person because I’m already registered. So I’m going to register just a test account. Fill out the registration and click Save Registration.

You’ll notice the message here says Registration placed on the wait list because I’m not actually in the event and if I come back as an Admin, go to Manage Registrations, you’ll see that three people now show up and one of them shows up as on the wait list. So as you can see it’s a handy module to allow your events to be overfilled just in case someone was backing out or wouldn’t be able to attend, you could then go to someone on the wait list and allow them to take their spot.

So that is it for the Entity Registration Module, hopefully that gets you started and allowing users to sign up for your events, trainings, webinars and whatever else you might need people to register for on your Drupal site. Again check out codekarate.com, let us know what you’re thinking. If you have any other videos you’d like to see in the future, follow me on Twitter at smthomas3 and we will see you next time.

Tags: DrupalDrupal 7Drupal Planet

Drupal hosting solutions and service providers

Sep 17, 2014

Description:

There are many different ways to host a Drupal website. These ways each have their pros and cons depending on your specific website needs. In this article I will break down Drupal hosting into three major categories: Drupal specific hosting, Cloud/VPS Hosting, and shared hosting. There are probably arguments for other categories and some possible overlap, however it's a good starting point when beginning to look for a Drupal hosting provider.

Type: TextTags: DrupalDrupal 6Drupal 7Drupal PlanetSite Administration

Drupal 7 Entity Registration Module

Sep 12, 2014

Description:

Episode Number: 167

The Drupal 7 Entity Registration Module makes it easy to host sign-ups or registration forms directly on your Drupal 7 website. This solution works great for event, conference, webinar, or training signup forms.

In this lesson you will learn:

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 167 and we’re going to be going over the Entity Registration Module. But before we get started I am Shane Thomas, you can follow me on Twitter at smthomas3, also make sure to head on over to codekarate.com and check out the EBook, look at some of the other post and videos and learn more about Drupal.

So if you ever had a situation where you’ve needed to allow users to sign up for a specific event or maybe it’s a conference, a webinar or a training, some type of event like that and you want to allow that to happen on your Drupal website. Well that is where the Entity Registration module comes in. It allows you to easily allow users to sign up for different events right on your site.

So we’re going to go ahead and get started and make sure you have this module downloaded if you’re following along and we’re going to go ahead and start by installing the registration module. We might break this video into two parts and this one I’ll just focus on just the registration piece but in a future video I’ll cover some of these other modules that come with the Entity Registration Module. Once we have the Registration Module on we can of course configure permissions.

By default there’s only a few administer permissions, you’ll notice here in a little bit this is going to change. Once you install the entity registration module there’s a menu over here for registration, it’s under Structure Registration. There are two menu items in there. One is Registration States which allows you to set up different statuses or states for a registration.

So by default you can see that a registration is going to be complete. You could have a pending state or a cancelled registration state as well. We’re going to leave this at the default we’ll just know that it’s there. Registration types is the next step in the process. Here you can add a registration type. In our case let’s go ahead and just call it a Training.

Let’s say you want to allow people to come to your site and sign up before a specific training at a specific date and time. You then are able once you create the registration type to change fields on this registration type. Now there’s two different places where you can change how this works. So the first is right on the actual registration type itself. So let’s go ahead and add a field, we’re going to go ahead and have them specify their name and we’ll have just this be a text field.

You can also then say you want to know what company they’re from so you want a field for their company information and you could of course add a whole bunch of fields. The important thing to keep in mind is anything you add in this registration type and is going to be displayed on every registration. So the user is going to have to fill this out every time they want to sign up for a training.

The next step is to create a content type that will then reference that registration type. So we’re going to add an Event Content type and the reason we’re just adding a content type called Event is because you may want to have different types of events. You may want to have trainings, you may want to have webinars, you may want to have a whole bunch of different types of events.

We’re going to keep everything really simple so we’re going to leave everything in its default. So we’re going to save that content type, if you can see there’s our Event Content Type. We have to link this content type to the registration type that we created. So we come into manage fields, we’re going to add a registration field here and we’ll just call it registration for now and I’ll leave registration type as the widget, click Save and click Save again. In this section you’re going to be able to specify the default registration settings.

So as you can see there’s settings that will be applied anytime and entity with this field is saved. So the capacity is the maximum number of registrants so you can select it if you want it enabled by default. You can specify the open and close date and you can specify reminder, reminder template, how many spaces are allowed for each registration or registrant and if you want people to be able to allow multiple registrations.

Here’s the from email address which defaults to the site email. So any emails that get sent for this registration will come from shane@codekarate.com. We’re going to leave all those at the default for now just to see how it looks and we are now able to create our event content type. So let’s go ahead and add an event. You’ll notice how there’s a registration field here for training and remember we talked we could have conferences, webinars, any type of event that someone would want to sign up for.
So we’ll create new event called Training Test 1, we’ll give it a little bit of text, select the registration we want which is we want a training event, we’ll leave everything else at its default and click Save. Now you’ll notice everything else looks pretty much the same as a normal node would.

However there is a Manage Registration tab here. If we click on that Manage Registrations tab it says there are no registrations. So if there were any it would show up here and there’s also a settings sub tab. Here is where we can click to enable registrations for this training so we’re going to click enable. How many people you want to be able to sign up.

We could set this to any number and it will limit the registrations to this number. You can specify the start and in times for when a registration should be open. So if you only want registrations to be open for a couple of days or a week or even a couple of hours you can control all that from here. So we could say it’s open from today until tomorrow. If you want to send a reminder you go ahead and just fill this out and we could send a reminder saying the event is about to start. If you had any links or anything else you could put that in here, you can also use tokens if you have the Token Module enabled and we’re going to leave the rest at its default then click Save. Now you’ll see there’s a new tab here called Register.

Here you can actually come in and register who is going to sign up for this training. So you can see if I want to sign myself up I can sign up another person. I’ll just enter the name and the company and click Save Registration. So now that we have this setup let’s look at the new permission that are available. You’ll notice when I start typing registration there’s a whole bunch of extra permissions.

The important ones are the ability to create new registrations and to register other people if you want them to be able to select a dropdown as you see here to either register it themselves or another person or another account if they know the user name for the account they want to register. In this case I’m going to use create new registration and register other people and I want to give that to authenticated users.

There is supposed to be a way to allow registration for anonymous users, however you may need to try out the development version and may need to do a little research which because I think there may be a bug or two in allowing anonymous registrations. So let’s go ahead and now that we save those permissions, go ahead and find another user here. Let’s go ahead and go to the site and I think I already had another user set up.

So I’m going to go here and I’m logged in as another user now as you can see I am non- admin. If I go through this training test 1 you can see here’s the text. It says this is a training registration test. You’ll notice there’s a field here, this is supposed to be a link but it doesn’t seem to show up so we can hide that but there is a register tab so if I click Register I’m able to see this is a registration forum myself for instance. You can register test 1 at Test Company and say that is myself so I can save the registration. It says the registration has been saved.

You can also register someone else if I want to and I just put an email, you can put test two, let’s go ahead and do that, give it a company name, save registration and it says registration has been saved. Now if we go ahead and let’s close that out of here. Go ahead and come back to the site and I click on Manage Registrations, you’ll see I see the two registrations here. Because we set up that reminder email that we’ll go ahead and be sent. However we can also send out an email at any time to everyone on the registration lists.

So we could put some text in here, this is going to go ahead and send an email to the two people that are on this list. So if I go ahead and open the email that I received, you should be able to see that the email was sent, just waiting for it to load here and if I pull in the email it’s going to look something like this. You get the email from shane@codekarate.com, it was sent to shane+test and this says thanks for signing up, here is the link to the event and then you could of course have whatever you wanted in that email.

So as you can see this is a really easy way to set up registration forms or sign up forms for various types of events on your Drupal site. There’s a whole bunch more you can do with it. This was the very basic example, next time we’re going to go over a few of the other modules that come with it. Talk about a few other things that you can do with it and learn how you can really get this to integrate a little better with your Drupal website.

Thanks for watching the Daily Dose of Drupal and make sure to check out codekarate.com, check at the EBook, follow me on Twitter at smthomas3 and we will see you next time.

Tags: DrupalDrupal 7Drupal Planet

Drupal 7 Node Class Module

Sep 4, 2014

Description:

Episode Number: 166

In this episode you will learn how the Drupal 7 Node Class module works with the basic page content type. The simplicity of the Node Class module provides an easy way for site builders and themers to add a CSS class directly to the wrapper on the node. Using this module allows for various different layouts and styles to be called based on defined CSS rules.

Full Text: 

Hello everybody and welcome to Episode Number 166 of the Daily Dose of Drupal. I am Adam, and today we are looking at the Node Class Module. I’m going to pull that up here. The Node Class Module is a really really simple module but comes in handy for people that aren’t as familiar with PHP and other ways to do this but basically, what the node Class module does is it gives you an easy way to add a Class on the individual node. So then you can define different styles with your themers as well with any other developers in the group.

So we’re going to take a look at that here quickly. Again, it’s a really simple module but does come in handy for some cases. A couple of housekeeping things, you make sure you head over to codekarate.com and check out our EBook there, been going strong getting a lot of great feedback from everybody. I appreciate it if you do get the EBook to let us know what you think about it. We’re always looking to improve that and are improving that on a weekly basis. Also, we do another special here, the first person to watch this video and email connect@codekarate.com and say that they want a free copy of the EBook, we’ll send you a free copy. So make sure to send I Want a Free EBook to connect@codekarate.com.

Let’s get to the module, so the Node Class Module, so the first thing that you want to do is you want to download that and get that installed. So once we get it installed, all you do is enable it, turn that on. Once you get the non-class module installed there’s nothing to configure on the module. All you need to do is go our content and create a piece of content. So I’m going to add a page and call it and I’m going to paste in some text and at the bottom here you’ll see there’s a node class setting in the setting area down there. Basically all you do is you can define it by adding a space separated list. So if we want to add fancy and I can see here, let’s go picture-left.

So for example, both these class are going to print separately. So fancy and picture-left, so let’s add that, the basic page is will get created, so there’s our node class example node and you see there’s some text in here. So right now nothing look like anything special has happened, but if we dive in and look at the code on the back end, so we pull up our code editor or debugger and we hover over the node we’ll see that on the node right there there’s our two classes. So there’s fancy and picture-left getting printed. So then with CSS we could define that by calling up picture-left and changing the layout of that area.

So while that’s pretty handy, let’s say for example you had a blog and you wanted two different layouts like if one had a picture and one didn’t had a picture. Well you can add picture-left class and that would view for that when you want the picture to be on the left or you can add picture right class and that would be to come out the picture on the right and with CSS you can then change the layout. So obviously listen to what that class is. So pretty simple module, that’s really all there is to it, but again nicely to add a class directly into the HTML about having an only PHP or having to touch any template file so it’s kind of a quick easy way to get that accomplished.

Alright I don’t want to really go on much further on this, there’s nothing much else to this module. Make sure also to check us out at Twitter land, you can follow me @AdamLearing or at Shane @smthomas3. You can follow us there. Other than that guys, that’s it, let us know what you think again about the EBook, any other videos you want us to take a look or any other modules you want us to take a look at, we’ll be happy to do that as well. Until next time, thanks.

Tags: DrupalContent TypesDrupal 7Layout ToolsDrupal PlanetCSS

Drupal 7 Node Expire module

Aug 29, 2014

Description:

Episode Number: 165

The Drupal 7 Node Expire module allows you to use the power of the Rules module to perform actions on nodes at a specific point in time (when the node "expires"). This is useful for things such as unpublishing your content after a certain amount of time, or removing your content from the front page after it's been published for a week. You can also create rules actions to send an email at a specific time to serve as a reminder to do something related to a node on your Drupal site.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 165 and we’re going to go over the Node Expire Module. I am Shane Thomas, you can follow me on Twitter @smthomas3, also make sure to head over to codekarate.com and click on the link over here to learn a little bit about the EBook called “The 5 Secrets to Becoming a Drupal 7 Ninja” and take a look at that. But let’s go ahead and get started.

The Node Expire Module, it allows you to basically set a timer on your nodes and when that timer goes off or when that node is unexpired, then you can run specific rules, actions. This is useful if you want to unpublished node after a set amount of time, if you want to remove it from the front page or if you want to do something like send an email to the author. A whole bunch of different things.

You really have the power of rules to do whatever you want with that node when it expires. So we’re going to go ahead and take a look. You’re going to make sure you’re going to need the Rules Module downloaded and installed on your site. As you can see Rules and Rules UI has been turned on. You’ll also need the Date Module, well you actually don’t need this but if you want to be able to use the date pop-up rather than using a text field, you will need the date popup module. And that just comes with date, so turn on the date and date popup modules in the list. And then you will of course need the Node Expire Module and you’ll need to turn that on.

Once the Node Expire Module is turned on, we’re going to go ahead and configure this module. You can select how you want to handle it. I’m going to go ahead and just ignore the legacy mode but the first option that you might want to look at is to run the Content Expired Event every Kron run. So this means every time Kron runs after a node has been expired, the content event will run for that node.

The other option that we’re going to look at is to trigger the Content Expire Event only once when the node is expired. In this case it’s only ever going to trigger one time and we’re going to go ahead and leave that options. We’re going to select a date popup rather than a text field just to make it a little easier. And we’re also going to check this box to allow expire date in the past and that’s just going to let us move the demo along a little bit faster. So we can actually set the date in the past and see it’s working. So we click save.

The next step is to set up what we want our rule to do so I’m going to go into configuration workflow rules and I’m going to go ahead and add a new rule. If you’re not familiar with rules, check out some of the other Daily Dose of Drupal videos on configuring the Rules Module and how to use the Rules Module. We’re going to give this content a name of content as expired. This could be whatever you want it to be just so you know what it’s doing.

The event is the important part here and you’re going to see there’s an option called Content Expired. This didn’t exist before we installed the Node Expire Module. Let’s go ahead and select that and click Save. And now you have Rules that you can set up your actions to do whatever you want. So as I said before, if you wanted to unpublished the node, if you wanted to send an email, you can do all that kind of stuff using rules.

We’re going to remove the content from the front page in this example and we’re going to go ahead and select save. And our goal here is to have an article and set an expiration date and after so long we want that article to no longer show up on the front page. So this shouldn’t help us accomplish that. The next step is going to be turning the node expiration on for a content type.

As I mentioned before we want to use articles so we’re going to click Edit on the Article Content type. We’re going to head down to the publishing options and to check the box next to Enable Node Expiry. We can set a default expiration time. This uses the PHP String to time format so it’s pretty flexible in what you can do. I’m going to set a default of plus 30 days and this means anytime you create a node and you want it to expire, it’s going to default to 30 days out.

You can also set the expiration date limit, you can set if you want it to be required or not required. So we’ll click Save Content Type and we will now look at one of these specific articles. We’ll go ahead and select Test Article 2 and we will edit this article. Everything looks pretty much the same except now in this publishing options section, you have an expiration date. You can notice that it is set to 30 days out but we’re going to go ahead and change that to Yesterday, as you can see it’s the 14th and we can set it to the 13th. So we’re going to go ahead and click Save. If we come back to our homepage you’ll notice the article is still there.

However, as soon as we run cron and we come back to the homepage and refresh. You’ll notice that the article 2 is no longer in the front page. If you take a look at article 2 here you will see that the promote it to front page option is no longer checked. So if we check that just to show that I can get it back, it’s back on the front page. However if we run cron again, it’s not going to go away anymore because we specify the option to only run the Node Expiration event once with this article. So you can see we refresh the page, Test Article 2 will still going to be there.

So that’s really all there is to the Node Expire Module. You can do a whole bunch of thing with it. You can use rules to really react on that event however you want and perform a whole bunch of cool actions. So go ahead and give the module a try, let me know what you think. Make sure to check out all the content, the EBook and a whole bunch of other and blog post on codekarate.com and follow me on Twitter @smthomas3. Thanks for watching and we’ll see you next time.

Tags: DrupalDrupal 7Drupal Planet

Multiple Views Part 3

Aug 25, 2014

Description:

Episode Number: 164

In the last installment of multiple views you will learn how to change the look of the view using the two classes you set in the previous video. By using CSS, you will be able to display content in two ways depending on the choice of the viewer. This is a nice advantage to provide options for the visitor to your site.

Full Text: 

Hello everybody and welcome to Episode Number 164, the Daily Dose of Drupal. And today is we’re going to finish up the three part series on Multi Views. We’re looking up a little bit of styling on how to change a view look based on a class that were split now with some Java Script. Before we get into all that, we’re going to do a little housekeeping things.

Of course make sure to check out codekarate.com and the EBook there. It’s been going really well but a little over a month now it had a lot of success. If you have purchase it on the past, let us know what your thoughts are, if you have it purchased I appreciate I appreciate if you did and let us know what your thoughts are. Also a few other things, you’re going to let us follow us, Shane and I on Twitter at AdamLearing and at smthomas3. Shane would be better to follow there. He actually post some more stuff than I do, so check that out. Other than that let’s get down to the video and showing you again a little bit about how to style the view based on the class that you’re dynamically putting out.

So to get started, let’s hop over to my previous example of what we’re actually trying to pull off. If you look at part 1 you’d see this but what we’re trying to do is depending on if we have a List or a Table View selected, we want to display different content. I shouldn’t say it’s a different content. It’s the same content, just displayed differently. So if I pull up my code here little quick, you’ll be able to see that when I switch between.

So as it is loading here, let’s see how we can pull and we can see that we have a list or a class changing when we click. So you see right now we’re on Grid view, we switch over to List view and when we do that we’re calling different CSS which is changing the look of the view even though it’s still displaying the same content from the same view, it looks a lot different based on this class. So that’s what we’re going to accomplish here on this part three. So if you’re familiar, we left off part 2 with being able to just switch the classes from the table to list and I’ve actually already add a little bit of CSS that shows kind of what we’re going to cover in the video but I’m going to take the CSS of real quick and we’ll add it back in.

Once I show you what we’re trying to accomplish. Alright, so if I refresh this page you’ll be able to see, kind of where we left off video 2 or part 2 and then we’ll show you what I’m changing on part 3. So if you search here and if you look right here, it says Grid View. So that’s on one of the tables like we were on a Grid. We want to switch to list. If we switch over to list, this changes the list and we can change back and forth. But obviously by view, nothing is changing.

So that’s what we’re going to accomplish, is by clicking one of these we’re going to change the look and feel of this view. So I’m going to add this CSS back in and I’m going to kind of show you what’s going on here and then I’ll show you what exactly is happening. So in the first realm I’m saying Grid view, so when we have a Grid view…winning grid view, use Rose view and we’re going to float them together and making a grid. So there are going to be 20%, 2 ½ margin on each of the left and right and we’re going to float them. So bring that views roll up. And then on list view we’re just going to take this picture and we’re going to hide it. So you’ll be able to see how this changes pretty easily.

So again if I save my style sheet here real quick, and I’m using…you might wonder why I’m going here with my FTP client, that’s because I’m looking here on a local site and I don’t…I’m not directly working on the server. Alright, so anyway let’s refresh this page and you’ll start to see some stuff try to change. That’s hopefully what we want. And there we go. So now we’re using a Grid view here and we’re floating them up. So each of these are 20% where the 2 ½ margin on each left and right side and then when I click over to List view, the picture no longer is getting displayed. So if I click the table, my picture is back. So it almost looks like I’m using two different views here to display the content but it’s really only one view again. We’ll pull up that view for in here too.

Once that loads here, but again, the same content, Steve Young, 74 inch height, 250 pounds, same information, you’re just getting it displayed in a different way. Nice use case for this is for people that are on a mobile browser or using a tablet Sometimes it’s easier for them than are just on a grid view versus a list view. It’s got up to them but at least you have them options. Again let’s take a quick pick at the view that’s running all this. Here you see all the fields that I’m using. Picture title, height, weight and body and I’m just rewriting it in a custom text field with views. If you need information on how to do this, check out part 1.

I’ll layout to do all this but again I’m just spitting out the fields using the replacement patterns below and then using the…I would say the CSS that displayed differently. But again it’s the same view bringing up the same thing. I’m just hiding and showing based on my CSS class via J Query. So that’s the video. I want to keep it short, I don’t want to spend time to time styling because styling is obviously are going to be up to you and what you to do. But the general idea is to get the styling to work.

All you need to do is use the list Grid view class and the List view class and then inside that, you can do whatever you like on change the look and feel of the view. If you guys have any other questions like further how to style or anything like that, make sure to ask, I can help you out there. Also if you have any other questions relating to part one or part two make sure to shoot them over to us at Code Karate. Alright guys, that is going to conclude the video for today, if you have any questions again, make sure to let us know, otherwise have a good one. Bye.

Tags: DrupalViewsDrupal 7Theme DevelopmentDrupal PlanetUI/DesignCSS

Multiple Views Part 2

Aug 21, 2014

Description:

Episode Number: 163

In part 2 of the multiple views series you will learn how to add the jQuery needed to switch between multiple classes. By having the ability to use multiple classes, we will (in part 3) be able to use CSS to change the look and feel of the same view.

Here is the jQuery code used to switch between grid and list view:

Full Text: 

Hi everybody and welcome to Code Karate and another edition of the Daily Dose of Drupal. Today we’re on Episode Number 163 and making our way to 200. This is the second series or video to an earlier part on building a custom view and using Java Script with CSS to switch between of a grid view and a list view.

I’ll provide on the comments below a link back to the other video. But today we’re going to be using Java Script to change classes so we can then style and change between a list and a grid view. I’m going to give you an idea again if you’re not familiar with the first video.

This is what we’re trying to accomplish. We’re trying to spill the search between a list view and a grid view all at the same time view on Drupal. So that’s what we’re going to do at the end but today we’re just focusing on be able to switch this VC, there’s a grid view here, switch to in that in the list view so we can menu CSS as to styling, I’m going to then change the outlook of the view.

So that’s what we’re going to be doing here in the next minute. Before we get started though, again, Code Karate, make sure to check out our EBook, do yourself a favor there and get that for yourself because to follow myself and Shane on Twitter. I’m @ AdamLearing and Shane is @ smthomas3. I appreciate that.

Alright let’s get started. Again this is the second series, the first series we did go through building the content type and the View. So we’ll start by looking at the View that we built. So here’s the View, barely a simple View. We’re just pulling in the different fields with the content type, type of body, height, picture, weight and then a custom text field which we’re using to override the output. So there you can see how we are displaying it. I built this custom. So we’re just using the different replacement patterns for the fields.

So now that we have the View built and you saw that one when it first started. One thing we need to do is we need to add a trigger to be able to switch between a list and a grid view. That can easily be done by just adding in header text into the View. I kind of cheated and done a little bit of this before I got started the video but I’m going to walk you through what I did. So all I did is I made a simple Div with a couple of A links inside.

So you see here I have A link with a class of Table and then an A link with a class of List. These are going to be my two triggers that switch between obviously a table and a list view. Nothing really revolutionary about HTML but just something that we can actually click on. So the other thing that you’ll want to do and that’s just how I built my Java Script. You don’t necessarily have to do it this way. You could build your own Java Script but you’re following on and you want to actually add course view as a class on the view.

This is just adds right under the wrapper of all on the view so we’ll just have a classic course view that we can use the Call from. So that’s only additional changes you’re going to make to your view to get this to work. So once you save your view I will show you what it should look like at least via HTML. And you may develop to pull up. There we go. Alright so in the HTML here we’ll be able to see here’s the header I put in. So again just a simple Div with a class of table and a class of list. Also you’ll see right here is the course View Class that I added. And again we’re just using that to call the View, nothing else pertinent there.

So now let’s hop over to our Java Script file. Again I did a little bit of work here before you…just going to want to waste time watching me type but I added on all the Java Script that we’ll need to make this work. And again I’ll add this in the post so if you want you just copy and paste it directly and use it for your own sites. But I will walk you through here quickly on what’s going on.

One thing I’ve note is I’m using just Zen subtheme from my Java Script stuff. But make sure again if you do your Zen, that you comment out the [inaudible - 0:04:39.4] scripts, it initially comes out uncommented, otherwise you can’t scripts like JS file and then it’ll frustrate you because it won’t read in. But once that’s done, you save it, make sure you’re aggregating Java Script and all that stuff so it actually does read in. But once you master all those, it looks easy techniques we get to the Java Script.

So for those of you who are not too familiar with Java Script I’m going to walk you through this. Bear with me if you are familiar or just skip along and get to the point where you learn something. But in general here, what’s going on is we’re saying for the Java Script to look at the content and once you find this course view class, and that’s where I put that course view on the View. So once you find that, if the view class and I’ll jump over here back to my thing. So if this view class right here has a class of course view which it does. So we add it then we want to add a class to the view of grid view. So that’s basically the page loads, before anything happens, this is what the grid view will be loaded.

So as you see if I refresh the page here you’ll see now there’s a grid view added. Because what’s going on is it’s saying if the view has a class of course view which it does, so it checks that, then we’re going to add a class to the view of grid view. So there you go. So now we can always use that to style based on and I’ll show you that on the next video but now we have some unique class that separates us from the list versus a grid view. So let’s take it one step further. So now that we have the grid view of this, what if I click on List, I needed this Grid view to switch to list view. So that’s what’s going on here.

So if I click List, so again in my view header, you’ll see here if I click List or this button right here, A tag, then I need to do this, I need to say if the class has a grid view, which it does. View has grid view, then I need to add the list view class and then immediately after I need to remove the grid view class. So when I click this list view you should look down right here in this grid view.

You’ll see the grid view will go away and list view will take its place. And there it goes. So what’s happening again is we’re adding a class of list view and immediately removing a class of grid view. So there’s two things going on there but they happen so fast that we can’t tell. So then if I click…I’m not in there. If I go back to my Java Script and say it’s now on list view and now I want to go back to grid view which is drop down a little bit further, is that if I click Table, its right here, then if it has class list view which it does, then did the exact opposite thing. We’re going to add the class of grid view and then remove class of list view. So we click table, there we go. Switch it back to grid view versus list view.

And obviously I can switch back and forth and then of course once add styling which we’ll see in this third video, we’ll be able to do this like you said. We’ll be able to switch the output. So it looks like we have two separate views but the secret is it’s all running up the same view. We’re just using CSS to display different outputs. Alright I think that’s what I wanted to cover, all I wanted to cover in this. Again I’m going to provide you with this code in this post on Episode 163 and then in Episode 164 we’re actually going to take if you have to change the styling with some CSS, nothing too crazy.
Obviously you can feel free to do your own unique styling and stuffs like that but that’s what we’ll cover in episode 163. I think everything else is covered. So that’s your work for today, again what we covered is we just covered a way to build your Java Script to be able to switch between two different classes so then we can use CSS as our styling agent. So that’s it. Alright guys, until episode 164. Take care.

Tags: DrupalViewsDrupal 7Theme DevelopmentDrupal PlanetJavascriptJQuery

Multiple Views Part 1

Aug 14, 2014

Description:

Episode Number: 162

In this episode, you will learn how to set up the foundation of building a view that can display content in multiple ways. This video highlights how to set up the content type and view to display the content. In the coming videos in this series, you will learn how to style and apply jQuery to change how the view displays the content.

Need help learning views? Look at our Drupal views intro.

Full Text: 

Hey Everybody! Welcome to another Daily Dose of Drupal, this is Episode Number 162. I am Adam and today we’re going to be changing things up slightly. I’m actually doing a three part series on No Module in particular but a couple of modules and some Java Script and some CSS so you need a little bit of everything. But the end goal at the end of the three videos will be to display something similar to this. The ability to easily switch between the same view but change the layout based on if you want a grid or a table listing in the view.

So you’d be able to see how I build the view, how I styles the view and how I used J Query to switch between different modes and add classes to the CSS that change the look and feel. So in this video we’re actually just going to build the view. The Content Type View, kind of all the framework, backend and the next video we will do the J Query and the last one we’ll style it up and make it look really nice.

Quickly before we get started, make sure to head over to codekarate.com and sign up for the newsletter and also check out the EBook recently released and then you can also follow myself at AdamLearing on Twitter or Shane at smthomas3, I appreciate that. So let’s get started; so the first thing to build the functionality, again if we look back here we’re looking at…these are courses but we’re just going to make a new content type, we’re going to call it Players, Football Players since it is football season.

So if go into my content type, I’ve actually already made my content type Football Players and if we look at the field I’ve added a few fields as well. The Title or the Name, Bio, Picture, Weight and Height. So these are the fields we’re going to use in the displays and then we’ll change how they layout based on doing it on a grid or a table. So once the content type is created and again obviously you can customize this with the fields you want. Next thing you do is create the view that’s going to you as how as all the fields.

So actually the first thing we’ll do, let’s create some content so we have something to show in the view. We’re going to add content, we’re going to add Football player. I myself, I’m a 49er fans so I’m going to add some 49ers here. Jump text, I’ll blow a picture of this, this is actually going to be a picture of me, just take your time, weight in pounds.

So we’re going to go ahead and just save that options. So obviously we’ve created a football player Jerry Rice and on that and let’s upload a script one more, switch to a different football players. So now we have two different players created, Steve Young and Jerry Rice. So from there, now we have some content that we can build and view and display this in the view. So obviously the created view is going to structure and we go to Views and then let’s add in a new view. Let’s call these Players, we’re going to create this as a block and we’ll drop it on the page.

So similar settings here, we’ll obviously…this is very important when we get the styling that we want just be set as an unformatted list. That’s the easiest way to do what we desired. My outside page here, let’s set that to zero so it’s unlimited, and then let’s keep going. Alright so here we go. Here we’re going to build our view. So the first thing, let’s get all our fields added that we want. So here’s our Football player, let’s get the weight, picture, height and body, [inaudible - 0:04:47.8] all is default and then we can configure these fields.

For all these fields we’re actually going to rewrite the output of the view. So we want to exclude all of them from display. We’ll make sure you check the Exclude from displaying all of these. So now you see that we need to filter where our content type, which is…select content type and we’ll select Football Players, we’d want our football players. And then you’ll see here our view is starting to come together. We see Steve Young and Jerry Rice and the reason I’m not seeing anything else is because we excluded those from the view which I forgot to do about the title so I’m going to do that real quick. So exclude that from display as well.

So now we see nothing because all our filters are excluded. But hopefully you’re probably familiar with, if not you…this is a really pro tip with you’re using Views is you can rewrite output of the Views using Custom Text Field and you can customize the HTML within that. So we want to drop the label but inside there’s text field, you’ll see we can use this thing called Replacement Patterns and here all the fields that I’ve added to View.

So I can simply paste in all of the replacement patterns here and then they will display in the View and I can customized the HTML around it which is what ultimately we’re going to do here. Just a second. Get all these and first then we’ll move them around. So just to show you how it’s working here, if I just save this or apply this right now, you’ll see here’s my view and now it starts to display things and now as I printed out some of the names, the body field, the picture, excuse me, the height, the picture and the weight. So it matches up with how I have it in my Custom Text Field.

It’s important to note that any field that you want to use as replacement patterns have to be sitting above the custom text field. So if I would have happened to have weight sitting below the custom text I wouldn’t be able to reference that field. It’s important to have them all above that to use them. But obviously we want some HTML wrap around here because it’s pretty unusable. Without that it just doesn’t give you anything to style off of or use J Query with.

So what we’re going to do is we’re just going to wrap this in a wrapper and we’re going to call it Wrapper and then we’ll pull that off, and then on each of these it’s kind of to you how you want to style them. I kind of like to use heading tags as possible, so I’ll wrap my title in each too and body over wrapped to the paragraph, I’m going to wrap my height with all in this biz with the classes representing the fields. And this might change a little bit once we get the style and we can usually drop in the view and change those but for now since they don’t necessarily know exactly how I want it to look. I’m just going to give it some generic classes so we can get to the point of styling it. And then one more here, alright so as you can see right now, so we built this really simple div structure here, a div wrapper with an [inaudible – 0:08:51.4] a few tags and a couple of other div within it.

So if we apply that to Display, you’ll see that now time has changed here, still look relatively the same but if we go to…let’s save that actually, I’ll make sure it’s saved. Okay so now we have…let’s actually give this a main name. Okay let’s just get to the end of seeing the view in action here so let’s add the view to a page which is where I will end up having all of that. So we got a content, we’re going to add the page to show this view on, one moment. There’s the page. Alright let’s save that real quick. So we have a path of node 24. Alright so if we go to Structure, going to the blocks, you can remember when we made our view as a block we will see football players down here…right here, view football players.

Let’s add that to the content and save that real quick and then we’re just trying to make sure you only want to show that on that node page and not on every page. So if you configure that only on listed pages we’ll paste it in node 24. So that will only show up on the football player. That’s good and then if we just reload this page, here we go; so now on the Football Player stage here’s the team, here’s our View. So we have Steve Young there and we have Jerry Rice there.

So obviously that’s pretty basic, obviously just adding a content type configuring the content type and then obviously building the View to display the page but again it’s said, the other two videos here we’re going to get in the more technical stuff about how to build the correct div structure to display the different types of views. So here’s a real quick before I sign off here, I just want to show you here’ sour div structure that we built.

So here’s our class of wrapper which I gave H2, the P tags and then the height, pictures and weights getting displayed. Again I said we’ll probably all end up changing that a little bit once we start styling it but this gives you a general idea of at least how to get the foundation set up to get to step 2 which will be again styling the views and making the views look like this and then third step will end up running the Java Script and stuff like that to change the view styles. Alright guys that’s all for today. Again this is Adam of Code Karate. If you have any questions or anything in the meantime, feel free to email me at adam@codekarate, otherwise we’ll talk to you later. Thanks guys.

Tags: DrupalContent TypesViewsDrupal 7Site BuildingDrupal PlanetCSSJavascriptJQuery

Embed Panel Node View in code

Aug 7, 2014

Description:

There are times when you want to programmatically embed a node display in a block or panel pane. You can do this by creating a block. You might try to use the node_view function to display the node. Doing so in a module might look something like this: /** * Implements hook_block_info(). */Type: TextTags: DrupalPanelsDrupal 7Module DevelopmentDrupal Planet

Drupal 7 Entity View Modes Module

Aug 1, 2014

Description:

Episode Number: 161

The Drupal 7 Entity View Modes Module allows you to define custom view modes for your entities. A view mode allows you to configure which fields on your entity you want to display. For example, Drupal by default has a Teaser view mode that you can set up to display different fields from your Full Content view mode. This module will allow you to add your own view modes on top of the ones Drupal gives you by default.

In this lesson you will learn:

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 161. I am Shane Thomas, you can follow me on Twitter at smthomas3, also make sure to check out Code Karate and Code Karate recently released ebook.

Today we’re going to be going over the Entity View Mode Module, and this is really going to be a really simple and quick video today because there’s not a lot to it but it is very useful in certain situations. Essentially, it lets you allow additional View or Build Modes for your entities.

And so this could be a situation where you need to display specific entities, maybe it’s a specific types of content in multiple ways and we’ll go ahead and show you how that works and maybe give you a few ideas of how you can use it but there’s a lot of different ways which you may need this. So your typical use case, you probably don’t need it too often but there are certain situations where it’s handy to have a couple extra Build Modes for your content types or for different types of entities.

First step is to download the module of course and then make sure you have it on. As you can see I already have it enabled here. So you can click Configure from the modules page or you can go to Configuration System Entity View Modes to get to the Entity View Modes Configuration page. You’ll see here it has enlisted all of the different entities on your Drupal site.

So there’s Comment Fieldable Panel Pane, Mailchimp Sign Up Node and this is the most common one that you are all aware of, Taxonomy terms, User. Any type of entity that you have on your site, you can add different View Modes for. So we’ll go ahead and adding a new Node View Mode. Before we do, we go to our content type Manage Display page for the article content type and you can see there’s a default and teaser sub tabs here for different View Modes.

You can also turn other ones on such as a Search Index, Search Results, so there are other ones that come out of the box that you can use and turn on, but there may be times where you want to add new View Modes here. So you can go ahead and do that by going back to the Entity View Mode, clicking Add New View Mode, you can select, first give it a name. We’ll just go ahead and say we’ll call this “The Simple View Mode”. Maybe you won’t have a slim down. It’s not a teaser, maybe it has a little more information than a teaser but it isn’t quite the full content display.

This is more useful for complex content types or complex entities with multiple fields where you may want to have different ways to display the pieces of content or the entity where you may have a teaser, or you may have a full content, you may have something in between or a different type or slightly different layout or structure to the fields.

Here you can check if you want to use Customs Display Settings, we’ll leave that checked, you can specify which content types here. You want to have it enabled for so we’ll just use article for now. We will click save and now we’ll up on this list right here. So it’s simple, it says it’s in the database because we created it. It’s not stock that did not come with Drupal. Custom Settings, yes, you can add it, you can delete it.

So if we go to our content type, we go to basic page first just to show you that it’s not here by default. However you still can turn it on by checking this box and clicking Save. If we go to the Article Content Type, you’ll notice that the simple View Mode has been turned on. So you can see default, we have image, body tags, teaser, maybe we want just the image. And maybe simple is going to contain the image and the body. So now you have three different View Modes here for your Article Content Type.

Now you may not necessarily see how this can be useful but you can use View Modes or the Build Modes in a bunch of different ways. For instance in Views, so we’re going to go ahead and create a new View Quick of our articles, we’ll create one called Test Article List, we’ll show content of type article and we’ll just use this page that the defaults do.

So unformatted a list of Teasers, we don’t need links, no comments and we will click Continue and Edit. So let’s go ahead and click Save and take a look at the page of Teasers first. Here it just shows the image. So in this case the Teaser only shows the actual image field. If we edit the view we can of course change this to full content or our simple View Mode that we just created.

So let’s go ahead and use the simple View Mode and if we click Save, and now you see it shows the image and the body. If we went to the full content it would show the image, the body and then any links that were with that content. So as you can see, it’s really simple, it allows you to add additional flexibility to your various entities. Keep in mind it’s not just for content, you can use it for any entity in your system.

Perhaps you want different displays for your user accounts depending on how you want them to be laid out or shown on different areas of your site. Maybe you want blocks that show different users on your site in a different way. There’s a whole bunch of things you can do with it, it’s flexible, it integrates in with Views easily as you saw, you could of course have done the same thing just using Fields with Views but sometimes it’s nice to be able to pre-configure specific displays and use it in that way.

So go ahead and give the Entity View Modes a look if you need it and also it said it ensures consistency for template suggestions. So it’s easy to use different templates to change how those View Mode look. So go ahead and give it a try and let me know what you think. We’ll see you next time.

Tags: DrupalEntitiesDrupal 7Site BuildingDrupal Planet

Drupal 7 Panelizer Module

Jul 30, 2014

Description:

Episode Number: 160

The Drupal 7 Panelizer Module allows you to panelize (or use panels) for any entity type on your Drupal 7 site. This allows you to change the layout of a node page, user page, or any other type of entity that you can think of. Although it's a little more complicated to set up, the Panelizer module allows you to set up a slimmed down panels interface for other site managers to use. This way you can allow a site manager to change the layout of specific node pages or even choose from a list of predefined node layouts that you set up.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. I am Shane Thomas, and today we’re on Episode Number 160. We’re going to be going over the Panelizer Module today, and this is the module that I have just recently started to play around with and it’s a very powerful and it allows you to do a lot of cool things.

So we’re going to go over that and how you can use it to panelize your Drupal websites. As always, I’m Shane Thomas, you can follow me on Twitter at smthomas3, also make sure to head over to codekarate.com and sign up for the newsletter or look at the 5 Secrets to Becoming a Drupal 7 Ninja ebook.

Let’s go ahead and look at the Panelizer Module and see what it can do. It’s very…in some ways it’s overlapping on what the Panels Module allows you do out of the box. However, it does allow you to do a lot of other very cool and more advance things on top of what you get with a traditional Panels Module.

So a few things you need to know, you need a new version of panels, you need C Tools and Page Manager, included with C Tools enabled and when you’re installing, there’s a few things you need to be weary of. So as you can see we have our Dev site here.

I already have the Panelizer Module installed, just check that box. But you’ll also need to make sure you have Panels installed and the Page Manager Module that comes with C Tools installed. And you want to make sure you come into structure pages and ensure that Node view is enabled. So if it’s not, you’ll need to make sure you’ll enable it so it shows up in black instead of grey here. And then you should be all set and ready to start using the Panelizer Module.

So you can get to the Panelizer configuration page of course from the module’s page if you want. Just by clicking here or you can go to configuration content offering Panelizer. So once we’re in the administration page for Panelizer, you can see there’s a few different options for you to look through here. So all broken up different entity types, so you have taxonomy, node, user.

I believe you can use this with pretty much any type of entity. So we’re going to go ahead and look at node just to keep it simple and we’re going to go ahead and panelize the article content type. So by default I think when you panelize it, originally nothing else is checked.
So you go ahead and save that after you panelize it. Now you can see there’s a link here to start doing some configuration. So if you click that it allows you to specify what type of content you want allowed inside your Panelizer.

So when you are actually trying to configure how a specific node looks. In this case we’re going to configure how an article looks. So the actual view or the actual node view of the article you can specify what should be allowed and I’ll go ahead and we’ll skip this for now and we’ll come back to it. Because it’ll make a little more sense once you see everything in action. So we’re going to select Full Page Override if you want to be able to override the entire page and we are going to go ahead and check both these and I’ll explain what they do.

This provide default panel, this essentially allows you to do the same thing as just creating a specific node view template using the Page Manager. You can typically come in here, you can add a new variant for your article content type and you could design out that page.
If you’re familiar with panels you’ll know how that works. Panelizer allows you to do something very similar and that when you click Provide default Panel, it allows you to then configure how the article supposed to look. So we’ll actually just take a look at that so you can see that it’s very similar what Panels allows you to do out of the box.

Now you can see if I click Settings, this looks pretty similar to what you’ve seen with Panels before, you can specify a CSS class and ID, add some CSS code right there if you want, you can even disable blocks and regions. It allows context just like Panel. So you can add different relationships or link different entity types or content types.

You can specify the layout, we’re going to go ahead and use a two column layout and we’ll let that convert over to the two column layout. And then when you get the content it’s just like you’ve seen panels before. You can move the image around to the right side for instance, you can see we have the body, tags and links as well.

So now if we save that and we go to one of the article, the actual article content types, you’ll see that we have the image on the right and the body and the links and tags on the left. And that applied to all of our articles. So you can see that’s very similar to what you’ve done with Panels before.

If you look at my other Panels videos or if you’ve just been using Panels for a while. So nothing too revolutionary yet. However there’s even more that you can do. This is where it gets really really powerful. So the next we can do is we can say we want to allow the Panel Choice. So we’re going to save that and now we can click this list link and you can see there’s the default one. And this default one is the one we just configured.

So if we come in here and we go to content, you’ll see that the image on the right side like we moved it previously. But we can go ahead and add our own. So let’s say we wanted to add a version where the image is on the left side. So I’m going to go ahead and type in Left Side Image and now I have the default where the image is on the right side. We also have the left side image.

So if I want to go ahead and specify the layout, we’ll go ahead and use a two column layout again. Click Save and we will keep the image on the left but move everything else on the right. So now that we have that we can go ahead and close out. You notice if we come in here the image is still on the right. If we click Edit, there is an option down here for Panelizer.

You can then specify that you want to use the left side image and then you’ll see the image moves to the left. However is we go to one of our other articles, the image can still be on the right. So what this allows you to do is that it really allows you to define different layouts for your content authors of your site.

So if you have someone who’s building out a bunch of the articles on your site and you want to give them a couple different options to choose from, you can easily set these up in the Panelizer Module and then when they’re building their content out they can select how they want their content to display. And everything will just happen magically for them.

Let’s also say, so as you can see we have Test Article 2 where the image is on the right. And we have Test Article 1 where the image is on the right. Let’s say for some reason you wanted to just change this specific one, if you click on Panel…Panelizer, you can come into here and you’ll see it’s using Test Article 1 and it’s using the View Mode. Status is at default. If you go ahead and click content, let’s say we want to add in something else. So we want to add in new custom content so we’ll just say…I’ll just say this should now be overwritten just so you can see and we’ll add it in right above the image.

Now if we close out of here, notice in the Breadcrumb it’s Home Test Article 1 Panelizer Full Page Override. We’re only doing this for Test Article 1. So once we close out here you’ll see that I got this text here that we just added in. It’s only on Test Article 1 because if I come back to Test Article 2, that is not showing up. If I click in Panelizer you’ll see this still shows as default on Test Article 2 and any other Article on the site because I didn’t actually change it for any article but Test Article 1.

So if I come back into Panelizer you’ll see not it says status is custom. I can of course reset this and then I’ll go back to the default where this…as you can see through the grey here this should now be overwritten and it’s going to go away. Now it’s back to default, if I close out of this, let’s see if it’s not gone away and we have just our basic Article with the image on the right side. So all in all that’s very powerful on its own and there’s even more you can do.

So if we go back into the configuration for Panelizer, you can even specify what allowed content should be allowed when you are adding your different Panes inside your Panel. So what these things here allowed you to do is it allows you to set what should be allowed when you’re creating or adding things to your different Panelized Panels, I guess you can say.

So for instance we allowed Custom Content, if you uncheck that, so you can see it should be unchecked right there. Now if we come in here, there’s no way to add custom content down here.

There’s normally a link, we’ll be flowing to get that back, we can come back into our Panelizer and we want to reallow that, and now if we come back in here I want to add, you see there’s now a new custom content available. And this allows you to provide a slim down interface if you have certain individuals on your site that you want to be able to configure these different panels without giving them all of the options.

As you can see when you come in here there’s a lot of options to choose from. Using all those checkboxes you can hide a lot of the options so the user only sees what you want them to see. So this allows you a really flexible way to build out different interfaces and different pages on your site and provide a lot of flexibility for someone who might be doing the content authoring or the content creation on your site.

This is only a little bit of what the Panelizer Module can do. I could spend probably an hour or two talking about all the different features how you can use it and how the flexible things you can do with this module. So go ahead and check it out. This should give you the basic review of what you can do with it. Make sure to follow me on Twitter at smthomas3 and check out my new ebook. Thanks for watching.

Series: Panels SeriesTags: DrupalPanelsDrupal 7Site BuildingDrupal Planet

Drupal 7 Fieldable Panels Panes

Jul 25, 2014

Description:

Episode Number: 159

The Fieldable Panels Panes module allows you to create re-usable and fieldable entities that can easily be dropped into Panels pages. This can be useful if the traditional Add Content panes inside Panels is too limiting for you. This also allows using fields (which are translatable) for your Panels content.

In this episode you will learn:

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. I am Shane Thomas and today we’re going to be going over the Fieldable Panels Panes Module. What this module allows you to do is it basically allows you to build a Fieldable Entity that can be used inside your Panels pages and that may sound a little confusing if you’re not too familiar with the Panels terminology but we’ll go ahead and show you how that works.

Before we get started you can follow me on Twitter at smthomas3, you can also check out code.karate.com and check out the 5 Secrets EBook that we recently released. So let’s go ahead and get started with the Fieldable Panels Panes Module. You’re going to want to make sure you get that downloaded. You are going to need the C Tools Module and really the Panels Module to really make it work the way we’re going to show here.

So the thing that we’re going to do is make sure we get it turned on. So we’re going to enable this Module and first we’ll go over, I’ll kind of show you the problem that it can help solved.

There’s a lot of different reasons you might use this. Almost always there’s probably other ways to accomplish the same thing but this can make things a lot more efficient. So that may be one of the main reasons you really want to use this module. So I do have a Panel page here, so if you’re Panels this will be familiar.

So I have a Panel page and currently there’s nothing in it. Looks like this is old because testing Panes that I was using, we’ll go ahead and get rid of these. But often you may use this Add Content and you may add new Custom Content. So you may put some things in here and that works great. And you can even, there’s even ways to use this custom content but you weren’t allowed to add fields to it and you weren’t allowed or you can but it’s very difficult to add images.

So what we’re going to do is we’re going to actually create a field of Panels Pane where we can drop one in here and one in here and show different types of content. So I’m going to go ahead and get rid of this.

So kind of help solve the problem of instead of using that new custom content and you can use a field of a Panels Pane which has the benefit that each field is translatable and it’s also easier to use. So we’re going to just save this and we’re going to go to the Fieldable Panels Pane Administration page.

You can see there are current no entities of this type so we’re going to add one. But we do, actually we want to go back. You’ll notice that there’s a list page, there’s a Manage Fields and a Manage Display page. We’re going to first start by adding some fields. I’ll go ahead and create an image field and we’ll call it Logo Image.

So it uploads some logos here. We’ll pretty much just keep the basics, the basic defaults and I’m also going to add a Headline Field which will just make it text field. And we’ll keep the defaults here as well and we can rearrange these, we can also go to this Manage Display section which is pretty familiar if you dealt with content types. So we’ll start with the title then we will put the headline and then the image.

We’ll go ahead and hide the labels here and we will save that. Now we’re going to come back to the actual Fieldable Panels Pane admin page and we’re going to click the Add Fieldable Panel page link. You can make the link or the title of the Fieldable Panels Pane a link.

So we’re going to do that and I’ll go ahead and do codekarate.com as the link. You can add a title, the headline, now we upload our image and these are of course are the two fields that we added. They wouldn’t be here if we hadn’t added those fields. This checkbox is important.

This makes this entity reusable, allows it to easily be reused in other Panels pages. We can give it a category, we’ll go ahead and just give it one so you can see where it shows up. The administrative title is where it’s going to show up under inside the actual Panels when you’re adding content.

You can give the description as well, we’ll leave that blank and now we’ll come back to our Panels page to take a look. So now when we go to add content there’s a logo section here and inside there you can see there’s a Code Karate Pane and that’s the name we gave it. There’s only one View Mode so we’ll leave that the same and we will click Update and Save.

Now let’s go ahead and go to this page, you see here it shows up, Code Karate website, our headline and the logo image that was uploaded. And you notice if I hover over this or click on it it brings me to whatever link I specified. So in this case it brings me to codekarate.com. I can hover over this and edit it directly from here and this will open up this specific Pane and you can make changes, revisions or track. You can also set up specific access control roles.

This is very similar to how access control or visibility roles work within Panels. So if you’re familiar with that you’ll be familiar with this. You can allow a specific roles, you could base it on other field. There’s a whole bunch of things you can do there. We’re going to just skip that for now and assume that we want everyone to see it. We’re going to go ahead and add one more just to show another way to add a Fieldable Panels Pane.

If we come back into our Panel Page and let’s assume we wanted to add one here as well. We could of course go back to the Fieldable Panels Pane admin page and add one. We can also add it directly from in here. So if you click on Fielded Panes, you can click Panels Page. So let’s go ahead and make one for to link out to Google. And if we want to make it reusable we can check here and then it will show up in the list alongside that Code Karate one.

So we’re going to go ahead and finish this and now you can see it show up, we’ll update and save. You’ll notice inside the logo there’s the Code Karate one and the Google one now. So they can be reused on other Panel Pages if you need to. We save that and come back you’ll see we now have both of those link showing up. We also probably want to make this images the same size which is easy to do.
You go ahead and back to your Fieldable Panels Pane and you go to Manage Display. You can change this to use specific image style. So we’ll set it to use the medium image style, you got to click save which I forgot to do there, update, save. Now if we refresh this page you’ll notice of the same size.

So Fieldable Panels Pane can be used for a whole bunch of different things. They’re very flexible so they can be used whether you want to display sections or different regions inside the Panels page and you want those to be fieldable, you want those fields such as this to be translatable. All that stuff is possible.

In a future video we’ll probably go over how you can style using the Panelizer Module I believe. How to actually style some contents inside this Fieldable Panels Pane. But that’s it for this time. Thanks for watching the Daily Dose of Drupal and make sure to follow me on Twitter and check out the EBook. Until next time, see you.

Series: Panels SeriesTags: DrupalEntitiesPanelsDrupal 7Site BuildingDrupal Planet

Drupal 7 Splashify

Jul 23, 2014

Description:

Episode Number: 158

In this episode we cover the Splashify module. This module is used to display splash pages or popups. There are multiple configuration options available to fit your site needs.

In this episode you will learn:

How to set up Splashify How to configure Splashify How to get Splashify to use the Mobile Detect plugin How Splashify displays to the end user How to be awesome Full Text: 

Hey everybody and welcome to Episode 158 of the Daily Dose of Drupal. I am Adam and today we’re going to be looking at the Splashify Module. Splashify Module is a module that really works with your marketing team. It allows you to add content and have it appear on page load in the Light Box or other redirects or stuff like that and we’ll get quickly into more of those features and hopefully get a good idea what Splashify Module can do.

But before we hop in to all of that, a couple of housekeeping things, as you might be aware, make sure to check out our 5 Secrets to Becoming a Drupal 7 Ninja EBook, released later last week and great feedback so far, definitely worth, check it out, again it’s $5 per sheet if you could check it out.

Also you can go ahead and follow myself and Shane on Twitter, better off only Shane to be honest. You can follow him at smthomas3, he’s a good follow for Drupal knowledge and other wisdom so make sure to follow him.

All right, so let’s jump in to this Splashify Module. Again, Splashify Module is just an easy way to display Splash pages either in Light Box or redirects for user. Splashify does come with a few other requirement modules, a couple of other Libraries module.
You’re also going to need to do the J Storage Plug-In Module which can be found by click on the link or get up here so you can fork it from there and then it needs to be drop into the Sites All Modules, excuse me, Sites All Libraries folder, as well as if you want to use the Color Box Functionality which I will probably recommend.

We’re going to need a Color Box module from drupal.org as well as the Color Box Plug-In and again that can be dropped in the sites All Libraries folder as well. So if we actually hop over here I’ll show you all the different ones that I have installed so far. So in here my sites are all libraries.

There’s three different plug-ins that I’ve used, Color Box, the ones that you should be aware of, the J Storage, that is the other one that’s required. That basically allows for caching issues, so people don’t get to pop multiple times and avoids annoyance with your user. And then the other one that you didn’t…I’m just mentioning now is Mobile Detect.

Mobile Detect is a utilized…works with the Splashify Moduleto display a pop-up based on screen size. So you can actually splashify a different pop-up or a screen to show up or use it on a mobile device or a tablet or a desktop. So using this plug-in allows our functionality to be possible. All right, so once you get those three plug-ins installed, again in the Sites All Libraries folder on your Drupal site then you just need to install the Splashify Module as you can see going in your modules folder.

So once you get that installed you just need to enable it. I’m going to turn the Splashify module on. Again make sure you have your Color Box Module also turned on on your Drupal site as well if you’re going to use that functionality.

One thing to know too is that if you ever get…if your user need early direction on what exactly need to be downloaded with the Splashify, they actually provide a good documentation on the read-me file under the module. That’s where you can find out exactly what plug-ins do what and where to put them and everything like that. So definitely reference that read-me.txt file on the module.

So once you have the Splashify Module enabled you can go to the configuration page. There’s 4 different tabs on the top here, When, Where, What and How. They kind of work left to right, it’s how you build it. So we’re going to work through this and get it all working and hopefully show you what it does. So first question is when should the pop-up show up, only show if you can specify by role.

So we’re going to say we only want to show it for anonymous users but down here again you could just restrict for certain roles if you have multiple roles on your site and stuff like that. But we only want to show it for anonymous user. Let’s see her How up, it should be visitor/page. It defaults to Off which obviously means it’s not active but you can obviously specify always, once, daily or weekly.

For this demonstration we’re just going to use Always, we don’t want to avoid any caching issues but you obviously can specify that based on what you prefer. And then if you want you can enable unique mobile splash which this is what I’m talking about earlier where you can display different splash screen based on screen size. And then again you can set how often people will see that as well.

In this demonstration since it’s on a desktop computer I’m not going to show the functionality of how the mobile settings works so we’re just going to disable it for the settings. But again you have to have that mobile Detect plug-in installed to get mobile settings to function.

So save the configuration there and then we’ll hop over to the Where tab. Here is exactly what it sounds like, Where thing is going to be displayed. You can display it by front page, all pages or you can again do list pages. You could specify one of two ways. You can list all the pages you want. The screen show up on org.

You can check this box below, you can do the inverse if you want every page box at the front page. First example is to, All Pages, that must be really annoying but, where’s the example. This is where you actually start to build out what your Splash or your box is going to look like. 4 different options in here.

So you can pick a URL so you could make a page and have it display through that and we’ll redirect to that or you can specify text and customize it that way. So for example if I do, my pop-up, make sure you select the text format here, that was the folder text. So how this should work then is when my pop-up appears or my slash page, I should say this is my pop-up only, it’ll be unformatted.

So hopefully that’s what happened. And then if you go to the how, this is how the actual Splash page is going to appear and this is where that color box option would come in. You obviously could redirect them it to the page and you could open it in a new window or new tab or you can do the color box option which is the one I’d really recommend because it keeps your user on that same page, so it’s pretty helpful.
You can specify directly the size you want, it just be within height, no pixels needed but let’s make it that way and then we’ll save that and that should be it. So now we should see a light box appear on every page saying “this is my pop-up”. So if you hop over to another browser, there was an old example here but let’s say, we’re going to try this again once we do a refresh and then you see it says “this is my pop-up” unformatted.

Again this is 400 x 300 width that I specified and then you’re just using that color box module pop-up. So pretty easy, you can also, back on this other screen you can also customize this HTML whatever way you wanted or you could use a CSS to style it. So for example if I type in this, it’s just an in-line style with colors Blue, I’ll save it and then when I come back to my other screen and refresh, oh I forgot to change the text format to full. Obviously let’s not cut the rest of that.

You can change it to full HTML and refresh and you can see my text color is now change to blue. So again you could do in-line styles here or you can specify a possibly a class of awesome or something or whatever you want and then you could style that with a CSS style sheet and then get it to display. You could also put images in here as well, whatever. It’s fully customizable there as well as specifying different pages and stuff like that. So you could path in URL alias to redirect you.

So then you obviously have fully customizable pages there as well. But if you want to get it to appear in the light box and stuff like that you can use Classes or In Light Styles to get your styles to work. So that in all…in a nutshell this is Splashify Module, really nice marketing tool for attracting either to you a promotional item or using or EBooks or whatever else, it might be, obviously pretty customizable with different settings or stuff like that.

So that’s it for today’s episode, also make sure to check out our 5 Secrets to Becoming a Drupal 7 Ninja. I appreciate if you could purchase the book. All right guys, well until next time. Thanks, bye.

Tags: DrupalDrupal 7Drupal PlanetUI/DesignJavascriptResponsive Design

Drupal 7 Mobile Friendly Navigation Toolbar module

Jul 11, 2014

Description:

Episode Number: 157

The Mobile Friendly Navigation Toolbar is a replacement for the standard administration toolbar that comes with Drupal 7. This administrative toolbar is responsive making it much easier to administer your Drupal website from a tablet or mobile device. There is nothing particularly difficult about the module, however the installation process is a little more complex than most modules. This video walks you through the setup process and shows how to download the necessary libraries to get this module working.

Tags: DrupalDrupal 7Drupal PlanetSite AdministrationResponsive Design

Drupal 7 Jammer Module

Jun 27, 2014

Description:

Episode Number: 156

In this episode of the Daily Dose of Drupal we go over the Jammer module. This simply module allows you to show/hide content type elements from various roles. This elements could include author panes, menu panes, comment panes, revision panes, etc.

Full Text: 

Hey everybody and welcome to another Daily Dose of Drupal, I am Adam and we are Episode Number 156. Today we’re going to be taking a look at the Jammer Module. The Jammer Module is a nice easy way to hide and show different display items on your node, add form or node edit form.

For example if we hop over here … what I’m referring to are the menu revision URL settings on different node content type. The big use for this of course is when you’re building a website for the user. They can get confused when they see different sections like this and ask you what all these mean, how do I configure them or you … what typical is breeze over and say don’t worry about them. Well this module eliminates that … those two issues and just doesn’t show them to that user. I mean, it can be configurable on different roles to … so it’s a nice way to show content to certain people or show section to certain people but not others.

Before we jump into the module, real quick, a couple of house keeping things, you can follow myself on Adam Learing or you can follow Shane @smthomas3, I appreciate you to those follows. Also if you’ve been part of the Code Karate newsletter you probably see a couple of e-mails about our new kick starter campaign with our other company’s stem views. Really appreciate any help you guys can get and check out our videos there, four days left and still have about $8,000 to go so anything you could do would help, I appreciate that.

Also we have been promising a new e-book, this is coming, it is within the next week and by next week we will have our first ever Code Karate E-book. I’m just staying in touch on those things as well as some other little things we’re working on, go ahead and sign up to the newsletter on codekarate.com, I appreciate that as well. Alright let’s jump into the Jammer Module; so first thing we want to do is we want to get that module enabled so we’re going to hop over here and turn the module on.

I can see there’s 5 different settings here for the Jammer Module. On the ones we’re going to worry about today are the Content Format, Content Form Jammer, Engineering Jammer. Those provide almost all the functionality of the Jammer Module in my opinion. Well as you can see there’s also some stuff that you can fiddle around with to hide and show different things as well.

So once that gets turned on here we’ll head over to the module configuration page and let’s … there under Jammer and then as you can see here there’s a list of all the different things we can display to our users or not to display and then site you to this … text areas there is different, all our guaranteed content types so we can use to hide and show based on.

So also at the bottom here there’s kind of a nice little feature, you can actually do some hiding and showing with previous delete button. So if you don’t want to use a build or delete content you can restrict that by selecting stuff within that field. For the Demo here day we’re going to send you the ... we’ll do the Menu and the Author. One thing too is obviously you can select multiple by holding down the command key on Mac or Ctrl on Windows on a Linux machines. I’ll display multiple content types.

So anyway; as you see here I selected basic page for both removing the Menu options and removing the Author options. So you should be able to in theory rate … well we hope to see is we should be able to see the Author options and the Menu options on basic page content type. So go down here and make sure to stay and then here’s my basic page nowhere to add for that content type and when I reload you’ll see that I still see the menu and author which will lead of course for you to believe it’s not working but what the Jammer module does is it works with user permissions to hide and show different sections.

So when we load the Permissions page and we go to the Jammer section you’ll see that there is override capability to build independent permissions. So we see here it says “override Jammer to allow users to view body options” and you can see administration role is checked and that’s what I’m on right now. So I need to uncheck that and say “don’t override, use what’s in the Module Configuration page. So I want to collect Author Off and Menu Off so it’s the two that I selected over there.

So now what should happen is I should not be able to see the author and Menu options within that content type. So I save and then if I go over here and I refresh again you’ll see that it still remains which is obviously not what we expect to see but there is one cavity out here, I am actually User 1 on my Drupal site and obviously User 1 always sees everything within the site. So it doesn’t … it kind of override all permissions but I didn’t select authenticated not to see that so I do have another authenticated user on this site and if I go ahead and refresh on this page you’ll see that I no longer can see the Menu and author section down here.

Even though I’m still authenticated user I’m just the second user on the site so I am bound by the permissions and the module configuration of Jammer Module. So again; really simple module, not too much going on there but actually kind of a powerful one. We’ve stumbled across this one and found some use on it. Obviously the biggest use case again is for using it with clients that don’t … aren’t familiar with the Drupal interface and all the corks about it so it’s good without limit options which is never a bad thing when dealing with people that are not as experienced with Drupal.

Like I said you can play around with a few other things as well with the Jammer Module. There is a generic Jammer here, you can remove form items so you could remove different fields on a web form, I just got to grab the form ID and element ID which are provided on that form and also you could play around with other different feed and messages and all that stuff as well.

Alright so thanks for watching, again make sure to check out codekarate.com for all of our other post and stuff like that, what’s going on and make sure … we really appreciate if you check out our kids that are in campaign, four days left to go, really we like the big push to get that out there. I appreciate all the help you can do, thanks a lot guys and we will talk to you next time, bye.

Tags: DrupalContent TypesDrupal 7Drupal PlanetSite Administration

Creating Drupal Commerce add to cart links

Jun 25, 2014

Description:

I recently ran across a problem of needing multiple Drupal Commerce add to cart buttons on a single page. Instead of trying to add a second add to cart form, I decided it would be easiest to create a custom link that could then be used to add products to the cart. This is useful if you need to create multiple add to cart links on the same page, or if you just need to create custom add to cart links to place in other areas of your Drupal Commerce website.

Type: TextTags: DrupalDrupal CommerceDrupal 7Module DevelopmentDrupal Planet

Drupal 7 Calendar Module

Jun 13, 2014

Description:

Episode Number: 155

The Drupal 7 Calendar Module makes it easy to build event calendars in Drupal. It makes use of the Views module to make it all happen.

In this episode you will learn:

How to build a content type with a date field to use in your Calendar How to build a basic Drupal 7 Calendar to display events How to use Views to change the settings of your Calendar How to create a calendar legend using a taxonomy term Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 155 and we’re going to be going over the Calendar Module. If you’re not familiar with the Calendar Module, it essentially allows you to build an Event Calendar that has month, week, day or even year views for the calendar itself.

Before we get started I am Shane Thomas, you can follow me on Twitter @smthomas3, also go ahead and follow Adam Learing on Twitter as well since he’s been doing a lot of Code Karate videos lately. We do have an e-book coming out soon, it’s coming and make sure to sign up for the newsletter if you haven’t already. We do appreciate the follow there. We’re going to go ahead and get started.

The first thing we need to do is make sure we have all the date modules downloaded, well it’s one date module I guess that you can download one project from drupal.org but a multiple modules that you actually need to enable and you’re going to need the Date API, we’re using the Date Pop-Up, you’ll need the actual Date Module itself and Date Views for to follow along with this example.

The next thing is to make sure you have the Calendar Module enabled; I shall go ahead and enable this right now. The way the Calendar Module works is that it essentially … it can use a content type … it can use other types of entities as well but we’re going to go ahead and just stick with Nodes for this example and it uses a Date Field on that content type. So we’re going to go ahead and add a new content type and we’re going to call this Event, we’ll the title Event Title and we’ll pretty much leave everything as default.

So we’re going to click Save and Add Fields and we’re going to add an Event Date Field, I’m going to select Date and we’ll make it a pop-up calendar and we’ll click Save. We next need so select what Date Attributes we want to collect. Since we’re doing a calendar we’re going to want to have Week and Day Views.

We’re going to go ahead and collect all of these up through the minute, we don’t need up to the second. We’re also going to offer an In-Date but not necessarily require it. That allows us to set a specific duration for the event. We’ll use the site’s time zone handling and we’ll leave everything else the same and click Save. We just confirm that everything is what you need, you can add some help text, click Save Settings and this will bring us back to the actual manage fields.

I’m going to go ahead and pull the date up here just to make it a little easier and we’re going to go ahead and add just two quick events. So we’ll call one Event 1 and we’ll go ahead and select June 9th, we’ll go from 7:15 to 9:15 for the first event, we will grab some text to add to the body and we’ll click Save. We’ll then add one more quick one, we’ll call this Event 2 and let’s not collect an End Date here. We will just go to June 10th and say 11 o’clock and we won’t have an end date. We can also grab some text and paste it in and there we go. We have our two events created with our dates set. The next step is to of course build our calendar.

The Calendar Module is all based off of Views so if you’re familiar with Views some of it is going to be just second nature but it is a little bit different.

There’s a few additional options and a few different things you need to look at. So if you go to the Structure Views page you’ll see there’s an Add View from Template. You’re going to want to click that and that’s going to give you a list of templates to use. It’s all based on the Date Field you created so you’re going to want to find your date field and in this case Field Event Date and use that template. So you’re going to go ahead and click Add on the Date Field that you want to use for your calendar, you can give it a name, we’ll go ahead and keep calendar and you click Okay there now you’ll have what’s pretty familiar, just a normal Views page.

You can see there’s a month, week, day and a year page view. These are all … these first four are Page Views, there’s also a block and an upcoming events block. So we’re going to go ahead and just keep everything at its default now and click Save. If you click this View Month it’s going to bring you to your actual calendar. You can see there’s tabs on top for month, week, day and year.

If you click Next you can see that we have an Event 1 and an Event 2, if we click on it it just brings us to the actual Node Page itself. So pretty much what you expect from a View, however there are some other things we can do to this. One thing you’ll notice is the path that it creates is based off of your field name and it’s not necessarily the cleanest looking path so we’re going to go ahead and change that.

We’re just going to make it since we’re only having one calendar on this site we’re safe to do this. If you’re going to display multiple calendar you need to of course figure out what you wanted each path to be. So we’re going to do this for all the page displays so we’ll say calendar/whatever the … whether it’s month, week, day or year. So that’s the first thing that we’re going to do. The next thing is if you come into some of the settings over here you have specific calendar settings.

Here are a few different options you can decide if you want to display it as a mini calendar if you want to use full week names, abbreviated names, if you want to show week numbers, how many items to display. If there are multi-day event so an event that stands across multi-days … multiple days so let’s say you want from a Monday to a Friday you could select to hide specific rows for multi-day events.

We’re going to leave everything at its default because that’s pretty much what we need for this example but you can change it if you need to. If you click on the Settings Link next to Calendar Entities there’s a few more options here. One of the cool ones is this Legend Colors. Here you can change the color or add a little stripe I guess on top of the actual event.

So you can kind of differentiate between different types of events and you can do this by adding a separate content type. Let’s say you had an event … a certain event type and maybe you had a group event for your entire team or team event. You could add another Content Type and you could give each one a different color.

When you’re creating your second content type you just need to make sure you use the same Date Field so instead of creating a second new Date Field you just want to add an existing field and add your Date Field. The other cool thing you can do is you can create it based on taxonomy and that’s what we’re going to show here as an example. So we’re going to add a new taxonomy vocabulary, we’re just going to add a new tab here and we’re going to call it Department and this is going to allow us to … in this example a Department Calendar for maybe a Sales department and maybe a Development Department.

So you could have different events show up a little bit differently so you can differentiate between the different types of events. So we’re going to add two terms; first one is just going to be Sales and the second one will be Development. So we will come back to our Calendar … or actually no, first we want to add this field on the content type so we’ll go to our Event Content Type Manage Fields, we’re going to add a term of reference field and we’ll call this department and we’ll use a select list because we only want one option to be selected at a time.

We want the vocabulary to be Department, click Save and make sure that only one option is able to be selected at a time and click Save there. So now move this around and save it. Now we need to come back to our two events that we have, just Event 1 and Event 2 and we will edit those. The first one we’ll go ahead and say is a Development Event and the second one we’ll go ahead and say as a sales event. Now we can come back to our Calendar here. Once this reloads, if we come into the settings we want to select based on taxonomy, however you’ll notice this is not going to work. It says you must add a term field to this view.

So this is to tell the calendar which terms to allow. So you have to add a field here for your department or for whatever term you created and added to your content type. We’re going to go ahead and add that and we’re going to go ahead and click exclude from display because we don’t actually want to display it on the View but we do want it to be available for the actual calendar module to be able to read and to use for the legend of colors.

So now if we come back to taxonomy you’ll see the term field is department because that’s the only one we have added and you can select different colors for the different departments. So we can say the development is some type of red and perhaps the sales is some type of blue. So we will save that and click Save. Now if we come into our View Month you’ll see we have a red one for development and a lighter blue for the Sales.

If we go to the week just to see how the Week View looks you’ll notice that those stripes don’t necessarily carry over but you do have a Week View and a Day View is also there. I can just edit the URL to get to the 9th you’ll see we have Event 1 there and on the 10th we have our Event 2. So that’s, I mean, there’s the basics of getting started with the Calendar Module, nothing too complicated but there are a lot of moving parts so you kind of get to play around of some things sometimes.

One thing you will notice is you can do legend colors for the Week and Day Views and even the Year View I believe but you just have to set those up so you can go ahead and do that. One other thing you can do is you can add a legend to the actual calendar and that will show you what the colors actually mean. So we’re going to go ahead and drag this up to our sidebar here just to show it, we’ll save it and then sometimes at least the first time I did it I had to actually come in here and configure it.

Make sure you have the right legend view. I just go ahead and have the block title be none but you could have that say Calendar Department, we’ll just say department and in this case I only want it on calendar pages. So any page that starts with a calendar just so it doesn’t show on every page. So if I save that and come back you’ll see I now have a department legend for development and sales. If I go back to the Month View you’ll see that they match up the colors so you can easily tell the difference between the different types of events.

So that’s all we’re going to go over today. There’s a lot more you can do with the Date Modules and the Calendar Modules so go ahead and experiment with those, let me know if you have any questions or run into any problems and as always, make sure to follow me on Twitter @smthomas3, follow @AdamLearing and we will see you next time. Thanks for watching.

Tags: DrupalDrupal 7Site BuildingDrupal Planet

Let's build an even better Drupal

Jun 3, 2014

Description:

If you are familiar with me or with Codekarate.com, you know that one of the core goals is to help Drupal developers, designers, and site builders learn and improve their Drupal skills. Another one of my goals is to work to improve Drupal and the entire Drupal ecosystem. There is no better way to do that then to start getting more people involved with Drupal at a younger age.

Type: TextTags: DrupalDrupal PlanetGeneral Discussion

Drupal 7 Multiblock Module

May 30, 2014

Description:

Episode Number: 154

In this episode, we are taking a looksie at the Drupal 7 Multiblock module. This gem, allows you to create separate instances of your site blocks. This is a helpful tool when you want to display blocks in different regions of your site without having to create separate entities or blocks. Note, at this time of recording we are using the Drupal 7.x-1.1 version. Even though this isn't a recommend release, it seems to function properly.

Full Text: 

Hey everybody and welcome to Episode 154 of the Daily Dose of Drupal, I am Adam Learing coming to you … a couple of thing before we get started. Today we are going to be covering the Multi-Block Module, pretty easy module but actually kind of a helpful module especially if you are beginner use and not as familiar or comfortable with using code, nice little module that extends some other Drupal Block functionality.
Before we jump in to that module I just want to quickly mention a few things, head over to codekarate.com and make sure to sign up for our newsletter there sending out typically once a month a couple of times … maybe twice a month updates on either our post or happenings in the Drupal community, stuff like that, nothing too crazy but just a nice where you stay informed.

Also if you’re on social networks especially Twitter make sure to head over and follow us both. You can follow myself @adamlearing on Twitter or you can follow Shane @smthomas3. Either are be good, Shane has probably touched better since he got tweets a lot more often than me. Anyway; anything else about tightening up … so anyway let’s get started with the Multi-Block Module, again the Multi-Block Module like I said is an extension of the block from and Drupal Core but as the ability for you to use the same Block or Multi-Block multiple places on your site and I’ll show you a couple used cases for that here shortly.

One thing to note is there is not a recommended release for the Multi-Block for Drupal 7 which is what I’ll be using but the 7.11 version seems to work just fine so go ahead and you can download that on the drupal.org site. So once you get that installed we can head over to our site and we’ll enable our Multi-Block Module, turn that on. No other modules or anything else required for this so it’s all you need to do.

So once you get it turned on head over to Structured Blocks Instances. If you don’t have this admin menu installed which is what you’re seeing in my screen, you simply go to structure, click Blocks and then there’ll be a tab here on the top called instances. So let’s go ahead and click that. So in here you can do a couple of things; you give it a title and then you select the block that you want to clone essentially. So in this sense first you can actually switch back and head to creating a block so I can show you how this works.

So we’re just going to add a Block and we’re going to give it a simple name here and then we’re going to set this in our sidebar first or our left sidebar or we’re just going to list it on every page. So once you save that … simple, this is obviously basic Drupal stuff here but just to show you how this Block will appear by default so if you actually go look at our site here you’ll see it’s right here on the corner, it say Welcome to Code Karate. So that’s the block that we just created but now let’s say that we actually want that exact same block also to appear in the footer. So that’s where this Multi-Block Module comes in and this instance thing we’re speaking of.

So if we go to the Structure Blocks click instances, let’s give it a title … I recommend using a separate title so you can tell the difference, this is going to be “Hello World 2” and then select the block that you want to multi-block or clone. So there’s the Hello World block I just created, save this instance. Okay so we have our instance created, we have our Hello World Block so if we go to our [inaudible - 0:04:37.0] or back to our block layouts we can see that now I can see a Hello World 2 here which is an indirect clone of this Hello World right here.

So I’m just going to step this Hello World 2 in my footer first column and go ahead and save that and then you’ll see here once the page saves, loads, you can see I now have a second block that is the direct clone of my first block. So Hello currently here and Hello currently there. One thing to note is actually if I configure and change this block, say I want to add some exclamation points and save it it is a direct clone of the block so wherever I change in the master block will be reflect automatically in the second block.

So you know how to change it in two places and they’re tied together. Obviously in this case that … the case I showed you is not as useful as some other cases. One very interesting one would be using a Newsletter Block whether you’re using Mail Chimp or A Webber or your choice of them. They typically come with one block so say you want to have it on your sign-up form on your left hand side block on the front page but on every other page you want to have a newsletter block also appearing in the footer or the multi-block module is going to allow you to do that. You can set different feasibility rules or you can also just set it in different region based on the visibility rules or pages.
So that’s kind of a really good use case and one that we’ve used in the past for that. Of course there are other options to pull this off. You could use Panels … Drupal Panels, a little bit … these videos are now on Code Karate, I recommend you would check those up first but like I said the Multi-Block Module is a really simple no code needed option to display Multiple Blocks in different areas without having to duplicate the exact same content.

Alright guys before we head out I just want to again just mention codekarate.com hosting a bunch of videos there, obviously 154 at this point as well as some other blog post, check out the newsletter, I appreciate anybody signing up, we really appreciate the commitment there and also we’ve been saying this and it is coming and we are working very … we’re getting very close to producing our e-book on The Five Secrets to Becoming a Drupal 7 Ninja. So make sure to keep that in mind, signing up the newsletter will get you first depths at that as well. Alright guys thanks a lot and we’ll talk to you later. Bye.

Tags: DrupalBlocksDrupal 7Drupal PlanetUI/Design

Drupal 7 Weather Module

May 28, 2014

Description:

Episode Number: 153

In this episode, you are introduced to the Drupal 7 Weather Module. This first video covers the basics of the module without using integrations with any additional modules. Within the video you will learn how to configure a weather display and location and place the block onto your website.

Full Text: 

Hey everybody and welcome to Episode 153. I believe . I am Adam Learing and today we’re going to be covering the Weather Module, yes the weather. Simple module, again but kind of nice if you’ll have … if you want to add a little bit of information to your user or you could obviously just put on at the back end of your site and keep it for yourself to know what’s going on around you.

Before we get started make sure again to head over to codekarate.com, check out all the videos there, all the content. Also when you’re there make sure to sign up on the Code Karate newsletter, we do send out occasional e-mails and information about what’s happening in Drupal and Code Karate related stuff. Also one important thing to note is we are releasing an e-book soon, count the days down.

So make sure that you sign up for the newsletter to check the box to receive the free e-book from Code Karate. Also make sure to follow myself on Twitter and Shane Thomas, you can follow myself @adamlearing, you can follow Shane Thomas @smthomas3, I appreciate either of those being followed. Alright let’s get to the module, so the module like I said we’re going to work on is the Weather Module.

Pretty simple module, there are a couple of different versions that you can use as far as modules for Drupal are concerned but we’re just going to stick with the Weather by far the most popular … one other thing to note is there’s actually a lot of integrations that we work with the Weather Module, you can see them highlighted here. In this first video I’m just going to do the basic out of the box Weather Module but in the follow up series I’m going to cover a few other different integrations that you can use well using the weather module. So take a look at those and look forward to those in the future.

Other kind of cool highlights about the weather module before we get to downloading it, displays the current day as well as the next day’s forecast and then it can even go further as the 7 day forecast so you get a wide variety there. Works in both Celsius and Fahrenheit and other temperature … whatever … temperature Dalmatians, what else … it works with Blocks pretty well so you can put it wherever you want in your site, again that works putting on your front end or your back of your site or different pages, works with all those different rules.

Okay so let’s get started; so we hop over to our Code Karate site and we need to turn on the module so we search for the module, enable it, once we have it enabled let’s go over to the configuration page here and pretty simple. So the first thing you need to do is you need to add a display for the weather to work so I’m just here to select the location in this display as well.

So click Add Display and here is where you can set different parameters and different displays for the weather module, what temperature you want, we’re going to do the Fahrenheit because we are in sunny South Dakota here and we use Fahrenheit, wind speed, we’re in miles per hour, pressure, I’m not actually sure what the standard is, distance, we’re going to do miles instead of kilometers and then there’s a little checkboxes here, obviously it shows up sunrise and sunset. This is all up to you and what you want to display to yourself and the user. I’m going to go ahead and check all these, all of them, wind chill, wind directions and stuff like that. So I’m going to save it, once you have it saved here it’ll give it a default name so system I displayed 1 and then you just need to add your location. Pretty much any location you can think of is in here.

We’re going to pick United States, auto complete is down and gives you only places located in the United States, I’m going to pick Sioux Falls, South Dakota here, right there and then the display name which will show up to the user site and we’re going to use Sioux Falls, South Dakota, go and save. And it seems to be slight bug when you save it the first time it doesn’t seem to save a name so you … I don’t know, I have to go and do it again and once you save it the second time it seems to stick.

So just make sure you look at that after you save it the first time and see if it did catch and we don’t lie … submit a bug, there might be a bug in the queue as well but anyway; once you get it saved, it makes you saved and then it automatically creates the block for you so if we head over to the block’s page on Drupal you’ll see that it’s down here there’s a block for System Weather Display 1 and you also notice that there are four other different blocks you can drop in.

On these we’ll go cover some further videos but Smart IP which is kind of cool … I’ll actually grab the weather of the Users IP Address so it’ll give the users coming from us in Colorado for example and give the weather there location and similar types to that but we’ll show it those in the future videos. We’ll just drop this video or this block in … let’s do it in our second site where I actually … I’m going to save that, you’ll be able to see it sitting in there so when we go to our home page you can see it’s right there.

So you can see obviously today in South Dakota we have 60 degrees Fahrenheit, cloudy which is about right and tomorrow we’re looking at 69 degrees and partly cloudy. You click on the name itself it will give you a breakdown of the forecast, I believe it goes out 7AM … actually up to 11 days I was running on that but I think it shows you here so you can get a decent look of what’s going to be happening down the road. I also notice that do the check boxes I check, here comes the Fahrenheit, here’s our wind speed, pressures all that stuff.

The Weather Module also works really well with views which I will highlight it in additional videos so we can tell it which we want … what we want to display. We don’t want to display all these fields if we didn’t want to and we use that to integrate with other content type as well. So that is the weather module guys, pretty simple, not too complicated at all but a nice little have if you want to add a little bit more content to your site as well as provide your users with a little bit more information.

Alright so again make sure to follow us @adamlearing or @smthomas3 on Twitter and also just head over to Code Karate, check it out, let us know your thoughts, if you have any videos you want to see or modules that you want us to review shoot them our way, we’d be happy to take a look and get them reviewed. Alright guys until next time, thanks.

Tags: DrupalViewsDrupal 7Drupal Planet

Drupal 7 Scheduler Module

May 23, 2014

Description:

Episode Number: 152

The Drupal 7 Scheduler module can be used to easily publish or unpublish nodes as a specific time. This module can be used to automate the publish of content such as blog posts and can be used to ensure your posts are published at the time you want them to be published. Using this module, you could create multiple posts and schedule them to all published, this way you don't have a lot of content created at once.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 152 and we’re going to be covering the Scheduler Module. The Scheduler Module allows you to set specific dates to publish and unpublished Nodes.

So for instance if you have blog posts and you wanted them to be published in a specific time you could use this module to schedule exactly when they need to be published and the next time Chron runs after that specific time your node will actually be published so you’ll need to make sure you have your Chron running often and we’re going to go ahead and take a look at this but before we do make sure to hop on over to codekarate.com and sign up for the newsletter if you haven’t already, it’s generally over here on the left block and now I’m already logged in or signed up and follow me on Twitter at smthomas3, also you can go ahead and follow Adam Learing on Twitter at adamlearing if you ever tweet, I don’t know if he ever really does but it might be worth to follow either way.

Let’s go ahead and get started. So we’re going to hop over to our development site here, just a simple pretty standard development site and we’re going to go ahead and turn on the scheduler module. Looks like it is already turned on I believe. So we’re going to go ahead and click … you want to make sure you enable that and then you’re also going to then need to configure it.

So once you are in the configuration page you can set the date format and you can set it to use a standard text field. We’ll start with this and we’ll also show how you can use the date pop-up calendar to make that a little easier for users to enter the date or for you to enter the date. You can specify that the user only selects the date and there’s a default time.

This is nice if you want to always publish your blog posts for instance at let’s say 8 in the morning. It will just default it to 8 o’clock and this default date would always provide the default when you’re trying to schedule when your blog post are actually published. You can add some extra info which just gets added as a description so we don’t really need that. So we go ahead and click Save and you now need to setup which content types you want scheduling to be enabled on.

So we’re going to go to our content type page and we’re going to go ahead and we’ll look at the article content type. We’re going to make sure we have this … so it’s not published by default and we’re going to click on the scheduler tab that is now going to be available once you turn on the scheduler module. Here you have two options; you can either allow scheduling or schedule publishing for the content type so that would be if you want to turn on a blog post for instance on a specific time but you can also schedule the unpublishing for a piece of content.

So let’s say you had some kind of event that was going on just for a certain amount of time or you had some kind of post you wanted to only show for specific amount of time. You can have it published at we’ll say 8 in the morning and then unpublished at 5 in the afternoon. So you can use that, we’ll go ahead and just check publishing for now, when you use … you’ll notice when you check or uncheck there are some extra options you can look at.

So the first one is to change the content creation time to match the scheduled published time. By default the contact creation is going to be whenever you first created the unpublished version of the Node since we want this to be … to make it look like it was published when it … or it was created when it was published. We’re going to go ahead and check that.

You can check this box because this will … this next box will require that the person actually schedule something. We want this to be optional because in our case we’re going to do blog post or articles we may want to actually just publish it whenever we created versus waiting but you can require that everyone gets scheduled and you can also have it create a new revision.

There’s a few advance options, so if you try to specify a publication date that’s in the past you can either display an error message, publish the content immediately or schedule the content for publication on the next Chron run. We’ll leave that at the default, unpublishing is pretty much the same options, it’s very similar so we’re not going to go over that part and when you want to display the scheduling options you can display as a vertical tab or a separate field set, we’re going to leave it at the default, we’re going to go ahead and click Save Content Type and we’re going to add a new article.

So we’re just going to create a test article, some fake content here, add an image, and now you’ll notice when we get down here is where we get to the scheduling options. So the first is just a simple text box and you can see it tells you the format that you need, it tells you the default time is 8. So leave the date blank for No Schedule Publishing. We’re going to go ahead and just put in the date here and in this case I’m going to set it for 7:12 AM which is in about 1 minute.

So I will go ahead and click … I’ll take a look and see if it’s not going to be published, so I’ll save that. It says this post is unpublished and will be published at the date that we specified it was created. If we come to the content page you’ll notice that we have this testing article 1, 2, 3 here that is not published and now we just have to wait about a few seconds here and it should be about ready to go.

One thing we’ll have to do is run Chron if you have Chron schedule to run periodically then it will go ahead and trigger as soon as the next Chron run and actually goes but since I do not have Chron set up I will need to go ahead and run Chron manually. Now assuming we let enough time go by this should have published that article which it did.
So you can see that it’s published, we come to the page and refresh you’ll notice that the submitted date has change from 7:11 to 7:12 because we check that box and tell it to update the correct date, we have our post and now it has been published. Very easy, really easy to just drop this module and then get it working. One quick thing we’re going to do is we’re going to turn on the Date Module.

So we want Date Pop-Up and Date API and Date, I’ll go ahead and click Save, once this runs we’ll go back into our Scheduler Configuration Page and we’ll select the Date Pop-Up Calendar. Here you can set the Date Pop-Up a minute increment, we’re going to set this to 15 minute increments and leave everything else the same.

Now if we go to Add Content, we go to Add Article, if we come down to the bottom scheduling options you’ll see we have a nice pop-up calendar. So we can schedule it for 10, 15 or 11:15, just notice that it goes up in 15 minute increments. So that’s really all there is to the Scheduler Module. If you want it to unpublished it would be very similar
.
You have just the Unpublished textbox or Unpublished Date Pop-Up Fields where you can set when you want it to be unpublished and there’s really not much more to it so go ahead and check it out, see what you think. If you have any ideas for other videos let us know and if you need help with anything you know, come to Code Karate, click the Contact link and let me know what you’re working on. Until next time, thanks for watching the Daily Dose of Drupal, see you.

Tags: DrupalDrupal 7Drupal Planet

Using Views with the Entity Reference module in Drupal 7

May 21, 2014

Description:

Episode Number: 151

If you want to learn how to use Drupal 7 Entity Reference fields with the Views module you have come to the right place. I first covered the Drupal 7 Entity Reference module in the Daily Dose of Drupal Episode #7, but I never went into the details of how to use it in a view. In this episode, you will learn how to create a couple Entity Reference fields and use the Drupal 7 Views module to display the referenced/related content. This episode goes over the basics of how to use Views Relationships and Views Contextual Filters.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 151 and we’re going to be going over how to use the Entity Reference Module With Views and this is a little more of a complex topic so we’ll try to take a little bit longer and if you look back at codekarate.com Daily Dose of Drupal Number 7 as where I first cover the first Entity Reference Module you might want to start there if you don’t know what the Entity Reference Module is.

I’m going to breeze through the setup of it but if you watched that you should get a little bit deeper understanding. As always you can follow me on Twitter @smthomas3, also go ahead and follow Adam Learing on Twitter as well and check out our new Facebook page and if you haven’t signed up for the newsletter go over to codekarate.com and sign up for the newsletter but let’s go ahead and get started.

So we’re going to start by making sure we have the Entity Reference Module installed on our Drupal Site which I already did. You’ll also need the Entity Module in order to install the Entity Reference Module and we’re going to be creating a really simple … I guess you could almost consider like a CRM type setup or CRM system or Customer Relationship Management System where if you look at this top section here we’re going to create a content type called Contact and we want to be able to assign this contact to a specific Drupal user.

In this case we’re going to consider the Drupal being a sales person and an organization or something like that. We also want the user to be able to assign to a specific team and if you haven’t seen a database diagram before, these little lines here basically mean it’s a one to many relationships.

So a contact or user maybe may have multiple contacts assigned to them, a team will have multiple users assigned to it. Another thing to keep in mind is Entity Reference With Views provides two way relationships. This means that if you … you’ll only need one field, one Entity Reference Field to link these and you can go both ways. So if you add a Field … an Entity Reference Field on the Contact Content Type you can then find from all the users that have been assigned to a specific contact or all the contacts for a specific user.

The relationship goes both ways. And so that’s just one thing to keep in mind. We’re going to go ahead and get started though and like I said we’re going to go over pretty quick through this. So the first step is we’re going to create our two Content Types and add our Entity Reference Fields in the necessary spots. So we’re going to go into Content Types, you can add a Content Type for Contact and we’re just going to leave everything else pretty much the same just to keep it simple.

We’re also going to add a Content Type for team so this sales person is going to be able to be assigned to a team. In our Contact Content Type we’re going to go to Manage Fields, find Entity Reference Field and we’re going to call it Sales Person and we’re going to have this just be a select list. If you have a lot of users on your site you’re going to want to use an Auto-complete and the thing to keep in mind is we are using … we are targeting the user … the Drupal User Entity.

You could use Node but in this case we’re going to go ahead and use User, you can target any Entity that Drupal knows about, we’re going to keep everything else pretty much to the default and it should be good there. We’re also going to then need to … so basically what that does is that creates this part of relationship or I guess right here, the user to the contacts.

So now we can tie a specific Sales Person to a specific Contact. We need to create this relationship, so we could create Entity Reference on the Team and allow it to select multiple values and you could then reference all of the sales people that are on that team or we can add an Entity Reference Field to the actual Drupal User object or User Entity and that will be able to create that relationship from that direction as well. So either way it could work. It’s more of just what makes the most sense for you.

So we’re going to go into our Account Settings and Manage Fields for the Drupal User Entity and we’re going to create a field called Team, it will be an Entity Reference Field, we’ll leave it a select list because that sales person can only be on one team but that also means that there could be multiple sales people that have been assigned to a specific team. We’re going to leave everything else or actually we’re going to come back in here. We only want them to be able to target Team Content Types so we’re using the Node Object because team is a Content Type for Node Entity and we’re only going to let them select Team.

Okay so now that we have that setup we’re going to add some quick content to the sites so I’m going to add a couple of teams called Team 1 and create one called Team 2 and we’re going to make sure we have a few users on this site so I’ll create one called Sales Person 1 and you’ll notice that there is no Entity Reference Field here when you’re registering the account.

We might want to assign to a specific team or we might want to change that so we’re going to go ahead and open this up, go back into our manage fields and we can edit this and we say Display in User registration Form. So now if we refresh this and we come down here you can see that I select what team this Sales Person is going to be on so the Sales Person 2 will also assigned to Team 1, so go ahead and create new account and we’re going to edit this first Sales Person and assign them to Team 1 as well and we’re also going to edit the Code Karate user and assign it to Team 2.

Okay we will now add some contacts or we’ll just give them a name and you can see that a contact can be assigned to a specific Sales Person, it does show anonymous here but I think we could get rid of that if we need to. So we’ll say this one is for Sales Person 1, this one is for Sales Person 1, this one is for Sales Person 2, this one will also be … oops I clicked on the wrong content type there, Contact. So what we need … I’m just adding a couple of quick contacts so we can see what will happen when we have Contact that are assigned to different users or different Sales People in this case. I will add Contact for myself, just my name. Okay so now we have a bunch of Contacts and a few Teams and this entire relationship has been set up.

Now as we’re actually getting into the Views part. So we’re going to go ahead and create two views to show how this is going to work. We want to create a view that will show basically all the contacts for a specific user so we can … if we are looking at this we can find for a certain sales person who all their contacts are. We also want to create a view that can be added to the team page that shows all the users or sales people that are on that team.

So we’re going to go ahead and start with that one. So we’re going to go to a Team page here and we want to block that’s going to show up somewhere on this team page that’s going to list all the users that are assigned to this Team. So we’re going to create a Block View in order to accomplish this, so we go into Views … Structure Views and we’re going to add a new View.

In this case we are going to be displaying … there’s a couple of different ways we could do this; so really Views are pretty flexible, we can make a couple of decisions here and essentially it just depends on how you want to set up your relationships. We’re going to go ahead and just say we call this Team Members and we can go ahead and show Users because we’re going to be displaying Users.

Like I said if you want to set up your relationships differently you could still select content here, it just depends on how you want … how you want it to work and we’re creating a block, we’ll go ahead and make this a table of Fields, 5 items per page, use a pager, that’s fine, we don’t have that many items so we’ll go ahead and click Continue and Edit. So it’s going to show the User Name, it’s also show say the User ID and show the E-mail of the Sales Person. We’ll add these fields, I’m going to rearrange them, put the User ID first.

Okay so this is how it’s going to look, as you can see it shows all of them. We want to make sure that it only shows when we add this to the Team page we only want it to show for the specific … for users that are actually assigned to that team. This is where you need to start looking into relationships and textual filters in Views. Relationships, that is what’s going to allow us to relate these different types of entities and display things based on how this relationship has been configured.

So we’re going to start by adding a relationship and keep in mind we are currently displaying if I come back here this part, the user but we need to limit the user based on this contact or excuse me in this case, this Team that the Users are going to be assigned to. So we need to create this relationship inside Views so go ahead and add relationship and we want to select a bridge to the Content Entity that is reference via Field Team because we want to create that relationship to a field team, so go ahead and hit apply and we can go ahead and require this relationship.

That way it will only show users that have that relationship set up. Which every user has that relationship set up right now so it’s still displays all three in our example. What we need to do now is we know that when we add this block to a team page it’s going to know what team … the page is currently showing.

So in order to get Views to know that we need to add a Contextual Filter. This is going to allow us to filter down our results based on the page that we’re currently going to be on. In this case we’re in the admin section so it’s not going to work but when we get to the actual Team page we will be able to get that to work. So if you search for content and ID we can select that. In our Relationships we want … we’re actually showing the node for Field Team, we want to select the relationship that we just created and here is where it gets a little tricky but when the filter value is not available we want to provide a default value and we want to default the value for the content ID from the URL.

This will basically tell it if you’re on the Team Node page use that Node to pass in through this Contextual Filter and you could add some validation criteria to make sure it’s only going to show or work on the team page, you don’t have to do that but that adds a little bit more restriction and as you can see now when we see our example down here it doesn’t work.

We should be able to test this though because if you come in here and find the Node ID of one of these teams you can find the Node ID by looking … if you look at the actual URL you can see that this is Node/8. So 8 is the Node ID of Team 1. So if we come back into our View and we put 8 here hopefully it will work, and it does. As you can see it shows our two sales people. If we go to our other team, Team 2 which you feel look is going to be Node 9, if we come back in here and put a 9 here for the Team 1 you can see it only shows the other user that’s assigned to that team.

Now what we need to do is save our View, come into the Block section and look for a view down here, view of team members and we will put this we’ll say I’ll just drop in a sidebar first so we can see how it looks right above the navigation. If we come back to Team 2 you can see it doesn’t format well but you can of course change that or put it in different block. You can see on Team 2 it only shows Team members for that specific team, if we come back to the homepage that block is not there, if I go to a contact page that block is not there, however if I come back and go to Team 2, we’re just on Team 2, let’s go back and try Team 1 and you can see it shows the two sales people that have been assigned to Team 1.

So there we go, that’s the first step. The next step is to create a View and in this case we’re going to make it a filterable view for a specific sales person. So then a sales person or anyone else that was in this company or had a login to the site could come in and see what all the contacts … who the contacts are and who they’re assigned to. So we’re going to go back into Views, Structure Views and we’re going to add a new View and in this case we’re going to call this Contacts, we’re going to show content of type Contact, leave all these the same, we can make this a table or any type of display format that we want, display a little more for the number of items, continue and edit and let’s go ahead and add an edit link, a delete link just so there’s a few more fields to look at.

So as you can see now it lists our Contacts with Edit link and a Delete link. We now need to add Filters so we can sort via specific sales person. So we want to make sure we only show Contacts that have been assigned to sales person so we need to add that relationship.

So we add a relationship and we want to select a bridge to the user entity that is reference via Field Sales Person. Go ahead and require this, if one of these Contacts didn’t have that field set they would then drop off this list if we click that require checkbox but we should be okay here.

The next step is going to be adding a Field for the specific user. So we could go ahead and add a field here and we could select Content Sales Person and we could expose this Filter and in this case we could select … we’ll just leave that right now and you can see this isn’t going to work the way we want to though because this is going to look for a specific Sales Person’s User ID and we’re not going to necessarily know that.

What we would really want is for this to be a dropdown here. So if we come back … we can do this, if we come back into Structure Content Types and go to our Contact Content Type, go to Manage Fields, find our Entity Reference Fields for Sales Person and we come down here and we say we want to render Views Filters as a Select List. This will allow us to change that Views Filter to a Select List.

Let’s go ahead and click Save, come back to our View, I’m going to go ahead and save this, yup that’s just an error, we’re going to go ahead and now just get rid of this field, we’re going to try this again. So we’re going to add a filter for Field Sales Person. Now you can see it shows names over here which is exactly what we want. We expose this, I’m going to call this Sales Person and we are going to go ahead and leave everything else at its default. We want to make sure it’s one of these and now you can see we have a dropdown here for the Sales Person and if we select which person it’s going to show different contacts for this Sales Person.

So let’s save this View and click here to actually go view the page and we have our working View. We can select the Sales Person and see the contacts that have been assigned to that specific person. If you’re building a bug tracking system or issue tracking system or you’re building a CRM like this or anything else where you need to build relationships between different Drupal Entities you’re going to need the Entity Reference Module and you’re going to need to learn how to use Views, add relationships and add Contextual Filters to those Views.

So that’s it for this episode, I know it’s a little long but hopefully you learned a lot and make sure to sign up for the newsletter, we have an e-book coming out soon so be ready for that and we’ll see you next time. Thanks for watching.

Tags: DrupalEntity ReferenceViewsDrupal 7Site BuildingDrupal Planet

Drupal 7 Image Styles

May 16, 2014

Description:

Episode Number: 150

The Image Styles modules is part of Drupal 7 core modules. While simple, this module is a backbone to an enormous amount of use cases within Drupal.

In this episode you will learn:

How to create an image filed on a content type How to create an image style How to associate the image style with the content type How cute bunnies are Full Text: 

Hey everybody and welcome to another edition of the Daily Dose of Drupal. I believe we’re on Episode Number 150 today and we’re actually going to change things up slightly. Instead of doing contributing modules from Drupal we’re going to look at the Core Drupal Module Image.

Like I said this does come standard with any Drupal 7 installation, you can enable and disable it which will give you … but before that let’s do our usual plugs here, first of all definitely check out codekarate.com and once you get there obviously look at all the content we’ve been posting but also check out the code karate newsletter and make sure you sign up there and as promise we will be sending out 5 secrets to becoming a Drupal 7 Ninja. Expect that soon, probably soon as next week so look forward to that.
Also you can follow us on our newly created Facebook page, facebook.com/codekarate. Pretty new here, kind of the goal of that is really just to syndicate our content over to Facebook, a lot of people share on it so I just want to be there and make sure that you can easily get updates and what’s on and new posts and stuffs like that and as always you can follow me at adamlearing on Twitter or you can follow Shane at smthomas3. So go ahead and connect with us any way you can, I appreciate anything.

Alright so back to the point of video. I guess today we’re going to be covering the image module which comes with Drupal Core. Once you’ve installed Drupal it’s going to be installed automatically so need to turn it on, obviously you could turn it off, I really don’t see a point to doing that but you could if you get as much bloat going on there.
So once it’s enabled that will allow you to add a field on your content type and obviously hopefully you know what a content type is but content type is how you display different content throughout your site. Right now I just have a basic page, again come standard with Drupal Core. And so once you’re there you can add a new field so right now we’re just going to add a field for banner and in the field types you can select Image there and that’s what using Image Module and then go ahead and save that and what that will allow us to do is that will add a field on our basic page content type that will allow us to add an image on our posts.

So for example just to show you if I go here to add content, I had my basic page, you’ll be able to see that I can upload my banner Image Field that I just saved. But the problem is that if I went out and had a nice big image say from Google I might want to have to resize that so all my images are consistent and that’s where the power of the image styles comes into play.

So to get to the image styles you just go under configuration and then underneath the media section here there’s a link for image styles. By default Drupal gives you three different ones, 100x100, 220x220 and 480x480 and that will do is resize those images to those appropriate sizes. For this video we’ll make our own so let’s add a style.
I typically like to just put the configuration size as the name so I will do 150x150 so I’m going to create style and as you can see in this example here it’s going to preview how it’s going crop and style our image. So I need to add an effect, a bunch of different effects you can use here, obviously you can crop, you guys can read here but to exaggerate … but the one most commonly use is scale so we’re going to select that one, we’re going to add it and then we can then specify the width and height we would like the image to be scaled down to.

Now it’s important to know if you read the description above here that if you only enter in one field what image styles does is that it will either upscale or downscale till it fits one of those barriers. So for example I’m going to select the width of 150 and I’m going to leave the height blank. So what that means is that any image that is either bigger or smaller it’s going to resize until it hits a width of 150 regardless of what the height is. So if I add this effect you can see here on our preview image that we have an 800 width, 600 height picture. Using our scale to 150 and now drops it down until it hits the 150 hit and then it just keeps the height value at what it was at 113.

This is a nice little thing to keep all your picture in proportion so you can also do other effects if you want. You can use Scale and Crop which will basically will trim your image. Use that tentatively of course as the image will not necessarily look exactly like it was when it was full size. So anyway we’re just going to keep that as our one style so scale it to 150 and I’m going to jump out here to Google real quick and find a funny picture or a big picture that I can use for this example, we’ll use this guy here, he seems to be cute. So you can see here by default it’s 1024x768.

So if I look at this image, save it and then if I go back to my create basic page her, let’s just give this a refresh, I’m going to add this image. Alright so there he goes, he’s going to be added … save it. Alright there’s a cute little bunny there but the problem is you see there’s still … this is not obviously a 150x150 Image Style that I’m using and the reason is I didn’t associate Image Style with this field yet.

So to do that, pretty simple, all you do is you go back to your content type for basic and you can get to that field. So want to manage fields and there’s a banner there so we can from there jump to the Manage Display and then you see right here it says it’s using the original image as the size. Well we obviously don’t want to do that, we want to use our 150x150. So if we select that image style there, you see that changed and then … oops I jump to the wrong page there.

Switch back to our bunny we can see that didn’t work exactly, I’m going have to resave my content, still not working, I’ll double check something here. Probably didn’t saved, we’ll try this again, save that, I don’t think I actually did save it, now that I’m thinking of it. So that was my fault. I didn’t actually save it which is very important to do, so anyway let’s try this one more time. There we go, now it’s a little smaller.
So anyway, obviously that was a little bit of a heck up there but just make sure that when you do switch your image style which again I’ll do it here, so if I switch it to large update I just did not save the content type so make sure you click that save button there and now our bunny will be 480x480 so if I refresh, now it’s a little bigger. So anyway, that’s how it works, sorry about that but really simple module, obviously this works really well with Views as well.

We’re not going to cover it in the video just for the time issue but you can use this when you’re displaying many different types of a content and you want all your images to be the same size. So it really helps keeps it clean, it’s nice for the design, a lot of other added benefits as well.

So anyway guys it’s always important again to look at some of the core modules, you kind of might breeze over, I know it’s simple but very useful. So anyway, thanks for watching the video, again make sure to interact with us any way you can, either that’s signing up on our newsletter, following us on Twitter, Facebook, all that kind of funny stuff. Alright until next time guys, take care.

Tags: DrupalCore ConceptsDrupal 7MediaDrupal PlanetUI/Design

Drupal 7 Commerce Stripe Module

May 14, 2014

Description:

Episode Number: 149

The Commerce Stripe module integrates Stripe with the Drupal Commerce checkout and payment system. This is one of the easiest services to use when setting up payments for your ecommerce site built using Drupal Commerce.

Keep in mind you will need to download the Libraries module and the Stripe library in order to get this to work (I do not mention this in the video).

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. I am Shane Thomas, you can follow me on Twitter at smthomas3, you can also make sure to follow Adam Learing on Twitter as well at adamlearing.

Today we’re going to going over the Commerce Stripe Module. Anytime you’re building an Ecommerce website you’re going to need some way to manage the payments or take credit card orders through the website and in this case we’re going to use Stripe.

Signing up for a Stripe account is pretty easy so you can go ahead and do that if you decide to use Stripe. We already have an account here and you can see it’s set in Test Mode and you can see there’s been a few test transactions and we’re also going to need the Commerce Stripe Module and it’s just on drupal.org/projects/commerce_stripe. We’re using the 1.0-rc6 branch today.

So the first step is to go ahead and turn that on, you’ll of course need a working Drupal Commerce site before you can even get this bar but assuming you have a working Drupal Commerce site, adding Commerce Stripe is pretty straight forward so we’re going to go ahead and turn this module on and we’ll click save and the first thing that we’re going to want to do is over in our Stripe Dashboard we’re going to want to go to our Account Settings and grab our API Keys because I don’t want you to be posting money to our account or maybe I should show you so you can post money to our account but you want to keep your API Key secrets so I’m not going to show you that but you’ll click here and you’ll be able to grab those and paste those in.

So let’s go ahead and go into our Store Configuration payment methods and you’ll see there’s Stripe and make sure that if it’s disabled you have to enable it first and then you want to click this Edit link and that will allow you to change your API Keys to match whatever is set here in your Stripe Dashboard.

So if you click the Edit here you’re going to see that there’s a rule here that runs so when you’re selecting available payments for an order it’s going to enable the payment method credit card and if you click here we can set the API Keys so I’m going to click there and once you’re on this page you’ll be able to select your Commerce Order for what the order is, select your Currency, here you’ll paste in your secret key and your publishable key from your Stripe Dashboard and you can also select what you want the payment method display title to be the default to let’s say Credit Card.

So you want to enter that in and click Save, we’re going to go ahead and close out of it because I already have it entered from previous link and now we’re going to go ahead and take a look at our Cart which I believe I have a product in here and the product I have is an e-book that we’re actually going to be coming out with your pretty soon called The Five Secrets To Becoming A Drupal 7 Ninja, so keep an eye out of that and make sure to subscribe for the Newsletter if you haven’t already but we’ll go ahead and go through the Checkout Process to see if Stripe has in fact working now.

So go ahead and click Checkout and we’ll need to enter in our Billing Information so I’ll enter in that information and we don’t have a coupon code this time so we’ll go ahead and continue and now you’ll see there’s a payment method called Credit Card that shows up on a checkout page. So I can go ahead and use a test credit card number and this is just 42 … repeated 8 times so it’s 16 digits, select an expiration date that’s in the future, I don’t believe the security code matters, we go ahead and hot continue to go to the next step and this will actually charge our test card and this should make the payment to show up on the Stripe Dashboard.

As you can see we’ve got to the Checkout complete page and now if everything work okay we should see a payment here on our Stripe Dashboard and there you go, you can see that the payment came in and now flipping this thing from Test Mode to Live Mode is as simple as changing this from Test to Live and grabbing the correct Live API Keys rather than the Test API Keys and placing them inside your payment configuration section for the Commerce Stripe Module. And that’s really all there is to it.

So really simple module to collect payments, there’s a lot of different payment modules out here, Stripe is not the only one of course. It just happens to be the one that we’re using or we’ll be using for Code Karate. So go ahead and try that out and let me know if you have any questions and we’ll see you next time, thanks for watching the Daily Dose of Drupal. Bye.

Tags: DrupalDrupal CommerceDrupal 7Drupal Planet

Drupal 7 Commerce Coupon

May 9, 2014

Description:

Episode Number: 148

In this Daily Dose of Drupal video we feature the Drupal 7 Commerce Coupon, Commerce Coupon Fixed Amount, and Commerce Coupon Percent Amount modules.

In this episode you will learn:

How to create both fixed and percentage based commerce coupons How to customize coupon types How to be better looking. Okay, maybe not. Full Text: 

Hello everybody and welcome to Episode Number 148 at codekarate.com. I’m Adam and you can follow me on Twitter at Adam Learing, you can also follow Shane at smthomas 3 so you make sure you let them do that, we appreciate the follow. In addition to that make sure you head over to codekarate.com.

On Code Karate you can sign up for the newsletter there on the left side bar, kind of say in random …typically once a month e-mails to you and don’t worry about getting a ton of it from us, we won’t send you a ton, just stay informed and also coming up we’re going to be releasing our first ever E-Book, the Code Karate E-Book, 5 Secrets to become a Drupal 7 Ninja.

So go ahead and sign up for that and more information to come but I appreciate any follows or sign ups you can give. And now back to the business; today we are going to be covering the Drupal Commerce Module and then chew other sub-modules underneath that, being the Commerce Percentage Module or Coupon Percentage Module, excuse me. The Commerce Coupon Fixed Module.

You can check those all of our course at drupal.org, pretty standard modules, nothing too complex about them but a nice little add-on to any Drupal Commerce site that you may be running. So to get started again you need to download a Commerce Coupon Module, The Commerce Coupon Fixed Amount Module and The Commerce Coupon Percentage Module, all can be found again on drupal.org.

So once you get the modules downloaded go ahead and enable them, here’s my site so you can see I have Commerce Coupon Fixed Amount, Percentage Amount and then the UI which comes with Commerce Coupon Module all enabled. I want to make one note here too; there’s an additional module on the Commerce Date Module, that allows you to have your Coupons run for certain amount of time. We will also need a Date Pop-Up Module and the Date Module with that as add-ons but it’s kind of a nice add-on.
We’re not going to cover in this video but if you do want to limit the time your Coupon is available without having to go in and manually shut it off it’s a nice module to have. Alright; so to get started, the first thing you need to do is to create Coupon. So to do that you can go under Store Coupons and then there’s two different coupon types that come pre-package with the Fixed Amount and the Percentage Coupon Module.
Obviously they’re self-explanatory; you can have a certain amount, a dollar off or $5 off or percentage, 10% off, 5% off or whatever it be. For this video I’m going to show you both. So the first one we’re going to use this two coupon types, we’re not going to make a new one but you can.

So anyway; we’re going to create a fixed coupon first, so you just simply go again … we have a Store Coupons, create coupon and I’m going to create a Fixed Coupon given that amount off, so $2, Code … that’s obviously what you’d send out to your customers and they’ll type in. So let’s do … I don’t know, what’s your Drupal? That’s will work. Match Number or Uses, obviously you can set that limit … I typically liked to set that as a higher amount, it doesn’t really matter. We’ll set it to 10 for now and then whether it’s an Active Coupon or not.

So it seems pretty simple but that’s about all there is to it. You go ahead and set that Coupon up and the next step too is obviously you need a product, I’m hopped over here, I have a product here 5 Secrets to Becoming a Drupal 7 Ninja. Again; just a little plug, this is the E-Book that we’re coming out so check that out and there will be a coupon attached to it so make sure that you follow on Twitter and you can also follow us on Facebook at /codekarate but we’ll post the coupon code once the book is ready to go.

So save some money there. But anyway once you get to a product page you can just add it to the Cart and then get to the Check Out page … I wonder they have three in there which is impressive but we’ll just go with it. So I’m going to check out by three of these books. You can see here below I already have a Coupon Code applied, I’m going to remove that so I can show you the one I just created the new one and then I’m going to add the Drupal Coupon Code and that should give us that fixed amount off and then you see we’ve been granted $2 off on our amount and if we continue through this checkout process … I think all our fields are filled in.

You’ll see right there that now it subtracts amounts so I only have $13. Did you see there’s Fixed Coupon here that’s kind of annoying obviously since it … you might want that to say Savings or something different. You can’t or you can change that by go ahead in Coupons in creating your own coupon type and then giving up to whatever name you want it to be so I’ll try to fix that problem.

Alright so that’s how you deal with the Fixed Coupon Amount, pretty simple. The Percentage Amount of Coupon is about exactly the same as that. So again you just go to the Store Coupons, create a coupon and we’re in Credit Percentage Coupon, we’ll create our 50% Off Coupons so Coupon Code will say 50 … just say 50 … the next time we’re going to use this again so the same thing as before and then the percentage amount, 50% so we say 50 and then you’ll see here here’s all our coupons and you’ll say 51 and then we will do the same thing with here before and hopefully we get 15% Off of our purchase which are pretty comfortable we will. Just go back here and move the Fixed Amount one, so [inaudible -0:06:45.8] $15, you see about $7.50 Off of here, say 50 add Coupon and there you go, $7.50 Off and again if I continue to check out, get to Review Stage you’ll my total is now $7.50 so same thing again with the name.

You can make your own … and call it whatever you like. Alright guys, well like I said; that’s pretty simple Coupon Module on Drupal Commerce, it’s a nice have though to be able to save your customer’s a little bit of cash as well as be able to promote your product around and get a little bit more attraction with it.

Alright so again; thanks for listening to Episode Number 148, go ahead and follow us on Twitter at Adam Learing and at smthomas3 and also sign up for a newsletter and keep your head up for our 5 Secrets to Becoming a Drupal Ninja E-Book. Alright guys thanks a lot, talk to you later.

Tags: DrupalDrupal CommerceDrupal 7Drupal Planet

Drupal 7 Nodeblock module

May 7, 2014

Description:

Episode Number: 147

The Drupal 7 Nodeblock module is a simple but handy module that can be used to turn nodes into blocks on your Drupal 7 website. Essentially you pick a content type that you want to use to create new blocks, and when you create this type of content, it's now available on the block administration page. This can be really useful for you to set up client websites using this module, this way someone unfamiliar with Drupal does not have to learn how to use the standard Drupal Block administration and can instead just edit the content.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. As always I’m Shane and you can follow me on Twitter at smthomas3, also make sure if you haven’t already to follow Adam Learing on Twitter as well, the newest member of the Code Karate team.
Today we’re going to be going over the Node block Module and this is probably one of the simpler module you’d use but it does have some really useful purposes especially if you need to allow maintainers of the site or if you’re building a site for a client and you want that client to be able to able to change the content of blocks without actually giving them access to the Block Administration page.

So you can do that using the Node block Module. So I already have this module dropped in our development site here so we’re going to go ahead and turn it on, so I’ll go ahead and enable that and the way it works is pretty simple, you simply create a content type and there’s a setting to allow it to be a block and then as soon as you enable that, any content you create under that content type will be available for you to move in the blocks administration page.

So if I come back to Structure and I create a content type we will create a content type called Node Block. And the important setting here is this node block settings, you’re going to make sure you select Enabled here, you can also change the Default View Mode so if you’d like to select different view modes so the content shows up a little differently, you can do that using the View Mode here.

If you want to show or hide the links by default it’s hidden and in most cases you probably want to keep that the same and the same with Comment Display. You’ll probably want that hidden but you could have it shown as well. There are options to override on a per node basis which will allow you to change this when you’re creating the node.

For instance if you selected available as a block when you’re creating a node you’re going to be able to change if you actually want this node to be a block or not. Since I’m only going to be using this for blocks specifically I’m going to leave all those unchecked. So you can go ahead and click content type.

Now if I come back and add content and I’m going to add a Node Block Content, so I’ll add just a quick little node, I’m going to not put this on the front page and I will save it.
Now you can see this looks pretty much the same. If I come back to the Block’s administration page, here’s when I was testing them, I’m going to go ahead and get rid of that but if you look down here there’ll be a highlighted content which just takes the title of … or the node title and uses that as the block title and you can go ahead and change that to wherever you want in the Blocks Display and if we save that … so I put that in the highlighted area which just show up on the top of every page you can see now highlighted content.

Let’s go back to the homepage and you’ll see that my highlighted content just shows up. You can come in and edit the block and actually brings you to edit the actual node itself. So I’m going to do a couple of things, I’m going to go to the Content Types page and go into Edit our Node Block and let’s say for instance we didn’t want to display the author and date information. We can change that, click Save, if we come back to the homepage now you can see the author and date information is no longer displayed so it looks more … more closely it resembles the Block now.

There are a few other things you can do, if you come into the Content Types page and you go to Manage Display. If you had additional fields you could change how this is displayed or you could of course add a new display such as the RSS Feed or Search Index and that will just basically allow you to have finer control over the display of this. If you need a simple block though the default settings are fine and will work for you.
You can go ahead and move it to other locations just to see that it works, if I move it over into sidebar first it is of course going to show up over in the sidebar. This way your clients are able to use just the normal contents adding in content and editing features of Drupal without having to learn anything about blocks which can be confusing especially if you haven’t spent a lot of time with Drupal sites.

So it’s just one way to make your client’s life easier or make website management of Blocks easier for users who don’t want to really get into detail with how Drupal works. Let’s go ahead and give that a try and let me know what you think and make sure to follow me on Twitter and sign up for the Code Karate Newsletter over here on the left sidebar if you haven’t already, of the codekarate.com website. Until next time, I’ll see you later.

Tags: DrupalBlocksDrupal 7Site BuildingDrupal Planet

Drupal 7 reCAPTCHA module

May 2, 2014

Description:

Episode Number: 146

In this Daily Dose of Drupal video we feature the Drupal 7 reCAPTCHA module.

In this episode you will learn:

How to register a domain with Google's reCAPTCHA service How to set up the the reCAPTCHA module How to set where you would like the reCAPTCHA form to appear on the site Full Text: 

Hey everybody and welcome to Episode Number 146 of the Daily Dose of Drupal with Code Karate. I’m Adam and today we’re going to covering the reCaptcha Module. The reCaptcha Module is an add-on module by Google to enhance the Captcha Module, hints the name reCaptcha.

Before we get started though as always you can follow myself on Twitter at Adam Learing, you can also follow Shane at smthomas3 and also make sure to head over to codekarate.com, there you can sign up for our newsletter, get our latest post on as well any tips and tricks we stumble across over the past month but don’t worry we don’t burden your e-mail with a ton of sends, just view of here and there, I’ll let you know of what’s going on and staying up to date.

Alright back to the reCaptcha Module, so in drupal.org you can download the reCaptcha Module, it has a version over Drupal 7 and Drupal 6. We’re going to be obviously be using Drupal 7, I highly recommend moving everything to Drupal 7 just because of the support and Drupal 8 be coming out.

ReCaptcha module does depend on the Captcha Module and also you want to make sure you’re using an updated version of JQuerry, you don’t technically need this module if you are using an updated version but if you’re not, this module will get you up to date. So to get started we download these two modules and then we just need to enable them on our site.

So we head on over to our module’s page and from there we can enable them. We’re only going to use the caption of the reCaptcha Module, there is two other ones in here on the image captcha which I would show an image on the captcha but we’re actually using that module and then the Mail Hide reCaptcha, which is kind of a fancy way to help protect some e-mail addresses but we won’t be covering those today.

So let’s enable those two modules, once they’re enabled you can go under Configuration and then configure the module. So you want a captcha and then there you’ll see there’s couple different tabs on the top, there was a captcha and then the reCaptcha Module. Again we’re using the reCaptcha Module being that it’s an add-on to the Captcha Module but we’ll still use some settings within the captcha.

The biggest start is go over to reCaptcha and in here there’s two important fields; there’s a Public and a Private Key. And as I said earlier, reCaptcha’s are supported by Google and then I just want to make sure that you are registered before using the reCaptcha Module.

So pretty simple; so clicking on that link loads this page right here and then from there you can get the reCaptcha and then all you needed to do is sign up now and enter your domain name that you want to use it on. I’ve actually already done that so I will … you see below here I have added the domain that I’m using as well as Code Karate’s so you can just simply click on that link, grab the Public Key, paste that in and then we can grab the Private Key and paste that in.

The rest of the default settings will work for now, one thing you can notice is that there is a Theme setting down here where you can play around with different colors and things with the Captcha Module but go ahead and save that, it says everything is checked out all right then we can head back to the Captcha page here and then once that’s set up you have to tell the reCaptcha where you want them to show up and like I said; the reCaptcha works off of the Captcha Module.

So for example; the Comment Node forms … so basically these are the comment forms for our different content types so we want the reCapthca model will show up on those. Like I said; you can also use the captcha module if you want so like on the user registration form if you wanted to use the defaults, the captcha module challenge, you can do that or the Math Captcha, you could do that as well. Because this video we’re focusing just on the reCaptcha Module so we’re just going to test it out on the captcha on the comment forms for those three content types.

A bunch of other settings you can kind of play around with, nothing really important being that we are using the reCaptcha Module here and not the default captcha so it kinds of overrides all of these stuff anyway. So let’s go ahead and save the configuration and then all you need to do to test it is log out of your site, typically those kind of depends on your permissions whether comments are allowed or not but if you log out of your site here and then you go to a node page, at the bottom of the node page on the comment form you’ll see right here as the Captcha and this is using the reCaptcha Module.

So this is again is supported by Google but this would be to keep out spam and all the robots that are trying to post, not want a comments. So anyway we can enter this in, this one … the reCaptcha Module is actually a little bit better than the plain captcha module because it does a little bit more of the algorithmic learning than the other modules do so it kind of helps learn a little bit more and not directly do one size fits all for all people.

So you can enter and then we go ahead and save it. And then it says it went through, we have a core sight currently said not to allow comments to go through without approval but it still let us post a comment itself without going in there.

So anyway; that is the reCaptcha Module, again you can just head over to drupal.org and download that and make sure to download the Captcha Module as well and, you know, have fun limiting all the spam box on your site. Again you can follow me at Adam Learing on Twitter, I’d appreciate that as well as head over to the codekarate.com site, sign up for the newsletter, stay informed and happy coding, back to you guys later.

Tags: DrupalCommentsFormsWebformDrupal 7Drupal PlanetSpam Prevention

Drupal 7 ContactPlus Module

Apr 30, 2014

Description:

Episode Number: 145

The Drupal 7 ContactPlus module is a simple module that adds extra features to the core Drupal contact module.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. This is Shane Thomas and today we’re going to be going over a very simple module that basically enhances the Core Drupal Contact Form Module or the Contact Module.

The module that we’re going to be going over today is called Contact Plus and you might want to use this if you are either frustrated by the limitations of Core Drupal Contact Form and you don’t want to use a web form.

A lot of people like to use web forms for the contact forms because it’s a little easier to build out depending on what fields you need. However there are other problems with using the web form especially if you want to use a development in a staging environment and pushing changes between those with web form is a little bit more difficult.

So the Contact Plus kind of sits in the middle there, it’s not as flexible as web form but it does add a few extra features to the Core Drupal Contact Module. So if you open up our test site here you can see we have a Contact Form and this is just what you get out of the box. I have two contact categories and this is just a very basic Contact Form that comes with Drupal by installing the Contact Module.

So if I hop over to our module’s page you’ll see I have the contact module that comes with Drupal Core and I also have a Contact Plus Module. I’m using the Dev version because there was a recent release and I fixed a few minor bugs. So I’ll go ahead and turn this on and we’ll see what we can do. If you look at the Drupal.org page for Contact Plus it tells you it does a few things.

It allows you to set a custom redirect path after you submit a Contact Form which can be nice because default I believe Drupal just send you to the front page and you can also hide or disable specific form elements on the Contact Form. And that’s really all there is to it, it’s pretty simple so we’ll go ahead and take a look. We’ll first start by looking at just our normal contact configuration settings.

So as you can see I have two categories here, I could add more but if I edit one of these categories you’ll notice that I have a redirect path for this category. So I could redirect to any path besides the front page or if you’d leave it blank it’s just going to default to the front page there.

That’s the only difference on when you’re editing a specific contact category. It’s just this redirect path. The one other thing that this Contact Plus Module gives you if you come back you can find the configuration page for Contact Plus is it gives you some additional settings to alter the name fields.

You can also add some introduction text at the top s if I want to add some extra text at the top of the contact form I can of course use full HTML or filtered HTML to add images or anything else that I might need. We’ll go ahead and take a look at this and we’ll come back and look at this other fields. So if I refresh my contact form you’ll notice that a couple of my fields went away and I also have text at the top here. So this is useful if you want to have a little more flexibility in designing out your contact form on your website.

So let’s look at these fields; first is the Alter Name Field; these two fields here, the Alter Name field and the Alter Send from Address can be useful when working with authenticated users. So user who’s already going to have their name or their e-mail address in the system so if I go back to the defaults here you’ll notice it’s pretty much back to normal. I can see that I have my name, my e-mail address, I have the Send Yourself a Copy checkbox but getting rid of it is a s easy as saying “I want to hide the fields completely” but only if it already has a value.

Of course there’s other options here depending on if you’re typically getting contact submissions from authenticated or anonymous users. You can do the same from the e-mail address, I can even remove the subject and a copy fields. If I come to the contact form now you can see it’s much simpler, cleaner, I can have my text on top, I can still select the category, I can still submit the contact form. Of course this time it took me to the front page but if I wanted it to take me to another page let’s say I wanted it to take me to the User Page.

I simply come in here to my contact form and we’ll say if I select General Information I want it to go to the User Page, if I go back to the Contact Form and select General Information, submit it, that will be taken to the User Page instead of the Home Page. So that’s it, pretty simple module, it can definitely be helpful if you just have a simple site with needing a simple Contact Form but the Core Drupal Contact Form Module just isn’t flexible enough.
So go ahead and give it a try and let me know what you think and make sure to sign up to the Code Karate Newsletter and follow me on Twitter at smthomas3, until next time, see you.

Tags: DrupalContribDrupal 7Site Building

Drupal 7 AddThis Module and Smart Layers

Apr 24, 2014

Description:

Episode Number: 144

In this first episode from Adam (follow on twitter @adamlearing), you learn more about the Drupal AddThis module.

In this episode you will learn:

How to configure the Add This module with multiple social networks How to integrate the Add This Smart Layers code within your site Full Text: 

Hey everybody it’s Adam at Code Karate, yup I’m the new guy in the team. Today we’re going to be covering the AddThis Module for the Daily Dose of Drupal. The Add This Module is kind of cool little module that allows you to share content or your audience will share your content kind of across the way, really simple and easy way to do that.

As always, you can follow … follow both of us but you can follow me specifically at adamlearing on Twitter, otherwise if you still want you can follow Shane on smthomas3. In addition to that, we also like to point you to the Code Karate Newsletter at codekarate.com, go ahead and sign up there, you get definitely updates on content, new stuff going on with Drupal as well as tips and tricks where you’ve kind of thought of over the … over our 4 or 5 years doing Drupal so sign up there.

Alright so back to the module, so Add This Module again just a social sharing service makes it pretty simple and easy. On one note make sure this video is following the 7.4 development release, they don’t have a stable release for Drupal 7 yet but the 7.4 seems to work pretty well so you can go ahead and use that one. Alright so the first step when you’re configuring this module is to go to the module’s page, you just turn it on.

So we’re just going to enable both the modules here, Add This and Add This Place. Once you get it turned on here you can go down and configure, we add this and there’s a couple of different … there’s ton of stuff going on here and the most important things are your Profile ID.

You are required to have account with on Add This, so you can head over to addthis.com and create an account. I already have but once you do you can go under your Profile’s tab and grab your Profile ID, just what links your Add This account to your Drupal site. So copy that and just paste in the textbox there and then the only other one that’s really important in all these sites is the Click Back and Click Back with that does guys is that allows Add This to track the people who share and how viral their shares go.

So basically it says how many people they share acquired to your site, really powerful analytic tool there. One of the kind of important thing we’re not covering but as you can link this into your Google Analytics by just having the Google Analytics module installed on your site and then checking those boxes, kind of cool little thing there. The rest of the stuff I’m not going to cover in this tutorial because I want to get to one of the thing without this. So I’ll play around with it, nothing else is really important to the module.

So once you get it saved you can then add the Add This as a field in the content type or you can add it as a block. I’m going to add it as a … on the content type; so let’s say we have a content type basic page here and we want to add Follow buttons on the bottom of all our pages. So we would just add the Add This field type there Keeping It button and once you click Saved you can go back to the content type and you have to configure one more thing so you just go to Manage Fields and then … nope I was wrong, Manage This Place under the Format, click either the button or the toolbox.

Typically I click the Toolbox, that allows multiple buttons to appear and then you see here you have your different services that you can linked in. Right now it’s Facebook and Twitter, they’re just kind of separated, you can add a bunch of different variables and anything you want into that, I’m going to keep that default for now, we can make the buttons bigger, select the Orientation but for now we’ll keep it big, 32 horizontal so Facebook and Twitter will show up.

So then if I create a piece of content and you’ll say that … and you’ll see here that I now have Add This ability on the bottom of my content type or my page in this example. So then obviously I’m a user and I come to this page, I can click on the Facebook button and then obviously pulls in the No Title and as well as the site name and then you’ll make it easier for people to share your content across different social networks.

Again this is a quick example just showing Facebook and Twitter but you can extend that out to your favorite social networking sites whether it’s YouTube, Google + or whatever it be. So anyway that’s a quick and dirty Add This Module. Like I said; you can also add it as a block, so if you go into Blocks you’ll see there’ll be an Add This Block available right here so you can put that in as well and then that would just show up, oops I didn’t configure it yet but that would show up in the Footer if you configured it similar to how you configured this. Pretty simple and straight forward there.

One of the thing that I wanted to show is this might be one of those cases where the module isn’t exactly the best service to use and what I mean by that is Add This has some coolest features built right in via some Java Script, so again just I’m hopped over to the Add This site, so once you get your account created you literally can hover over this Get Code button and I just click on the Smart Layer’s tab and as you see here there’s a couple different things going on.

They have 4 different sections that dynamically overlying on your website by just injecting some Java Script and what is here is the Follow button on the top corner, Share button appended to the left side, What’s Next or Recommended Articles that they used as well as What Else would be customers point like appends at the bottom of your site. Really kind of cool, we usually turn this on and off, of course if you … whatever it is you want, you can also decide which services you like to have followed versus shared, all that kind of stuff is available here as well.

So you can honestly put your information in but once you finally select it, all you have to do is click Generate Code and it pops up some Java Script that you need to put onto your site. So all you need to do is copy this and then all you do is hop over to your HTML.PHP on your site and again if you need more direction on how to get to an HTML page you should look at Zen and send some themes.

I’m going to make it pretty easy to grab an HTML page but once you do, all you need to do is paste the code in your Header of your document. Oh actually sorry but you can paste it in the header of your document, that would work but if you want it to low after all the body text have loaded which typically is a benefit because the service sometimes takes a little bit longer to load, you can put it right at the bottom of your body [inaudible - 0:07:17.3]. So that’s what we did here.

So your Add This is here, pasting it in and to give you an example of what that looks like on the end you can just go over to codekarate.com and you’ll see it in action there. So we have it working right here, so here’s the Share buttons, up in the current corner are our Follow buttons and then right there there’s a Recommended For You section so can click that out to take you to our page there, just kind of nefty and then this is another page but eventually there’ll be a Recommended Articles at the bottom too of your Article. So we’re all services here, there it is. So you may also see these and then they may link up to other pages.
So it’s just a nice easy simple way to drop in content and help people navigate around other cool articles and content on your site. So again; I just want to reiterate, in my personal opinion I would probably forego using the Add This Module but if you want to it’s there and it’s nice and easy but what I would do is I would just go over to addthis.com and create an account, get the Smart Layers section loaded, configure it however you want it as far as what sections you want but then just drop the code in, your HTML file either in your body element or again you can put in the head element where all your other script tags are probably located.

Alright guys, well this is my first video with Code Karate, so more to come, appreciate any comments you have or anything like that, otherwise stay tuned and we will have more to come. Thanks guys! Bye.

Tags: DrupalContent TypesDrupal 7HTML5UI/DesignJQuery

Drupal Site Map Module

Apr 11, 2014

Description:

Episode Number: 143

The Drupal Site Map module can be used to provide you Drupal website visitors with a high level overview of the content on your Drupal 7 site.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 143 and we’re going to be going over the Site Map Module. The Site Map Module makes it easy to basically create an overview page on your Drupal website that various links and how the general navigation or flow of your Drupal website works.

So it’s basically a simple way to provide users a site map so they can see how your sites structured, how it’s set up. Before we get started I’m Shane Thomas, you can follow me on Twitter at smthomas3, also make sure to hop over to codekarate.com and sign up for the newsletter and learn about becoming a Code Karate supporter.

Let’s go ahead and started; so I’ve already installed the Site Map Module so I’m going to go ahead and we’re going to take a look at that and look at some of the various configurations options. You can see you can have a page title so we can make a Site Map 4 or whatever we want it, we can also add a message and you can select whether or not you want to show the front page in the Site Map, you can also select which menus you want included in the Site Map.

If you taxonomy vocabularies you can include those on the Site Map as well. Here are some specific category settings such as whether or not you want to show the node counts. The depth of the categories or the terms that you want to show and a couple of other things.

There’s also some RSS settings so this defaults to RSS.xml and Drupal actually comes with out of the box but here you can change what it’s set to, you can select to whether or not you want to include RSS links and if you do not want to use the Site Map CSS file you can select this and then you can just use your own or style it however you want. So once I saved that you can click on the Site Map page which just brings me to /sitemap as you can see here, so you can put a link in your footer, you can put a link anywhere you want. Anywhere that you want users to be able to navigate to your Site Map from.

So here is my title, the message that I entered in shows up here, shows my front page with the RSS link, my Main Menu. If I had multiple levels that would show up here and also the Tags on this site along with the Node counts, you can turn those on and off and along with RSS icons for each of those feeds for each term.

And that’s really all there is with the Site Map Module, it’s an incredibly simple module but it can be useful if you want to basically create a footer links with the Site Map so users can see how your sites laid out, maybe navigate it a little bit differently than just using the Menu Structure and it basically provides that overview or that high level overview of what your actual site looks like, how it’s structured and makes it easy for them to hopefully find things.

So that’s really all there is to it and that’s it for this time on the Daily Dose of Drupal, it’s a nice and short and sweet episode and we’ll be back again next time, I’ll see you later.

Tags: DrupalContribDrupal 7Site BuildingDrupal PlanetSEO

Responsive Navigation Module

Apr 10, 2014

Description:

Episode Number: 142

In this episode of the Daily Dose of Drupal we go over the Responsive Navigation module. This module can be used to make your Drupal menu "responsive" so that it displays nicely on mobile and tablet devices. If you are trying to build a responsive Drupal website or a responsive Drupal theme, this module can help.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode number 142 and actually lately it’s been more like a monthly dose of Drupal but anyways, today we’re going to be covering the Responsive Navigation Module on drupal.org. It’s a relatively new module but it allows you to make a simple menu in Drupal a little bit more responsive.

So if you take a look it uses the J Query plug-in called “Responsive Nav” so if you look at the menu up here you’ll notice as I scroll or make the actual size of the browser smaller it turns into a little menu icon that you can click and now you have a responsive navigation menu.

So this module allows you to do that and we’re going to go ahead and get started but before we do, as always I’m Shane Thomas, you can follow me on Twitter at smthomas3, also make sure to stop over at codekarate.com and sign up for the newsletter if you haven’t already and become a Code Karate supporter. So I’ve already downloaded the Responsive Navigation module and along with that you’ll need the libraries module on drupal.org and also the Responsive Navigation plug-in which you can find at responsive-nav.com, so also a Drush command you can run.

All of these information can be found inside the Responsive Navigation Modules install.txt. It has instructions on how to install the plug-in if you’re not sure and also how to install the module but assuming you have all that set up we’re going to go ahead and get started. There is a configuration page for the Responsive Navigation Module, I’ll go ahead and hop into that. All it allows you to do is select how many Responsive Navigation blocks you want. In this case you can either have 1 or 0. It does say that the Responsive Navigation plug-in only currently allows you to have one Responsive Navigation menu on the page.

So I’m going to go ahead and save this but it’s just set to the default. Now we can go ahead and add this menu block wherever we want on our site. So just as an example, it’s called The Responsive Navigation 1, I’m going to drag it into one of the first columns, I’ll just go ahead and say it underneath the Search form, under sidebar first and I will save this and then I will go ahead and click configure on this block and I’m going to select which menu I want to use and I will go ahead and just select the Main Menu, you can select the Menu Depth, I’ll go 0 so I’ll just use this top level, I want to hide the Block Title so I’ll go None, you can also then change some settings if you want to animate it, if you want a transition.

This is the label of what the Responsive link turns into whether you want to insert it before or after the actual navigation and a couple of other different other settings, we’ll go ahead and click Save here and then come back to the homepage. I did not set that correctly here, I’m going to change that. It should be None not Node, so I’ll save it and so I have this little menu here.

Now as I scroll down you’ll notice this changes into just a menu link and as you can see it’s not necessarily powerful here but if you were to move it into the header region or something like that it can become a lot more powerful.

So I’m going to just do a few things here and move it up into the header and one thing you will need is you’re going to need to be able to CSS this so it will be good to have some familiarity with media queries with your CSS to make the site fully responsive and not just the menu. But let’s assume I had this going across rather than down then when the site hit a specific media query breakpoint I could then … you can see it’s not responsive right … this side is not responsive out of the box but it does … if I can get it away from that edit link you can see it does work as far as allowing you to drop down the menu and drop hint, slide it up and down based on you actually clicking the button.

You can CSS this however you want to obviously look similar to how this site works, the Responsive-Nav site. If you want it to, it’s a really simple to get it started, it takes a little more to get it to this CSS and looked correct or the way you want it or you can read the read-me file, it tells you a little bit of information, you can also look at some of the examples that come with the plug-in itself for how to actually style it and how to make it look and work correctly or nicely.

So that’s really all there is to getting the basics started with the Responsive Navigation Module. Go ahead and take a look at some of the CSS examples and get it to work and look the way you want to on your Drupal website. So that’s it for this time on the Daily Dose of Drupal and we’ll be back again next time for something new. See you later.

Tags: DrupalContribDrupal 7Drupal PlanetUI/DesignResponsive Design

Drupal Commerce - Product Display layouts

May 23, 2013

Description:

Episode Number: 141

In this episode we continue learning about Drupal Commerce and dive into some of the layout aspects of building out Drupal Commerce product displays.

In this episode you will learn:

How to modify the layout of a Drupal Commerce product display How fields are used to control the Drupal Commerce product display layout Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 139 and we’re going to be continuing learning on Drupal Commerce. We’re going to be focusing on the Product Displays today.

As always I am Shane Thomas, you can follow me on Twitter at smthomas3, also go to codekarate.com sign up for the newsletter if you haven’t already and learn how you can support Code Karate.

So last time if you remember we created two product types; one called Hats and one called Shirts and we also added four different hat products, a white, pink, yellow and red hat.

Today we’re going to be going over product displays which basically is how the end user sees the products so when they go to a specific product page on your website that is controlled through a Product Display.

If one Product Display could reference multiple products so for instance we may have one hat product that actually allows a user through a series of dropdowns or select boxes to select which product in the back end whether it’s the white, pink, yellow or red hat they’re actually going to be purchasing.

So they see one display and based on the selections on that page they are actually selecting which skew or which individual unique product they’re going to be adding into their cart.

So as you can see the products section has its own entity called Product Type but Product Display is a Content Type. So we’re going to have to start by adding a new Content Type and we’re just going to create one called Product Display.

The important thing to note here is we could have a specific product display for each different type of product and maybe we want a Hats Product Display and a T-Shirts Product Display but since we want our Product Displays to look pretty much the same it doesn’t really matter what type of product they’re buying, they’re going to have the same layout.

We’re just going to use a single Product Display to keep it simple and to keep the actual display without having to manage multiple different display pages. So you can think of this as the Product Display is the actual front end user facing the product types are actually the back end what products are actually being purchased from the system and hopefully you’ll be able to understand a little bit more if it’s still little blurry on what that exactly means once we get through this example.

So we’re going to create a Product Display Content Type, we can set whatever else we want here for settings I’m going to uncheck this, I will turn comments off and I’ll go ahead and save the content type. The important field here that you need for any Product Display Content Type is something called the Product Reference Field and you need to make sure you have the Drupal Commerce Product Reference Module on in order for this to work.

I’m going to go ahead and just call this Product so it’s going to be field_product and this is the Product Reference Field and we could use an autocomplete, the select list or checkboxes and radio buttons.

I’ll use the select list to start and we will click Save, click Save on the page and now we get to select … first we’ll got through these options; this is the label, we do want this to be required because they have to actually reference a product. Here we want render fields from reference products when viewing this entity and this is something we do want to keep checked.

For Product Types that can be referenced we’re going to go ahead and say we can reference Hat and Shirt products. If we wanted to set a default value we could and also we want to set how many products we can reference and in this case we’re going to set Unlimited because as I mentioned before we could have one hat that has four different products that need to be referenced.

Maybe there are four different colors of the same hat so we would only want one display but we want four different products to be referenced. So we’re going to go ahead and hit Save there and now we have a title, a body and a product. We could add any other fields we want to this Product Display.

The important thing to keep in mind here, the difference between the Product Display and the Product Type and where you would add specific fields is basically I’ve think it this way; if it’s going to be different for each unique product whether it’s that specific pink hat or white hat, if there’s going to be a difference on each individual product you would need to add the field to the products type.

If it’s something you’ll only need to add on the product display and not necessarily to each individual product then you can add the field to of course this product display content type. So now we can go ahead and we’re going to come back to the homepage and we’re going to add a product display and for right now I’m going to reference each product 1 to 1 so basically I’m going to have a product display for the white hat, the pink hat, the red hat and the yellow hat just so we have something to get started with.

We’re eventually going to change that and show you how you can reference multiple products as well. So if I want to start with the pink hat and give it a description and now here I can select which product I want to reference. As I mentioned before you could select multiple, I’m going to start with just selecting the pink hat and we’re going to go ahead and click Save.

Now you can see there’s a nice pink hat and everything shows up the way we would expect, it has the product reference, it pulls in the price from the product that is referenced and it also pulls in the image so you notice we didn’t have those fields on that product display content type but because we referenced that product it was pulled in.

The next thing we want to do is … well I’ll go ahead and I’ll finish adding these other product displays just so we have them. I’m not going to bother adding a description for all of these but of course if you’re actually creating products for a live story you’re going to need to probably have descriptions so I created the white hat, we’ll create one for yellow hat and then last but not least the red hat.

Okay so now we have our four different products that have been created. We’re going to come in and turn on some more Drupal Commerce modules, we’re going to make sure we turn on the cart and the checkout because we want customers to actually be able to start buying these products, we’re also going to create customer or turn on Customer or Customer UI as well as line Item UI, Order and Order UI and I think that’s enough to get as going into the next step.

Each one of these is pretty self-explanatory on what it does and you can read the description and it will tell you what each of these checkboxes is actually doing to your Drupal Commerce website so for instance you cannot create Orders until you turn on the Order Module and the Order UI has the user interface for actually managing and editing orders.

So now that we have those selected we’re going to save and this will of course turn those modules on and we’re going to come back to this page you’ll see that nothing is changed yet but what we really want here is to get the Add to Cart form to show up and so the Add to Cart form is going to allow the user of the site of whoever is looking at the product to actually add the product to their cart and then eventually proceed with the checkout process.

So in order to do that we need to come back into our product display and we’re going to go to manage display and remember we added this product reference field. The format by default is just to provide the title and the link, you could of course select to show the skew with a link or without a link, you could display the actual rendered product but what we are interested in is this Add to Cart Form.

Once you select Add to Cart Form you have a couple of different options. So if we want to allow a quantity widget text field we can check this box which in this case we will so the user can actually select or enter in how many hats in this case they want to purchase.

We can have it attempt to combine like products on the same line item on the cart, we’ll leave that checked and you can have it show attribute widgets even if the Add to Cart Form only represents one product and because we don’t have any attribute widgets in this case we’re not going to select that.

So we’ll go ahead and hit update and we’ll scroll down and hit save and now we will come back here and now you can see we have the Quantity Box added at the cart button so if we come in and we leave it at quantity of 1 and click Add to Cart you’ll notice that it said red hat has been added to your cart, I come to the cart and you can see that it says I have a red hat.

The price, here is the quantity, an option to remove and the total amount. So you can see now we product page working and you can now add those products to your cart. If we come in and look at some of the other hats such as the yellow hat and I want to add two yellow hats I can go ahead and add to cart there, you can see that now we have two yellow hats.

If i come to the red hat and add another item when we come back in you’ll see that these have been combined and now the quantity has changed from 1 to 2. You can of course remove it by using this Remove buttons and you have your basic working Product Display.

You’ll notice that it doesn’t necessarily look pretty yet, there’s not a lot of thought that’s been putted to how this is laid out yet and that’s something we’ll cover in the next few episodes on the Daily Dose of Drupal.

Next time we’re actually going to go over how to add Product Attributes to specific product displays and then from there we’ll continue on how to make this page look a little bit nicer. So that’s it for this time on the Daily Dose of Drupal, we’ll see you next time.

Series: Drupal Commerce SeriesTags: DrupalContribDrupal CommerceDrupal 7Site BuildingDrupal Planet

Drupal Commerce - Product Attributes

May 17, 2013

Description:

Episode Number: 140

In this episode we continue learning about Drupal Commerce and begin learning how to set up Drupal Commerce Product Attributes using Drupal Taxonomy.

In this episode you will learn:

How to set up Drupal taxonomy vocabularies and taxonomy terms to use as product attributes. How to add Taxonomy term reference fields to Product types to create Drupal Commerce product attributes. Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 140 and we’re going to continue learning about Drupal Commerce and in this episode we’re going to be learning about Product Attributes. As always; I’m Shane Thomas, you can follow me on Twitter at smthomas3, you can find me on Google + and you can check out codekarate.com sign up for the newsletter and learn how you can become a Code Karate supporter.

Let’s go ahead and get started; if you remember from the Drupal Commerce basics episode … a few episodes back I mentioned that Product Attributes are all controlled through taxonomy and the Product Attributes are basically going to allow us to have one product display called “Hat” and allow us to select the different hat colors whether it’s yellow, pink, red, white or any other type of hat color that we need to add.

So we’re going to start by coming into Structure in taxonomy and we need to really think out all the different product attributes that we’re going to be using on our Drupal Commerce website.

The first one we’re going to add is Colors so I’m going to add colors and after I add colors I’m going to add various terms to these colors. So I’m going to start with yellow since that’s the hat that’s over here on the background, I can give it a description and a URL alias if I want, do pink, red, white, blue and we’ll go green as well.

Now that we have the colors taxonomy and those terms listed we’re also going to create a taxonomy vocabulary for Hat Size. We won’t necessarily have to do this because in this case I’m going to just use a one size fits all for the hat but in case if we ever need to add different hat sizes down the road we’d have the vocabulary already set up so we could go ahead and add this as a product attribute. So I can go ahead and come into the add term for hat size and I’m just going to do one size because this is going to be a one size fits all.

So now I have hat size, colors, we’re going to need shirt size so I’m going to go ahead and add Shirt Size and I’m going to add terms to that and we’ll go ahead and do small, just keep it S for small, M for medium, L for large and then XL. Okay so now we can take a look at our different vocabularies, we have colors, hat size and shirt size. Now the next part is to actually allow on the product type form to select the color or size attribute when you’re adding the products or editing the products on the site so we come into our product types and we have hats and shirt that we’ve created earlier.
I’m going to go ahead and go to manage fields on Hats and we’re going to need the term Reference Field so we can actually reference these taxonomy terms that we created. I’ll use Select Boxes or Select Lists in our example so I’m going to create one called “Color”. It’s going to reference the colors vocabulary; we’re going to make this field required so every hat has to have a color and this is an important section right here you’re going to make sure you’re going to want to read.

Basically it says if single value fields attached to products can function as attribute selection fields on add to cart forms. Basically this means if we check this box this color will become a select list when you’re adding the product to your cart so when you go to the Product Display we’re going to be able to see a dropdown or radio buttons depending on what we select that are going to allow us to select which color we want so in this case; which color hat. Make sure to keep this number values one if we check this box here and we’re going to click Save. We’re also going to need the term Reference Field for Hat size and we’re going to keep this one a select list as well, we’re going to reference the Hat size vocabulary, we’re going to make it required check the attribute field settings checkbox to make it a select list on the Add to Cart form, I’m going to click Save.

Now we have our two term reference fields added to our hats we’re going to do the same thing for shirts and click on Manage Fields. In this case we’re going to select Add an Existing Field because we already created this field color term reference fields so we’re just going to use that same field rather than creating a new one, we’ll make it required and check this box again and click Save. We’re going to need to add a new field now for shirt size.

This is going to be another term reference field that’s going to reference the shirt size vocabulary, I’m going to make it required, check the box, scroll down and click save. Now the next step is we already have 4 different products in here. We’re going to come in and give it a color and a hat size for each of these 4 products that we already created. So in this case we’re going to edit the white hat, select White as the color.

The hat size of course is just a one size fits all, I’m going to do the same for the pink, we’re going to select Pink as the color, hat size is the one size fits all, do the same for yellow and last but not least do the same for the red hat. Now we’re going to actually add a few shirt products and each one of these things in this list you can think of specific product variation or one unique product so this White Hat in one size fits all has a specific skew.

We’re going to do the same now for shirts; we’re going to call it Shirt 01 as the skew. The title is going to be Small White Shirt, use just S for Small, you could spell it out if you wanted and we’ll make this 15 US dollars, we’re going to find the image for the white shirt. The color in this case is white and the shirt size we said was small. You’ll notice that these … the listing here goes large, medium, small, XL which isn’t quite very intuitive so we’re going to change that here in a second so we can go Save Product.

Now we have our small white shirt I’m going to change that order just to show you how that can be done so I come into our shirt size taxonomy and I can reorder this so I can go small, medium, large, XL just to keep it a little bit more intuitive when you’re adding products and now we come back into our products page. So we’ve added one variation for the small white shirt, we need to add one for a medium white shirt, a large white shirt, an XL white shirt, double XL if we had it. Any distinct type of product that you are going to have to ship or sell that has a specific skew as t have a variation added to this list so it is a little tedious when you have to add on specific shirt multiple times because this is one white shirt but you have to or one shirt, excuse me, it could be white, green, blue and it could be small, medium, large, XL so you can see the number of variations on this list, could grow very quickly but the important thing to keep in mind is it’s actually very intuitive how that works because you have a specific product for each of those variations that you need to ship out and each one is going to have a specific skew.

So I’m only going to do a couple here so I don’t spend too much time entering in just a bunch of variations so we’re going to do medium white shirt, say this is $15 and we’ll say for whatever reason the white shirt only comes in small and medium so we’ll just keep … let’s add the two variations for the white shirt with the small and the medium, we’re going to add another and we’re going to call this a large green shirt, it’s the wrong field, call this Shirt 03, we’ll make the green shirt $16 and select Green and large and we’ll also have an XL green shirt, that’s $16 and then we’ll also just have a medium blue shirt, that would be $17.

Keep in mind that in most cases I’m going to have a small, medium, large, XL, double Xl of all these different shirts so we’ll have to add a variation for each of these but to save time I’m just doing a few options just to show you how it would work. Now you can see our list has grown we have Hats and Shirts and now we’re going to come back and create product display as one for all of these hats and one for all of these shirts and show you how that is now going to look.

So I already have a bunch of product displays one for each of these hats, we’re going to ignore these and I’ll eventually delete them but we’ll keep them there just for reference but I’m going to add a product display called Hat and I’m going to select the various hats that they can reference. In this case I’m going to select all of these Hats by simply holding that CTRL button on the keyboard and selecting multiple, I could give it a description, click Save and now you’ll see the product page has some select boxes or dropdowns on it for color and hat size.

You’ll see that it defaults to this white hat but if I wanted to look at the red hat for instance I select red and the product image immediately changes, select white, select yellow or select pink and you’ll notice that it changes, you’ll also notice that the price changes so it’s $21 for the red, $20 for the pink, the white is 20 and the yellow is 19.
There’s only the one size fits all so the hat says one size and you can of course add different quantity. Now the interesting thing here is if I select red and I select one size and I add it to the cart it says the red hat has been added to the cart. I’m going to remove this old yellow hat from our previous example so now you can see it has the red hat which is $21, if I come back here and I selected yellow it says that the yellow hat has been added to the cart.

So as you can see that works out pretty well, we’re also going to create a product display for shirt and I could give it a body or a description and I select all of these different shirt options and I click Save.

Now you can see we have shirt here, this one is a white shirt, you can see I only have two sizes in white, small and medium however if I select blue the blue shirt shows up and now my shirt size is only medium but we’d select green, shirt size can be large or extra-large and this all based on which product variations you have created in the product section in the back end of your Drupal Commerce website so if I wanted to add a medium green shirt and I would have to go in add it as a product type or as a specific product variation so I’ll go into products create product, create a shirt and I believe I was going to add a medium … medium green shirt, I believed we give that $16 price, select the green shirt image again.

Keep in mind that you could have a different image for each size and each color so if we wanted the medium green shirt to show differently than the small green shirt we could do that, in this case I’m going to use the same image because in a lot of cases that may be what you want to do but of course you could do whatever you want for you different images and when you select the different color and the different size a different image could be loaded in here. So select green and medium, save product and now when I come back here you’ll notice that it’s not quite set up yet. I still don’t have the medium shirt showing. I actually have to edit the product display and make sure I have the medium green shirt selected as a referencible product as well.
Now when I come back here you can see the medium shows up and the green shirt is available to be added to your cart. Once I add it to the cart it says the medium green shirt has been added because that’s the specific variation of the product that I was adding to the cart.

So that’s really all there is to Product Attributes, there’s a lot of things you can do here and really the options for a different number of attributes could vary depending on what type your selling on your site and obviously some products will have multiple attributes, some may not have any, it just really depends on the products and how you layout and structure your product types and your product displays.

So that’s it for this time on the Daily Dose of Drupal, thanks for watching and we’ll see you next time with another Drupal Commerce episode. See you!

Series: Drupal Commerce SeriesTags: DrupalTaxonomyContribDrupal CommerceDrupal 7Drupal Planet

Drupal Commerce - Product Displays

Apr 15, 2013

Description:

Episode Number: 139

Learn how to set up a Drupal Commerce product display for displaying ecommerce products on your Drupal 7 Drupal Commerce website.

In this episode you will learn:

How to create a Drupal Commerce Product display content type How to add Drupal Commerce products to a cart Series: Drupal Commerce SeriesTags: DrupalContribDrupal CommerceDrupal 7Drupal Planet

Drupal Commerce - Product Types

Apr 11, 2013

Description:

Episode Number: 138

Learn how to create and manage Drupal Commerce Product Types on your Drupal 7 ecommerce website.

In this episode you will learn:

How to create a Drupal Commerce Product Type How Drupal Commerce Product Types fit into the overall ecommerce website How to add product images to a Drupal Commerce Product Type Series: Drupal Commerce SeriesTags: DrupalContribDrupal CommerceDrupal 7Drupal Planet

Drupal Commerce - Overview

Apr 10, 2013

Description:

Episode Number: 137

This episode goes over a basic overview of Drupal Commerce and how it can be used to create a Drupal 7 based ecommerce website.

In this episode you will learn:

What is Drupal Commerce How Drupal Commerce can be used to build flexible and dynamic ecommerce websites Common Drupal Commerce terminology Series: Drupal Commerce SeriesTags: DrupalContribDrupal CommerceDrupal 7Drupal Planet

Drupal 7 Panels Module Contexts Relationships

Apr 4, 2013

Description:

Episode Number: 136

Another episode covering the Drupal 7 Panels module. This time we continue learning about Panels module contexts, but focus on using Panels module contexts relationships with an entity reference field.

In this episode you will learn:

How to set up and use Panels context relationships How to include related node information from an entity reference field Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 136 and we’re going to continue where we left off learning a little bit more about the Panels Module and this will probably one of the last Panels Module videos for at least a little while and we’re going to continue on learning a little bit more about Context and in this case we’re going to learn more about Relationships and how they can be used as a specific type of context.

We’ll show two different ways of how that can actually work. As always I’m Shane Thomas, you can follow me on Twitter at smthomas3, also make sure to go to codekarate.com and sign up for the newsletter if you haven’t already and also click this support link and go ahead and become a supporter if you’re interested so you can help make these videos happen on a daily basis.

So go ahead and check out the Panels Module and the other Daily Dose of Drupal videos on the Panels Module if you haven’t already to kind of get you up to the speed and we’ll go ahead and jump right in. We’re going to show two different ways of how this Panels Module page can work so if you come in to the Panels Module we have our page here which has a couple of different things that we’re going to take a look at.
Actually we’re going to go ahead and use a Node View page instead of the actual Panel page we’re working on last time but we’re going to go ahead and look at the content types here and I have a content type called “Company” and one called “Contact” and I’m using the Entity Reference Module which there’s also a Daily Dose of Drupal video on if you’re not familiar with that which essentially means we can set up a relationship between these two different content types.

So we have a company which let’s assume that we’re building a very simple Customer Relationship Management System or CRM System using Drupal. We have a company where we enter in a prospective client it has just company names, some notes and then company status, I’ll go ahead and move that up to make it a little cleaner and we could have many other fields, website, phone number, address, all those different types of things and essentially then we have a contact which is an individual person within this company.

So there is a specific company field which is Entity Reference Field which means that one company could have two or three or four or any number of contacts. So we have this entity reference here which is going to be used in our Panel page to create that relationship.

If we look in the content I added two companies; ABC Company and Test Company 1 and I do have an example contact here which I’m going to go ahead and reference an ABC Company here using the Entity Reference Field. I’m also going to add another contact … there we go and we’ll reference the test company for this user. So how this can work is we’re going to go ahead and create a Panel page for this specific contact but on this page here as you can see this one just has the user’s name. I’ll go ahead and a little bit more information just so we can see some information but on this page we also want some of the company information to be displayed.

As you can see none of the information is displayed right now so we can come in here and we could of course come to the Contact Manage Display fields and we could display the label with the link on it and all of that information and it would display the company information but what if we wanted to pull in additional information about this company?

Well one thing we could do is we could create this as a Panel page so the contact will have … maybe the contact information over here and the actual company information that this contact works for over in the right. So we can easily get back and forth and then of course we could use this on the company page as well and then when you’re on the company page perhaps we have the company information and then the list over here of all the contacts that are part of this company and the list over here would be a View, we’re not going to go over that part today but just know that we could create this as a Panel page and just drop a view in to a specific section.

You just create a view of the contacts for this specific company and you could drop it into the Panel page. We may be able to cover that in the future episode if people are having trouble of how to do that. So we’re going to go into the pages section where you come into Node View, we’re going to click Edit and you can see we already have this contact one set up from a previous example.

So here it says … we’re going to go ahead and get rid of a couple of these that are no longer used from our previous example, we’ll get rid of this search form as well. So right now it has their e-mail, their phone number, the notes and the comment form on the actual contact itself but what we really want to do is display some information about this user’s company so we could come in here and add content and come into node and we could say we want the field company here which is just going to give us either the Entity ID or the Full Rendered Entity. But in this case we only want specific fields from this company.

We only want …we’ll open up this company content type here, we’ll say we only want the status field and the company name, we don’t want the Full Rendered Entity and the status field is either just a prospective client or an active client, we could have other client status as well but in this case we’re only going to have two.

So the only way to do this then is to setup a Panels context which … remember from last time we added context to a Panel page based on either an argument or through just a specific node, you can of course use other things than that but what we really want to do in this one is we want to do a node relationship and we’ll find our Entity Reference Field which in this case node from node on node company field company and this field_company is coming from this content type contact, I go into manage fields you’ll see this is field company and that’s the Entity Reference Field. So that’s what I need to select in this list and now I select Add Relationship it’s going to say the node is the node being viewed and it’s going to go ahead and set up this relationship.
Now you can see this relationship shows up here, we can update and save this and you can see now there’s node from node company. Now when we come over into our content section … oops I never saved it after getting under these fields, go ahead and get rid of those and save it. Now if we come into this content section you’ll see that we have a few more options. So first of all we can still add the node title field, that’s no different.

The only difference is we can now select this node from node for this field company so that’s going to give us the title of the actual company itself and not just the title of the contact we’re viewing. We can also look in here and find that we’re looking for the Status Field and here it is, Field Company Status and we’ll go ahead and just leave all this as the default for now.

You can see there’s only one option or context to select from into this list and that’s the Relationship that we set up and that’s because of course the contact content type doesn’t have this field. The Contact Content Type does not … but if we go into the company it of course has this field company status. So this relationship links from the contact to the company and gives us access to the fields that are part of this company.
So now we go ahead and finish this and of course we could add the whole body or note section if we want it as well but we’ll keep it simple. Now I’ll go ahead and go update and save and now I’ll come back so the company page still looks the same however if I go into one of the contact pages we’ll say Joe Smith, you can see here is the e-mail for Joe Smith, the phone number, some notes for Joe Smith but the company name and the company status that Joe Smith is a part of is in this other section. So if I click to the ABC Company it shows the company that Joe Smith is a part of.

If I come into Jane Doe in this case you’ll see that this is Test Company 1 so it’s a different company, company has a different status. It could have a whole bunch of other company fields like the company website, other important information. I can click on the company and it brings me to the actual company page. Obviously you can see there’s a whole bunch of other things you can do here using these different relationships to set up context and this is what really make Drupal flexible so if you’re building more of a web application like a customer relationship management system or an inventory management system or something to that extent this can be very powerful and very helpful.

You can of course do other things like use Panels to display styles and things like that and we’ve went over some of that in the past but just know that it’s very flexible, it puts a lot of power in your hands and things that you can do and it’s very useful for when you’re building out various types of websites.

So that’s a good getting started with how to use the Relationships portion of context, go ahead and take it and run with it. If you have any questions definitely let me know and we’ll be back again next time with another episode of the Daily Dose of Drupal, see you later.

Series: Panels SeriesTags: DrupalContribPanelsDrupal 7Layout ToolsSite BuildingDrupal Planet

Drupal 7 Panels Module Contexts

Apr 3, 2013

Description:

Episode Number: 135

Another episode on the Drupal 7 Panels module, but this time we cover Drupal Panels Contexts.

In this episode you will learn:

What are Drupal Panels module contexts How can Drupal Panels module contexts be used to load in additional information in a panel page How can Drupal Panels module contexts be used to load in dynamic information based on a page argument Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on episode number 135 and we’re going to continue where we left off, continuing to learn more about the Drupal Panels Module. As always I am Shane, you can follow me on Twitter at smthomas3, you can also go to codekarate.com, learn about the codekarate.com supporter program by clicking this link right here, you can also sign up for the newsletter if you haven’t already.

We’re going to go ahead and jump right into this one today and learn a little bit more about Panels Context and you can do a little reading on the Panels page about what a Panels Context is right here in this section and basically to sum it up, the Panels Context basically allows you to reference other types of content or objects that are within your Drupal website.

So let’s say for instance I wanted to include a specific piece of content … we’ll say specific information about another Node in this Panel page. I can use a context to reference that node, pull in the information and display it somewhere on this page.
You can see this one if you want we can take a look here and we’ll go ahead and … you can add an existing node right here through this and that’s what we did in this section here but one thing you’ll notice is you can only reference the entire node itself, you can’t reference any individual piece of information about this node. So if I wanted to pull in just the node title of that node or just the images that are displayed on that node there’s no way for me to do that.

I can select the build mode but I can actually reuse specific information from that specific node. So I’m actually going to remove this one and that way we’ll be able to start with just a plain empty section over here.

So I’ll remove that and I’ll save this, now you’ll see there’s a few errors here that are just C Tools warnings that we don’t need to necessarily worry about at this point so you can see there’s a blank section here. So let’s say for instance I wanted to pull in additional information from a node or user or anything else for this panel page. Just keep in mind this is just a custom panel page that we’re using as an example but you could of course do this with any type of panel page whether it’s a node view page or a custom page like this and there’s a section here for context and there’s a whole bunch of things you can select here and you could pull in for instance a specific comment and you’ll either have to enter in the title or the ID of this comment and that will go ahead and open up another section in here in your content section for comments and you could pull in specific information about that specific comment.

You can of course do the same with files, nodes, users and we’ll go ahead and just start with node, we’ll look at some of the other ones as well but we’ll start with the most basic one and there’s a node on this site. I think its Test Cloud Zoom, we’ll just go ahead and pull that in, you could of course type in any title in autocomplete by searching through all the nodes on your site and this is going to give us specific information about this node.
So I’ll go ahead and click Finish and I will click Update and Save. Now you can see there’s a node context that’s been added, you can edit it or delete it here. If I scroll down it gives me a summary or the context so I can use these replacement patterns inside anytime I have custom content inside my content section so I can pull out the node title, the node URL from this specific node but I can also look here and see that when I add content I now have a node section that was not here before.

So I can of course select the node title here and we’ll say we wanted to link to the node, I can also go ahead and say I want to show the node image and we’ll just use the image formatter, it’s going to look pretty big but we could of course change the image style to thumbnail, that should help. So now you can see that this node should have the title and the image showing up and the only reason that this is possible is because we set this context to reference this specific node so we’re able to actually pull in the fields from that node and use them wherever we want within this Panel page. So now if I refresh you can see I got the title here.

These will of course link off to that node, it also shows the thumbnail because that’s the image formatter that I selected for each of the images that were uploaded. So that’s one way you can use context to pull in different information. We can also go ahead and look at some of the other options so let’s say we wanted to have a Node Add form here, you add a context and say we want a node add form for an article, go ahead and select that, I’ll click Update and Save here.

Now when I come into Content I’m going to go ahead and remove this one just to kind of clean things up a little bit and I’m going to add a content here. Now if I select here; General Form and I select my context here which is Node Add form, that’s important. This wouldn’t of course be here if I didn’t have the Node Add Form Context, now I’ll click Update and Save, I come here and now you can see it of course overlaps, it could add some CSS to make sure this doesn’t break pass here or I could just get rid of this middle section but as you can see I can now submit an article right from this page. Add the image, it has all the vertical tabs, you can see it’s not necessarily lay down in the best fashion but because I added that context to that node add form I can now use this page to basically click Add an Article.

So I could for instance have the listing of articles over here on the right and a little quick submission or a node add form for the articles here and as I added the articles on the right would of course appear and they would be listed so I could use Views and Panels together to build some kind of interface for that. So that’s another way you can use Context.

It’s also possible to use based on the URL path that you’re actually sending in. You can use context that way as well. And the reason you may want to use the URL as an actual context is so you can make things a little bit more dynamic on your page. So in this example we’ll use the Node ID as an example of how to instead of just pulling in as you saw in this column here.

The actual title and image of this one specific node we can make this dynamic so if you go to panel-page/whatever this node ID is it pulls in this information, if you go to panel-page/a different node ID you’ll get different information over here. So in this case we can make our Panel page much more dynamic.

Keep in mind of course throughout this I’m just throwing things in this Panel page as examples so of course it’s not necessarily the way you would use it, it all depends on your situation but the point is it’s very flexible to handle a bunch of different situations. So the one thing we’re going to start up by doing is I’m going to come into basic here and change this panel-page to panel-page and then I’ll do %node.

If you use a % in front of it it means to require element, if you use an exclamation point in front of it which is documented right here it means it’s an optional element. So I wanted the Node ID to be required on this case and I’ll go ahead and Update and Save, as soon as you do that there’s another section that shows up here called arguments, now you can basically show what you want the context to be for this argument.
So we’ll go ahead and click change and in this case this is a Node ID. You could say if you want it to be an edit form for this Node ID, if you want it to be a node type instead of a node ID for the Add Form.

There’s a whole bunch of different options here but in this case were passing in a Node ID but just keep in mind there’s a whole bunch of different context that you can apply here. I can use Node ID as a context identifier, that’s fine, we’ll save that. Now when we come into our Panel you’ll notice there’s another context added down here; this is from the argument.

So you can manually add context, you can also add a context through an argument. Now when we come into our content section we come into our node title, change the settings here, we’re going to select out Node ID context that we got passed in from the argument instead of the hard coded context that we set up earlier. Now that we have that set I’ll save it and then actually I’ll go ahead and I’ll remove this original node context that’s just referencing this Test Cloud Zoom Node ID.

Since we want to make this dynamic we really don’t have to use for that one anymore so go ahead and remove that and save it. You’ll see the context down below now just show argument 1 and context 1 and if we come back to our Panel page you’ll see that now nothing is showing up but if I go to … we’ll just find a Node ID for another article, this one is 73 as you can see here. So if I go to panel-page/73 you’ll see that it shows the title and the image for that specific node. You can see these are just PHP notices from the C Tools module, obviously means that there’s some kind of notice, something happening, it’s not necessarily a huge deal.

In many cases you could hide PHP notices if it’s a live site and you’ll obviously want to hide errors like this from your users anyways but just keep that in mind that you may sometimes see this depending on your version of PHP and those types of things. So now you can see it is working dynamically so if I go back and if I find another article that’s not 73 just go down to this one, this one is 210 so I go to /panel-page/210, it’s going to pull in this title and this image.

So as you can see it is dynamic, we can do other things with this panel page such as in the selection rules we could add … you can see now though also once context are added and this is a good point to look at, you can have specific selection rules based on the node type. So if we wanted the node type to be limited to only articles and based on of course this Node ID that’s getting passed in then if the node type is an article it’s going to show display, if it’s something else we could have it show a different type of display.
We can also … in the URL path add one that only shows up on panel-page/*and if we don’t have that argument it’s not going to of course show this specific display. One other thing we’ll touch on briefly is Access; Access is very similar to selection rules but this just controls access to the page so if this doesn’t pass the user will basically get an access denied or will not be able to actually access this page.

So it’s very similar to selection rules, the same kind of options exist but if it doesn’t make a few of this check then it won’t even check which variance you should use. It passes the access check it will go down to the variance through each selection rule and find the first one that it matches and show the content but it has to first of course make it through this access check.

So that’s it for this time on the Daily Dose of Drupal, we’ll be back again next time and we’ll keep that next a little shorter and we’ll just go over a little bit more on context but what this relationship section is and how you can use that in … in our case we’ll use the entity reference module and go through that and how it can be used to build relationships between nodes but that’s it for now, until next time, thanks for watching the Daily Dose of Drupal, see you later.

Series: Panels SeriesTags: DrupalContribPanelsDrupal 7Layout ToolsSite BuildingDrupal Planet

Drupal 7 Panels Module Visibility Rules

Apr 2, 2013

Description:

Episode Number: 134

In this episode we continue learning about the Drupal 7 Panels module and go into how visibility rules can be used to control the display of individual Panels items within your Drupal panels content.

In this episode you will learn:

What Drupal 7 Panels module visibility rules are How Panels visibility rules differ from Panels selection rules How to use Drupal Panels visibility rules to hide and show content based on URL path Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 134 and we’re going to continue on with the Drupal 7 Panels Module videos and we’re going to go over visibility rules and this one should actually be pretty short because we learned most of what we need to know in the Selection Rule video in Episode 133 and this is just a little bit of an extension onto that and changes up how you can use instead of Selection Rules, Visibility Rules to control things that are a little bit of a finer level within the Panel page itself.

Before we get started; as always I am Shane Thomas, you can follow me on Twitter at smthomas3, you can find me on Google + and you can also go to codekarate.com, check out the newsletter and sign up if you haven’t already, also click here to learn a little bit about how you can help support code karate and make sure to check out the other videos and blog posts.

Let’s go ahead and get started; make sure you have probably followed along with the other 4 Panels videos, you’ll of course need the Panels Module which you can find on drupal.org. Let’s go ahead and get started; so we have our Panel page that we were on last time and if you remember we had two different variants that we were displaying based on the different selection rules.

We ended up displaying one variant if the user was not authenticated an authenticated user and we displayed the other variant for anyone else. So what we’re going to do is I’m going to go ahead and remove this string URL path selection rule just to make sure that we can use any path to get to this Panel page and we’re going to go over how we can use Visibility Rules and Visibility Rules is very similar to Selection Rules except for instead of controlling the access to the entire variant you can actually control things on an individual item level within your Panel layout.

So what this means is let’s say for instance and keep in mind that this has many different users and so I’m just showing an example of how it can be used but you’ll probably see many uses for this on different websites that you’ve worked on. So when you click on this little gear icon on the top right corner you see there’s a Visibility Rule section. What this Visibility Rule section does is very similar to the selection rules but instead of controlling the entire variant we’re just controlling this one item.

So we can look for a specific context, we can look for the URL path, a user role or a user permission. So I’m going to go through basically the same sequence I went through in the last one and you can see how this works. You can of course experiment with this other selection rule options and we’ll go over context in a different episode, you can also use specific PHP code which can also be helpful just always be careful when you’re entering in PHP code into the Drupal Admin User Interface. In this case we’re going to select String URL Path and I’m going to say if it’s panel-page/test we’re going to allow access so I’m going to click Save and I will update and save this.

Now if I come back here you’ll notice that there’s nothing showing up in this top right section anymore. That’s because it’s only going to be visible on this specific page. If I go to panel-page/test in the URL you’ll notice that now it shows up. If I go back to just panel-page you’ll notice that that section is missing. We can also do the same thing instead of with a current path or a specific path we can add a rule for a User Role or a User Permission.

If we set … this is only available for authenticated users, we’ll save that, I’m also going to go ahead and remove this first one. You can of course have multiple so you can have multiple select or Visibility Rules just as you can have multiple selection rules so I’m going to save that. I’m also going to come back in here before I get too far, I’m going to remove this selection rule that only allows authenticated users to see this page. So this means anonymous users will be able to see everything except for this section right here.

So I’ll go ahead and update and save this and I’ll refresh the page and as you notice here you can of course see this section. However; if I logout and come to this Panel page I can see everything but this section right here and what this is useful for is of course it you want to have one Panel page maybe it’s a dashboard of some sort or some type of information on your website but you want users who are logged in or who have a specific role to be able to see a different section or additional information that you do not want anonymous users to see.

So as you can see Visibility Rules can be very helpful with fine tuning the Permissions or the Visibility of specific items within your Panel page. Just always be worry when you’re using Panels that every visibility rules, every Selection Rule you add is extra processing. Normally it’s not a big deal but the more items you add to your Panel page is the more Visibility Rules. Overtime it can make your page a little bit of a heavy loader or a heavy loading page and can take a little while so just keep that in mind.

You can of course counteract a lot of this stuff with caching for anonymous users and things like that but always be worry of everything that you’re adding and make sure it’s actually necessary.

That’s it for this time on the Daily Dose of Drupal. Next time we’re going to go over Panels Context and learn a little bit about how those can be used using Panels and on your Drupal website. So that’s it for this time and we’ll see you next time, thanks for watching.

Series: Panels SeriesTags: DrupalContribPanelsDrupal 7Layout ToolsSite BuildingDrupal Planet

Drupal 7 Panels Module Variants and Selection Rules

Apr 1, 2013

Description:

Episode Number: 133

This episode continues with the Drupal 7 Panels Module and goes over how to use variants and selection rules within a custom panel page.

In this episode you will learn:

How to create multiple variants for a single Drupal 7 Panel page How to use selection rules to display a different Drupal 7 Panel variant based on a URL path How to use Drupal 7 Panels module selection rules to display a different variant based on a user's role on the Drupal site Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 133 and we’re going to continue where we left off on Episode 130 and learn a little bit more about the Drupal 7 Panels Module but before we get started; as always I’m Shane Thomas, you can follow me on Twitter at smthomas3, you can also stop over to codekarate.com and check out some of the other videos and make sure to sign up for the newsletter and also make sure you support code karate if you were interested so go ahead and click there and learn a little bit more about the code karate supporter program.

Let’s go ahead and get started though; last time if you remember we went over the layout builder in Drupal 7 Panels. This time we’re going to go over with what you can do with the Selection Rules and how you can really use Selection Rules to change the layout or the look of the page for different users or different … based on different selections, how you can manipulate and control the output of the Panels themselves so we’re going to go ahead and get started and jump right into the Panel here if you want to see we have this custom panel that we built in the previous episode.

I just went here into edit panel and one of the things that we’re going to be looking at is this selection rules option over here. So you can see we have one variance right now, if we go back and look at this panel it’s accessible on panel-page but if we come here and look at the selection rules for this variant, basically the way the panel works is when the page loads it runs through each of the different variance that you have, checks the selection rules and if it matches, the first one that it matches is the actual one that it will display.

So we’ll go ahead and show you how that can work here in a second but as you can see we have a pretty … I guess it’s a little bit of a complex layout but it’s nothing too extreme I guess, pretty basic but what we’re going to do is I’m going to look at the different options for selection rules.

So you can have whether certain context exist and we’re going to go over context in the future episode, you can check the current theme, you can based it on the results of some PHP code, you can also base it on URL path which is what we’re going to check first then you can use Permissions or Roles which we’ll also look at. The first thing we’re going to take a look at is a specific property that Panels has.

So if you look here; if we go to panel-page it’s going to return our panel which is what you would expect. So you can see the URL I go to panel-page it returns this panel. You can also notice if I go to panel-page/anything else it’s still going to return this panel. So I can use a URL rule and I can display a completely different layout for this page based on the second parameter here and this could be useful in different situations depending on how you wanted to structure your site, it’s not something I’ll recommend using a lot, there’s probably better ways to do it than this but it is something that you can use so we’re going to go ahead and add a selection rule to this variant saying string URL Path and we’re going to allow access on just the panel-page so we say allow access on the following page and we’re going to go ahead and say update and save.

Also I noticed there’s extra field in here that I no longer want, at least not quite yet so I’ll go ahead and get rid of that and save it. So now I check that, you see now I’m on panel-page/test. It does not show anything here because it’s limiting it to just panel-page. If I go to panel-page it will of course return my panel but what this does allow me to do now is if I wanted panel-page/test to show something completely different I simply add a new variant by clicking up here, we’re going to call this just Test Panel, we’re going to have Panel, we’re going to use Selection Rules and create the variant.

The Selection Rule in this case is going to be a URL Path of panel-page/test and of course this could be anything you wanted so if you add different sections within this panel page or something like that you could use URL Path Selection Rule, we’ll go ahead and hit continue. We’re going to do a simple one column layout here just to show you that it works, click Continue, we can go ahead and fill out … if we want to remove or add body classes at the CSS or CSS Classes to the body tag or a specific CSS code.
I wouldn’t recommend as I mentioned before adding a CSS Code here, I would add it to your theme If possible but it’s just something you can do if you need just a quick line of CSS or something and now we’re going to give it a title and add … in this case we’ll just do something quick and easy just the advance search from just to keep it simple. So I’ll create that variant and I will update and save that.

You’ll see now I have my Panel Variant and I have my Test Panel Variant. Each one has a different selection rule which determines how or which of these layouts actually gets executed. So now if we go ahead and come back, if I go to panel-page I still get the same page, if I go to panel-page/test you’ll notice I get my search form. You will notice that I see blocks on the left sidebar when I go to that one but I don’t see blocks when I go to the panel-page.

So what we can do here is the reason that is happening is because in this general tab I have disabled Drupal Blocks and Regions selected or checked. If I wanted to get rid of the blocks on this Test Panel I can do that by checking that box, I’m going to update and save. Now if I go panel page/test you’ll notice I do not have the blocks on the left sidebar anymore.

So that’s one way you can use selection rules and just to demonstrate how this Selection Rules work I’m going to go ahead and remove this URL Path Selection Rule, click Update and Save and come back and you’ll notice now that panel-page/test returns this first panel page even though this selection rule specifically matches it and the reason is you can think of it kind of a short circuit evaluation. It runs down this list and the first one that matches … the first one that matches all the selection rules that it needs to; in this case we’re saying all the selection rules must pass so we could have multiple here but they would have to match every selection rule and if it does it will display whatever is in this content section.

So in this case it never even gets to this last, the second variant because it matches the first one. So we’re going to go ahead and add our string URL Path back just to make it so it works the way we intend it to do, we’re also going to add a user role. We could do Permission or a Role and this is basically we can allow only certain users on the site depending on either Permission that they have or a Role that they have to see this specific variant or of this Panel page.

So if I do a user role and only show to authenticated users and I click Update and Save and then I’m going to come down into this Test Panel and in this case I’m just going to remove this because what I want to do here is I want anyone who is on this panel-page and is logged in or as an authenticated user to see this page here or this content or this way that this is laid out and I want anyone else … let’s say anonymous users in this case, I’ll go ahead and add URL path I guess just for panel page just so we don’t have any other URLs that can access this page but an anonymous user will fall through to the second section and only see the search form and you could think of many ways that you could do this based on if you wanted an authenticated user to see a specific version of a page but an anonymous user to see a completely different layout version of the page.

So as you can see I go to panel-page and I am logged in, I see this, if I happen to logout and I go to panel-page I see the search form. I don’t have as many options because anonymous user doesn’t have some of the advance search options that a logged in user or the administrator has but as you can see I’m at the same URL but I’m seeing two completely different results based on my role in this case. So that’s a quick introduction to what you can do with Variants and Selection Rules within Panels.

Next time we’ll cover Visibility Rules which will actually go over how to control a specific item that is being displayed on the Panel. Thanks for watching the Daily Dose of Drupal and we’ll see you next time.

Series: Panels SeriesTags: DrupalContribPanelsDrupal 7Layout ToolsSite BuildingDrupal Planet

Drupal 7 SwitchTheme module

Mar 28, 2013

Description:

Episode Number: 132

The Drupal 7 SwitchTheme module creates a simple block that allows a user to easily switch between different themes on a Drupal 7 website. This allows other users (not just administrators) to view the site in a different theme. This is set on a per user basis, so one user can view the site in a different theme than another user.

In this episode you will learn:

How to configure the Drupal SwitchTheme module How to set permissions and use the SwitchTheme module for users besides administrators Full Text: 

Hello everybody and welcome to another episode of the Daily Dose of Drupal. Today we’re on Episode Number 132 and we’re going to be going over the Switch Theme Module.

The Switch Theme Module basically creates a block that allows you to switch back and forth between themes on your Drupal site and this is very useful if you want to allow users to change the look and feel of your site if you have multiple themes, it’s also good for some testing purposes if you want to try out a bunch of different themes easily.

So we’re going to go ahead and give that a look but before we do; as always I’m Shane Thomas, you can follow me on Twitter at smthomas3, also go to codekarate.com if you haven’t already and sign up for the newsletter down here on the bottom left and also click on this support code karate link over here and learn how you can help support code karate in my vision of providing Drupal education for everyone for free. Today’s sponsor is modulenotes.com.

Modulenotes.com is a great place to go if you want to learn about Drupal modules, basically it provides module descriptions that are in simple terms, easy to understand. On top of module descriptions they also have videos for the modules pulled in from a whole bunch of different sites and other different types of descriptions so g ahead and check out some of the modules here and you’ll notice there are quite a few code karate videos that are pulled in to the site as well so go ahead and take a look at modulenotes.com.

Let’s go ahead and get started; I already have the Switch Theme module installed so I’ll take a look at that. The first thing we’re going to do is we’re going to click on the permissions page and I’m going to look for the switch theme permissions and I’m going to go ahead and give anonymous users the ability to switch themes.

I want them to be able to easily switch the themes on the site, it could give it to an authenticated user as well, you can also allow them to permanently use a custom theme, that type of thing but we’re just going to work on just the search themes and covert that so I’m going to save that and now I’m going to come back to the modules page, I can also go to the admin menu to get here but I’m going to go to the configure option. You’ll notice that when I click on configure I have three options here; Bartik, Seven and Zen.

So basically these are the three themes enabled on my site. If I open up in a new tab you can see that I have Bartik installed, Seven installed and Zen installed. If I wanted to enable another one, let’s say we want to enable Garland as well we can enable that, refresh this page and you can see Garland shows up I can of course give this a different name so if I want to change Seven to say, Admin Theme instead of Seven I can do that, save it and basically these are just user friendly names for your different theme options. After is saved that the next step is to of course to add the block.
So I’m going to come into the blocks page and I’m actually going to hide a few of these blocks just to lower or simplify a little bit, I’m going to scroll down into the bottom and find the Switch Theme Block and I’m going to move that into sidebar first. Start to come up and you’ll see we have the Switch Theme Block, I’ll move it up just below the search form and I’m going to go ahead and save this page. Just to make sure; I’m also going to set that in the sidebars of these other themes as well.

That way when I change themes it still going to be showing up in the same place or relatively close to the same place so for the Garland save it, the same for Seven, let’s put that in the top of the content section and I’ll go ahead and give it a test. I’ll go ahead and leave Zen without it for now. Now you can see that I have a little theme switcher here so I can go ahead and click on Garland and click Switch.

You’ll notice that my theme completely changes, I didn’t have to go to the appearance tab, you can switch to Seven and it switches, I can of course go back. But the important thing is it’s not … obviously this can be a tool used for administrators to easily switch between themes but often it would be used to allow your users to select how they want to view your site.

So if you wanted to have multiple themes on your site and you wanted your users to be able to choose the different themes and maybe you had a couple of different color options in your different themes and you wanted them to be able to choose how they wanted to view your site, you can use a different accessibility reasons to allow certain themes to be easier to read than others, more accessible than the default ones, maybe larger font in certain themes but we’re going to go ahead and show how that can work if I logout.

So you can tell them in logout no admin menu at the top and I of course can switch the theme as an anonymous user. This of course would work with authenticated users or any user role that you gave the Switch Theme permission. You will notice if I go to Zen now I’m kind of at the stuck point because now that I’ve switch the theme and I don’t have a block in that spot I can of course switch the theme back so I would of course need to login and then of course I could change the theme.

So as you can see it’s very easy to allow users to switch between the different enabled themes on the site, you can also look at the readme file for instructions on how to modify single theme and use the Switch Theme to allow users to choose small, medium and large text versions of your site.

So a pretty handy little module, really simple on what it does. Go ahead and check it out and see if something you can use on your next Drupal projects. Thanks again to modulenotes.com for sponsoring this episode of the Daily Dose of Drupal and thanks for watching, we’ll see you next time.

Tags: DrupalContribDrupal 7Drupal Planet

Drupal 7 Floating Block Module

Mar 26, 2013

Description:

Episode Number: 131

The Drupal 7 Floating Block module makes it easy to float a Drupal block along the sidebar as you scroll down the page. It uses a simple CSS selector to determine which blocks to float.

In this episode you will learn:

How to install and configure the Drupal 7 Floating Block module How to determine the CSS selector to use for your block How to get a Drupal block to float as you scroll down the page Tags: DrupalBlocksContribDrupal 7Layout ToolsDrupal PlanetUI/DesignJavascriptJQuery

Drupal 7 Panels Module (part 3) - Layout Builder

Mar 20, 2013

Description:

Episode Number: 130

In this episode we continue learning more about the Drupal 7 Panels module and go over how to use the panels flexible layout builder to easily build complex layouts using the panels module.

In this episode you will learn:

How to use the Panels flexible layout builder How to convert a standard Panels layout to a flexible layout

Thanks to OSTraining for sponsoring this episode of the Daily Dose of Drupal.

Full Text: 

Hello everyone and welcome to another episode of the Daily Dose of Drupal, today we’re on Episode Number 130 and we’re going to continue on learning about the Drupal Panels Module.

Two episodes ago we learned how to build a simple Drupal Panels Module or Drupal Panels page and the last episode we learned how to override the Node View page by creating a variant for that specific Node Type and we also learned how you can do that with different Node types by adding additional variance.

Today we’re going to learn how to use the Panels flexible layout builder so you don’t have to use the pre-configured that come with Panels. Before we get started as always I’m Shane Thomas, you can follow me on Twitter at smthomas3, you can also go to codekarate.com, sign up for the newsletter over here on the left, you can also click the Support Code Karate link and learn a little bit about the Code Karate supporter program on how you can help Code Karate get even better today than it was yesterday.

Today’ sponsor is OSTraining.com OS Training is a great way to learn about how to build websites not only in Drupal but also Joomla and Wordpress. They also have a whole bunch of training on just basic coding techniques and technology so you can go to learn about HTML, CSS, PHP and introduction to responsive design which is a really good one, you can also of course learn about Drupal.

They have a whole bunch of courses about Drupal and so you should go ahead and check them out, their prices are very reasonable and they provide very good training classes on these different technologies.

So let’s go ahead and get started; as I mentioned before, we’re going to pick up where we left off so I’m going to click on Structuring and go to Pages and you can see I have the My Panel page that we created two episodes ago and we also created this Node View template in which we created a Contact Node View page and change the layout and format of that.

I’m actually going to come to the one that we did two episodes ago and I’m going to edit that and we can take a look at see that they have a couple of different things showing up here but what I really want to do is I want to change the layout from this two column layout.

You can see it comes with a 1 column, a couple of 2 column layouts and then a couple of three column layouts but I want to use the builders category and select Flexible. It’s going to of course try to convert everything over that I had showing up into the flexible ones so I’m going to go ahead and click Update and Save, we’ll continue and come down to Layout and now you can see it dropped everything in to this central layout.

And now you can see there is this show layout designer button. This is actually where you’re going to be able to change how you want the layout to be structures so right now it gives you one column, just calls it Center. By clicking on Show Layout Designer you can see it changes the display a little bit and we can actually change how many regions we have so if I click on this region settings I can remove this region or I can give it specific settings like a CSS Class but if I come up to the Row section I can add a region … let’s say to the left of this.

I’ll go ahead and call this left region, I can give it a CSS Class if I wanted to so I go left to that region and I can select if I want this to be fixed or fluid with. Go ahead and select Fixed here. Now you can see I can change the width of this so if I want this to only be … we’ll say 100 pixels I can update and save that and now you can see I have a left region and a center region.

If I come back to show layout designer I can of course change that and now you can see I can make it a little wider. This left one is going to be fixed and this one would be fluid. I am using a fix with theme so it’s not really going to change much but you can keep that in mind that this would be actually the fluid section, this would be fixed. If I change this region from fixed if I would have edit it and create it as a fluid region so let’s say I removed this region I’ll add a region left and we’ll make this one fluid and I save that, now you’ll notice instead of pixels it’s giving me percentages.

So I can say I want this to be a specific percentage and in this case we’ll say maybe around 30% on this side and 70% on the other side. Now when I save that it of course puts it in that position, 30% here and about 70% here. I can now add sections above this row so you have this row; you can also add different rows below that or above that. So I can give it a CSS Class, I can specify whether it contains regions which is what we just created with that left region or completely new columns so I’m going to go ahead and select regions here.

Now I can add another region, now I’ll call one Bottom Left and I can also create one on the right side and call it Bottom Right. I could of course change this but I’m going to keep it 50% on each. Now I update and save that and you’ll notice I now have a region left, a center, a bottom left and a bottom right. I can drag stuff into these different regions of course it says I could before and update and save that. I can come back into our layout designer here by clicking the Show Layout Designer.

You can also of course get out of it just by clicking here and just bouncing it back and forth and between the different either showing the designer or not showing the designer. I can come up to the canvass level and I can add a column either to the left or to the right of this so I can essentially add an entire column to the left of all of this if I wanted to so if I add a column to the left … actually I want to … that was a CSS Class so I want to make sure that’s valid and now you can see I have a column here and then I have this more complex layout here inside this column I can add additional rows and inside this row I could have additional columns. So as you can see you can get very complex layouts if you want inside this Panels Builder.

As you can see it can get to a point where it’s almost too much so you want to of course always know what you’re trying to build beforehand and then make your regions accordingly. So as you can see I have a lot of extra stuff here I don’t really need but if you take a look it of course shows me I have this region left here, I have another region I could of course rename this. I’ll go ahead and rename this one just to give it a different name.

Now of course I can move something over here or add something so I’m going to go ahead and find something to add, I’ll add the recent content from the site, I can give it a different label if I want and I can update and save this. So now that I have that we’re going to go ahead and go to the URL for this and if come back I can of course see what that URL is. I believe it’s up here, it’s on test4.codekarate.com/panel-page.

So I’m going to go to that page and you can see I got my complex layout so I have this Check out This other Post, I renamed that and it shows the recent post on the site. I have my custom content section and there’s just the content block that I created or custom content inside the Panel.

There’s this node that’s getting loaded here. If I go down to the bottom section of course I have this advance search section and this Powered by Drupal block. These are all in different sections and you can see it’s completely taken over the entire output of the page. So it’s incredibly flexible using the Flexible Layout Builder, you can change the entire layout to match perfectly and exactly what you need.

It takes away and it saves you a lot of time from having to do a lot of CSS in order to move things into different regions and different sections and you don’t have to worry about structuring your HTML because the Panels Module will do it for you. You can then simply come in at the end, add a little CSS Code to clean it up and you’re good to go when you have a fully functional, fully flexible page and if you ever need to add something or move something around you just come in here and you can move it around or add different sections and change it as you need.

So that’s the Layout Builder or Layout Designer in the Drupal 7 Panels Module and we’ll probably take a break from Panels Module episodes but we’ll probably come back to them in the next couple of days or a couple of weeks but thank you for watching this episode of the Daily Dose of Drupal, thanks to OS Training for making this possible and we’ll see you next time.

Series: Panels SeriesTags: DrupalContribPanelsDrupal 7Layout ToolsSite BuildingDrupal PlanetUI/Design

Drupal 7 Panels Module (part 2) - Override Node View Page

Mar 19, 2013

Description:

Episode Number: 129

This continues with the Drupal 7 Panels module and goes into more detail on how the Panels module can be used to override the display of the node view (or content type) pages.

In this episode you will learn:

How to use the Panels module to override the node view page on a Drupal 7 website How to use Panels to completely customize the layout of content type pages for specific content types using selection rules and variants Full Text: 

Hello everyone and welcome to another episode of the Daily Dose of Drupal, today we’re on Episode Number 129 and we’re going to pick up where we left off last time on the Drupal 7 Panels Modules or Panels Module and we’re going to actually go over how to override the Node View Page for a specific content type on a Drupal 7 website.
So we’re using the Panels Module as I said before but before we get started; as always I’m Shane Thomas, you can follow me on Twitter at smthomas3, you can also go to codekarate.com and sign up for the newsletter and check out my new Code Karate supporter program, recently launched. Today’s sponsor is OS Training.

OStraining.com provides great training for Wordpress, Joomla, Drupal and just basic coding skills so if you want to look at some of the Drupal videos that they have you can come in here and preview the videos. They 14 classes on Drupal and they cover Drupal beginner and intermediate levels, they cover views and they have a whole bunch of other Drupal related classes.

So go ahead and give them a look on OSTraining.com and check out some of the Drupal videos. Let’s go ahead and get started; we left off last time with this basic Panels page that we created and we created that URL of /panel-page, we’ll go ahead and jump into this just to review.

As you remember we were able to drag different sections into different items into different regions but what we really want to do this is create a new layout for a specific content type so I created a content type here called Contact and this contact content type has a whole bunch of fields like contact name, phone number, e-mail, company name, company website and notes and I’ve just used basic text fields, you could of course download other Drupal modules to make the e-mail field act more like an e-mail field, phone number more like a phone number field, etc. but this won’t work for our purposes.

So I’m going to go ahead and create a new contact, so I’m just typing in a basic contact for some contact information and I will save this and you’ll see this is how it turns out, it has the notes section up above, phone number, e-mail, company name, company website and everything works alright, we have a comment form below but what I really want is I want to break this into couple different columns and I just want to change this layout a little bit.

So of course if you just want to change the ordering or change the structuring a little bit you can always come into your content type and manage display and for instance I can move the noted down to the bottom and I can of course change the labels to some basic things like that.

However; that doesn’t give you really the full control that you might be looking for and this is where the Panels Module will come in handy. So as before you want to watch the first episode to make sure you have all the required modules but I come into structure pages and there’s a section here called Node View. Take a look; also you’ll see there’s a User View which is for user pages, there’s a Term View which is for a Taxonomy Term page and then there’s Node View which is for Node View pages or content type pages.

So I’m going to go ahead and enable this, after I enable it I come in here to edit and we’re going to have to actually create a new variant. You can think of variance as different layouts that you want to create. Each variant can have a different selection rule and in most cases with your content types you’ll probably have one layout for each content type and if you don’t want … if you don’t actually have a variant selected it’s actually going to fall through and go back to the default Drupal display so we’ll show you how that works in a second.

I’ll go ahead and I’ll call this Contact because we’re going to use it just for the contact pages, it’s a Panel Variant Type, we do want Selection Rules so I’ll go ahead and create the variant. In this Selection Rules this is basically the rules that need to pass in order for this layout to be displayed.

There’s a whole bunch of options here but most of the time you’re going to simply go to node type and select the node type that you want to use this display. So in this case I selected contact and I want this to show up for contact pages so I go to continue, I’m going to go to a two column simple layout, I’ll go ahead and use two column stack again and I go with the next page and I can add or remove CSS body classes, add CSS body classes, give it a CSS ID and drop in some basic CSS Code.

As I mentioned before I would use the theme versus actually dropping in code here but it is an option and now that we got that created we now can start adding items to our display. So the first thing I’m going to do is I’m going to add the note section to the bottom here so I simple come into node and in this case the node section is the body field so I’m going to click on body, I can give it a label whether I want it to be a title field, want the label to be above or I want the label to be inline, you can select the Formatter and you select of course the node being viewed.

This override this title, basically allows you to give a different label if you want. So I’m going to save this, I know I just have the body field here, I’m going to go ahead and create the variant and save it and we’re going to take a look and see what that does, I click Update and Save, now that it’s saved I’m going to close out and you’ll see now everything else on my page is gone, I just have this Note section.

I’m going to go ahead and hop over to an article content type that I have to show you that it’s only doing this on the actual contact content type. The way this is working is this article content type is coming into these pages, coming into this node view section. It’s going through this variance and if it doesn’t find the one that matches it’s going to fall back to the default Drupal Node View which is why it looks normal.

If I added another variant up right up here in the corner I could also add one for article, for page for any other content type that I wanted to display a unique layout for. To get back into my layout for my contact content type I simple click on Content and now I can start adding the other fields that I want.

So I’m going to add some of the other Node fields like e-mail, and then I’ll also add phone number, it’s taking a second to load here, phone number as well and I’m going to go ahead and put this one so we could see the different labels up with this label as above then we’ll go to see what the different labels look like. I’ll also add on the right side now … I don’t know why it’s … since we’re having these issues it’s a little bit strange but the right side I’ll put company website and I’ll put this label as inline.

So now you can see I have two different columns of information with the e-mail and phone number over here. I can of course drag this to different sections and a company website over here so I’m going to update and save this and we’re going to go ahead and take a look. We’re going to need to come back to this page or refresh and you see the e-mail is here.

This is with the label as the Panel Title. The label above shows up here and inline shows up like this. As you can see its inline and then the Node section is of course below. To edit the panel I can always just click here and select Edit Panel and I’m back right to the section that I need to be on this variant. So I’m going to also add the company name field and I’ll make this one inline as well.

Hidden of course just hides the level and then I’m going to save this and now you can see now the company name shows up there as well. So as you can see you can do a whole bunch of different stuff with this and it’s not just limited to the fields that you created on this specific node. You can also add other items. You can add for instance other blocks that you might want.

Let’s see what we got here for different blocks and we can add different widgets like the Powered by Drupal widget or recent content, you can either login form if they are not logged in, different search forms so I’m going to drop in the search form here just so we can see how that would work so now the top is the search form and the other sections of course are what we set up before I’m also going to add the Comment section so I’ll save this, refresh that and you can see there’s now a search form here but I’m also going to drop in the comments section below so we’ll drop in the comment form here, come up here to leave its node and we can do the comment form, you can also add Node Comments as well.

I’ll just drop in the comment form for now and then of course if you want to display the node comments you would of course add the node comments section to the Panel as well. So as you can see it’s completely customizable to any type of layout you want and you can change the layout, you can drag and drop and put fields wherever you want, you can change the labels and you can use other types of blocks, you could drop views in here if you wanted a view of this … for instance something related to this contact.
There’s a whole bunch you can do with Panels and this is just the start. We’ll have another episode on more things you can do at Panels in the next episode of the Daily Dose of Drupal but thanks again to OSTraining.com for sponsoring this episode and thank you for watching; we’ll see you next time.

Series: Panels SeriesTags: DrupalContent TypesContribPanelsDrupal 7Layout ToolsSite BuildingDrupal PlanetUI/Design

Drupal 7 Panels Module Basics (part 1)

Mar 14, 2013

Description:

Episode Number: 128

The Drupal 7 Panels module allows the creation of customized page layouts using an easy to use drag and drop page builder. Panels can be used to build custom pages, change the layout of node (or content type) pages, and even modify the Drupal user profile or account page.

In this episode you will learn:

An overview of what the Drupal Panels module is and how it can be used A quick overview of Drupal 7 Panels options and configurations How to create a custom Drupal 7 Panel page Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 128 and we’re going to be going over the Panels Module today. The Panels Module is an extremely complex layout builder or basically it’s almost like a site or design management tool for your Drupal site and we’re going to go over it in a couple of different segments and a couple of different episodes because it’s not something I’m going to try and cover all in one episode and I’m going to start with just the basics, a few simple episodes going over the basics and depending on how you respond.
I can either continue going into more depth on Panels and some of the various options and configurations that you can create with the Panels Module or I can move on to other things. But before we get started with the Panels Module as always I’m Shane Thomas, you can follow me on Twitter at smthomas3, also go to codekarate.com and sign up for the newsletter if you haven’t already.

Today’s episode is sponsored by modulenotes.com. If you haven’t checked out modulenotes.com yet you should do so right now. It is basically a very simple idea behind the entire site but it provides module descriptions in a more readable format I guess you can say. It’s easier to understand the module descriptions on the site.
So they take complex module descriptions from drupal.org and it’s written by a designer for designers. I by nature am not a designer and they still helped me understand complex modules in which you may be wondering what does this module actually do.

So go ahead and check out modulenotes.com, view some of the descriptions they have in modules and see how it can help you more easily understand what a module does before you install it.

Let’s go ahead and get started; the first thing you need to think about when you’re building or using panels is what exactly you’re going to need to use Panels for. I’ve used Panels on dozens and dozens of Drupal sites spending in the last few years and the main two reasons I’ve ever used Panels to either build a custom page with a specific complex layout or to … and this is the most common one; change or configure a specific content type page.

So if you want your articles to show up in a specific format or you want … you have another content type, you know, whether it’s your pages or whether it’s a more specific content type and you want to control how it is laid out and how it is displayed. That’s where the Panels Module comes in.

The first thing I’m going to do and this may seem counter intuitive but I’m going to enable the Page Manager module. It’s a little … it just makes it simpler, you don’t necessarily need it for the basic Panels Module to be installed, it’s not a dependency but it comes with C Tools which is a requirement for Panels, I would just go ahead and turn it on. It makes managing the pages on your site much easier. I‘m also going to turn on Panels and I’m going to leave that … just turning on Panels now, I guess that I may cover some of this other modules that come with in a future episode but we’ll just start with the basics.

In this episode I’m just going to go over how to build a custom page with Panels and then the next episode I will go over some … or how to actually override the node view or a content type display page using the Panels Module. So now that I’ve enabled the Panels Module you can see there’s an option for Panels here.

Here you can create a new Panel page or you can create a new custom layout and you’re going to notice when you first get into Panels if you haven’t looked at it before it’s going to look very intimidating, very confusing, don’t worry we’ll walk you through step by step with what you can do and overall you’ll find out it’s not really too bad. You can also click on Pages which this is kind of a different view. This is how you are going to be able to override Node View Pages and even user profile pages using the Panels Module.

So if I add a custom page or I can come into Panels I can add a page here, the same thing. So I can go ahead and click Add to add a new page, I’m going to give it an administrative title; I’ll give it a path. So this is the path that you’re going to actually be able to access your page at and you can click here to make the site your homepage, you can make this page display in an admin overlay.

This is if you’re making an administrative panel page this would be helpful. Variant type; most of the time it’s going to be Panel; I’m not going to go over the http response or http response code. Most likely I’ll just leave it at Panel. You can add optional features such as Access Controls so you can control who can see this page and you can add a visible menu item which I’ll go ahead and do and you can add selection rules and context and we’re not going to cover those today but just know that they’re there and you can take a look at them and try to figure them out on your own or hopefully it will be a future video that we’ll walkthrough those.

So I’m going to create a normal menu entry, we’ll just call it Panel Page and put in the main menu and now we get to select how we want this Panel Page to be laid out. I’m going to go ahead and select a two column layout with this two column stack and in the future episode we’ll cover the flexible layout page because that’s really where in all honesty probably 70 – 80% of the time I use a flexible layout just because then it allows you to really control how you want your page to be laid out but I’m going to go ahead and use two column stack this time to keep it simple.

We’ll come back to what this option does to disable blocks and regions but first we can remove specific bodies, CSS classes, add bodies CSS classes. I’ll give it a CSS ID for the entire page, you can even drop in some custom CSS Code here. I would usually put your CSS Code almost always in your theme … you generally don’t want to use this box but it’s here if you need it.

So now once we click Continue now you can set the title so I’m going to set this title as My Panel Page and now you can see I have these 4 different regions; the top, bottom; left and right side.

Now is where it really becomes the easy part. We just start adding things to this various sections. So I simple click here, click on add content and Panels comes with a whole bunch of default items that you can add in here. So I’m just going to kind of flip into some of this.

So let’s say for instance I want to add the powered by Drupal block, I can go ahead and click that, you can give it a title or a block title, you can see it now drops into this top section. I can drag this into other areas, I’ll go ahead and click finish here and once I click Finish you can see I get some more options.

Now it’s easier to drag so I can drag this into other areas and I’m going to go ahead and drop this in the bottom and click Update and Save. Basically any block, thankfully you can normally add or configure in the block settings is going to show up on this page generally under the … I believe custom blocks or miscellaneous depending on what it is.

Also you can display Views Blocks in here, there’s a views content panes module that also allows you to display views. So you can really get complex layouts. So we’re going to go ahead and add an advance search form as well, I’m just kind of randomly picking some items here just to have … just a couple of different options.

Some reason it doesn’t want to stick, there we go and I will go ahead and add … this time I’m going to add a new custom piece of content. As you can see whatever contents you want and this is very similar on just creating your custom block, you can change the text format of course and that will drop in there so we can click Update and Save and then I will find something here to add in the top, you can add an existing node and I will drop in a complete full node so if I want to find the node that I want I can grab one, I can include node links and you can link the title to the actual node page, you can have it display the teaser or with a full content and I will go ahead and leave this dropped into the top.

It’s going to actually display this node page on top, there will be a search form in the left side bar below that and then my custom content in the right side bar and of course the Powered by Drupal will be in the bottom section of this Panel page. You’ll notice that on the side here you have a lot more options to look through; we’re going to browse to these really quickly. Basic is the basic information you filled out when you created the page. Access is to allow access to specific users.

For instance you can base it on user role or permission, you can based it on specific URL paths, you can use PHP code, a whole bunch of different … basically access rules to determine if a user can see this page. The Menu Item is where we created this Menu Item and Panels has something called Variance.

And we’re going to go over Variance in the future episode rule. I won’t worry about too much but know that they’re there and you can see there’s a couple of different options here; selection rules is basically so you can select which variant to display.

So if you have multiple variances … like I said we’ll cover that more detail later and context is a whole another … quite a little bit bigger topic to discuss. So we’re going to keep our simple layout in kind of go over the basics of what you can do with Panels.
So now that I’ve created this, I mean make sure I know panel-page, this should have a … and I do, I have a menu link of course that I created, I click on Panel page and you see it gives me my title and now it has this node. So it’s the node that I selected and loaded. It’s only showing the teaser format of course, I can click this it will bring me to the full node page.

On the lefts side over here I have the advance search box on the right side, this is my custom content that I created and of course in the bottom I have this Powered by Drupal. One thing to note is you can easily hover over here and click Edit Panel, that will bring you back to the Panel Editing page.

Another thing you can do is Panels come with a couple styles you can select so I’m going to go ahead and change the style and I’m going to … we’ll go through these options, you can have no markup at all, you can have a list style markup, no style or rounded corners. I’ll go ahead and select rounded corners for this and I will say I want rounded corners around each region and I will show you the difference here what that does; I move this … it’s a small area there but if up and down I’ll show you that here’s a rounded corners here.

If I come in and move this over here and save it you’ll notice that there’s only rounded corners around the entire region itself. However if I want to change this to basically make rounded corners around each pane instead of each region. Now it’s going to make rounded corners around each item inside this left side region. So we’ll go ahead and save that and now you can see there’s rounded corners around each item. So there’s basically a different ways so you can style and customized the way this looks.
Keep in mind that this is of course not a pretty looking page yet, I haven’t really put a lot of thought into it but this is really good for displaying or customizing homepages or landing pages, anything with complex layouts where you may need a form or a block over on one side and you may need to display part of a node on one side.

It’s really great for displaying multiple views so if you have different views you need to display on one page. One thing to keep in mind is it’s easy to go overboard with panels and to try to put too much into one page. If you’re trying to load 4 or 5 or 6 different views on one page just keep in mind all of the information that’s going to loaded from the database when you’re loading that page and there are things you can do with views and with Panels to add caching and things like that but just keep in mind the more you add the bigger performance hit is going to take on your site. That’s the intro to Panels.
As you can see you can use it to build a very complex pages and easily drag and drop and move around different items on your page. Tomorrow we’ll cover some more on Panels and we’ll go over how to use Panels to override a node page or a node view page and also well discuss some more Panels, Items and maybe go over a how to also override a user profile page or the user View page in Drupal.

That’s it for today, thanks again to modulenotes.com for sponsoring today’s episode of the Daily Dose of Drupal and thank you for watching, we’ll see you next time.

Series: Panels SeriesTags: DrupalContribPanelsDrushLayout ToolsSite BuildingDrupal PlanetUI/Design

Drupal 7 FooTable Module

Mar 13, 2013

Description:

Episode Number: 127

Update: If you want the labels to show up, install the jquery_update Drupal module and inside the configuration options select jQuery version 1.8. This will fix the label issue.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 127 and we’re going to be going over the FooTable Module. If you have worked at all with responsive websites or building websites so they scale down nicely on tablet and mobile devices the FooTable Module will be something that may interest you. It essentially allows you to easily build tables using the Views Module and have these tables scaled down nicely whether or as you scale down the size of the screen.

It uses the jQuery FooTable plug-in and it creates the responsive table layout. But before we get started as always I am Shane Thomas, you can follow me on Twitter at smthomas3, you can also hop over to codekarate.com and sign up for the newsletter if you haven’t already.

Today’s sponsor is buildamodule.com. Buildamodule.com is a great place to learn about Drupal. I’ve used it in the past with my employees at Beginner Media and it’s a great way to learn the basics of Drupal and get started quickly. So if you’re looking to expand on your Drupal knowledge or just getting started with Drupal go ahead and check out buildamodule.com. Let’s go ahead and get started; the first thing you need to do when you install the FooTable Module is make sure you have the libraries API Module and the Views Module downloaded and installed.

You’re also going to need to download the FooTable J Query plug-in and put it in your sites All Libraries Directory. You’re going to want the directory to be called the FooTable. So we’re going to go ahead and get started; I have also … in this example I’ve downloaded the Zen Theme because it allows you to easily make it a Fluid with so as you can tell it’s pretty basic but it’s a fluid with theme.

That’s going to make it easier to show the various breakpoints with our table. So I went ahead and set the Zen Theme as my default. Obviously if you’re using Zen you’re going to most likely be using a sub-theme but in this case just for example purposes I’ve just installed the Zen Based Theme and I’m using that as my default theme.

I’m going to go ahead and create a new view, I’ll go ahead and call it FooTable and I’ll show content of type article, I’ll go ahead and leave it a page and leave the path and everything the same but the display format we want to select FooTable. And you’re going to notice that or at least one thing to keep in mind is this is a alpha release. It’s very much I guess in the category of it still needs works so it’s not perfect but I still wanted to show this module off because of how cool it can be and hopefully if you have some time to look into fixing some of the bugs and issues you can make this module even better.

So just keep that in mind as we’re getting started that it’s still is going to … it’s not perfect yet but it is still going to still be pretty cool. So we’ll go ahead and save that and I’m going to add a whole bunch of fields here just so we have an example to look through, I’m going to add say Edit and Delete links, the comment counts. We will go ahead and add the post dates and we’ll add the Update Dates.

So we have a few fields added there, we’ll leave all the labels the same and we’re going to go ahead and rearrange some of these, put the edit and delete links at the end and I’ll hit apply. I’m also going to give the title a label of article title.

And now here’s where the settings for the FooTable come in. So we have the format selected as FooTable as you can see and there’s specific settings for this table. So if you scroll down you’ll notice that there’s FooTable settings here. The first one is where you want the expand will come to be and this is where the + or – icon is going to appear, we’re going to leave this as article title.

The next you can select your collapse counts. So this is where you select where you want certain fields to be hidden. So for instance if I want the edit and delete link to be hidden … well we’ll say we want all the fields to be hidden on the phone besides the title field and we also want the post date and … or the comment count and the updated date to be hidden on the tablet.

Now I can go ahead and hit Apply, click Save and go ahead and take a look at this settings again so you know what’s going to happen, you can see that some of these fields are going to be hidden depending on the various sizes. So I’m going to go ahead and click on View Page.

As you can see I have a pretty simple looking table here using the FooTable Module and I have an extension on Chrome called the Web Developer extension which I’m going to use to view the responsive layouts. So this just gives you a bunch of different sizes so we can go through and we can look through these various sizes.

So I’ll go ahead and take a look at the first ones so this is a mobile phone in a portrait mode and it gives you the dimensions, you can see it just displays the article title and you can also see it has this little + sign next to it. Here’s the one bug that I found with the module so far; is that it doesn’t display the label to the left of the field, I’m going to be taken look at that and if you have time I suggest you try to contribute back as well so we can get this little bug fixed because that’s one of the bugs that seems to be standing out that of course makes it somewhat unusable but if that bug is fixed which I’m sure it will be soon, the module of course be in a much better state.

We’ll go ahead and look at it on mobile landscape mode, you can see it’s the same thing but you can see more of the field, still works the same way. If you go to a small tablet mode now you can see … you’ll see additional field so the comment count and the updated date field are not listed but the other fields are showing, you can click and you can see the comment count and the updated date, the small tablet landscape is the same way, a tablet portrait still shows that and I believe the tablet landscape actually does show the entire … nope it still does show in tablet mode with the + and the -.

However if you come into the FooTable you can see it shows the entire table with all of the fields no + or – icon on the left and it shows all your data. So as you can see the FooTable Module is still work in progress but the possibilities with this module are endless.

So let’s go ahead and contribute back if you can and let’s make this module even better and then we can go ahead and use it on a lot of cool Drupal responsive websites. So if you’re curious to get into responsive a little more, definitely check out the FooTable Module, it’s going to be really cool module to set a few little … its use that needs to be worked out.

Thanks again to buildamodule.com for sponsoring this episode of the Daily Dose of Drupal and thank you for watching, we’ll see you next time.

Tags: DrupalContribViewsDrupal 7Layout ToolsDrupal PlanetUI/DesignResponsive Design

Drupal 7 Menu admin per menu

Mar 12, 2013

Description:

Episode Number: 126

The Drupal 7 Menu Admin Per Menu module is a simple module that allows you to grant permissions for users to administer specific Drupal menus based on their role. This module for instance would allow you to allow one role to modify the Main menu, while not allowing the role to modify a separate menu on your Drupal 7 website.

In this episode you will learn:

How to allow a specific role to administer the user menu on a Drupal site without giving them access to modify the Main menu Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 126 and we’re going to be going over the Menu Admin Per Menu Module. And this is a module that probably isn’t going to be used on many of your Drupal sites but if you have complex needs with how you want to control access to various parts of your administration of your Drupal site especially in this case the Menus that specific users are going to have access to, this module can help.

Now I’ll explain how we can use that here in just a second but before we get started; as always I am Shane Thomas, you can follow me on Twitter at smthomas3 and make sure to go to codekarate.com and check out the other videos and posts and sign up for the newsletter.

Today’s sponsor is buildamodule.com. Go ahead and check out buildamodule.com if you haven’t already, there’s over 850 Drupal video tutorials and I recently hired two developers for my development company and I bought them subscriptions to buildamodule.com to get them started on learning Drupal.

So go ahead and check it out yourself, there’s a bunch of free videos to get you started to see if you like how the videos are presented and I highly recommend you try it and I think you’re going to like it. Let’s go ahead and get started; so the Menu Admin Per Menu Module basically it’s going to allow us to control access to various menus on our site.

So let’s say for instance we have a pretty complex site and we have different users we want to be able to administer different sections of the site. Let’s say for instance we want a user to be able to administer the navigation section on our site but not necessarily the main menu. We can go ahead and use this Menu Admin Per Menu Module to go ahead and make that happen so I’m going to go over to the Modules page and you can see I already have the Menu Admin Per Menu Module installed, it’s a 7.x-1.0 version.

So I’m going to go ahead and click on the Permissions because it’s a permissions based module so there’s not a lot of configuration here and if you scroll down; typically if you want a user to be able to administer menus and menu items you would simply select this checkbox right here and obviously you’ll probably have multiple roles not just authenticated users but in this case I’m just going to use the authenticated user role as an example but you can of course add other roles through your Drupal website.

You’ll notice that the Menu Admin Per Menu Module has added a bunch more permissions here. Some for the development menu, the main menu, the management menu, the navigation menu and the user menu. So let’s say for instance we want to give the Navigation Menu and User Menu administration abilities to the authenticated users of this website.

I can go ahead and select this boxes, scroll down and save it and now another thing I’m going to want to do is come into my Management Menu and I’m going to go ahead and move this menu section out of the administration section and up above just so it’s easier for authenticated users to find, I’m going to go ahead and save that and I’m also going to make sure I add this Management Menu block to the sidebar over here on the left just so I can get to the links and then we’ll go ahead and notice that now the Management Menus over here I’m going to go ahead and logout and login as just a regular authenticated user, you’ll notice that I don’t have the administration menu on the top but I do have this link here to administer the menu.

You’ll notice that I only have access to two menus. I can go ahead and list the links for the menu and add links. So for instance in this navigation menu I can view the different links that are going to be here which I only see one link, I can of course add another, you can do the same for the user men.

So you can see there’s the My Account in the logout link, if I wanted to add another link and I’m going to go ahead and just go to Node 2 as an example and give it a wait so it shows up in the bottom, then we’ll save this. Now you’ll notice that me as an authenticated user I was able to add a menu item to this link but I wasn’t able to add menu items or manage menu items for any of the other menus that I don’t have access to.

So as you can see it’s a really simple module but it really allows you to find grain control over who can access what menus can be useful as I said on very large Drupal sites in which you have a large user based and you have multiple administrators managing the site.

A lot of times you don’t want to give full administration permission to every user so you can use this module to configure which users and which roles have access to change which menus. So that’s it on this episode of the Daily Dose of Drupal, go ahead and thank buildamodule.com and check out the videos on buildamodule.com and thank you for watching the daily dose of Drupal, I’ll see you next time.

Tags: DrupalMenu SystemContribDrupal 7Drupal PlanetSite Administration

Drupal 7 Flippy Module

Mar 11, 2013

Description:

Episode Number: 125

The Drupal 7 Flippy module is a really simple module that makes it easy to flip through content on your Drupal 7 website based on the content type. For example, the Drupal Flippy module can be used to page between articles or blog posts.

In this episode you will learn:

How to download and configure the Drupal 7 Flippy module

Thanks to Drupalize.me for sponsoring this episode of the Daily Dose of Drupal.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 125. Today we’re going to be going over the Flippy Module. The Flippy Module is just a really simple module that allows you to page between specific types of content on your site so you can use it for articles or blog posts and it basically allows you to have a pager that allows you to flip through your various posts on your site.

So if you want a blog and you want to easily allow users to flip to the next blog post or the previous blog post on your Drupal website this module can help.

But before we get started as always I’m Shane Thomas, you can follow me on Twitter at smthomas3, you can also go to codekarate.com and sign up for the newsletter over here on the left and if you haven’t already check out drupalize.me. They’re today’s sponsor and they have a whole bunch of Drupal and jQuery related videos, a bunch of them are free so go ahead and check them out and if you do decide to sign up use the coupon code CK20FEB and you have a 20% off.

Let’s go ahead and get started; this one is going to be nice and quick just because it’s a very simple module but as you can see I have the 7.x-1.0 version of the Flippy Module installed. There’s not a lot of configuration for this module, you simply go into the content type that you want to enable this for and it is based on content types so you can use it flip through different types of contents.

It’s only one specific content type so I’ll go ahead and I’ll select Article in this case and you’ll see there’s an option for Flippy Settings in your content type settings. You go ahead and click that and select that you want to build the pager and you have a few more options you can select.

The first is to add semantic previous and next links to the document had and I’ll show you what that does here in a second. You can select the different type of pager, you can have it displayed the node title, the node ID or you can use custom text, we’ll go through each of these options really quickly, I’ll leave custom text and I’ll have the links say Previous and Next, you can also have it show first and last links.

I’ll leave at the defaults after that and I’ll save it and I’ll go down and find an article piece of content, I’ll select this one right here. As you can see there’s previous and next links, if I click on the previous one it brings me to the previous page or previous piece on content and it allows me to easily flip through all the various content or in this case all articles on this Drupal site.

So as you can see now that I have flipped through quite a few we’re going to go ahead and look at some of the other options with the Flippy Module. So I’ll go ahead and I will come back to article and I’m just going to change it to show first and last links and we’ll leave it saying first and last and I’ll save this, I will come back here, you can see now there’s first link and the last link so go ahead and go to the first link, you can see it brings me to a relatively lower node ID so you can tell it’s one of the first ones and you can see once I’m on the first link there was no next and last and if one on the last link there’s no … there’s only the first and the previous.

So as you can see it’s just like a pager. Once you get to the end of the beginning you can only go one direction but it works really easily. Let’s go ahead and take a look at some of the other options here; let’s go ahead and change it to node title and we won’t show the first and last links anymore and we’ll also add this semantic Previous and Next links.

So I’ll go ahead and save that, as you can see now it tells me the node titles and I can flip through them so I can see the node title. Node ID was very similar except it gives you the node ID instead of the node title. What the semantic links that were added to the header … I’ll show you what those are, if I look into the head tag here you can see there’s a link for next and link for previous and it just lists the actual H ref or the location of that link so it adds those links the head tags.

And as I mentioned before; this can be used on any content types so if you want it to flip through a few pages you simply come into page or the basic page content type and you can add it for that. Also one thing to note if you want the actual pager to be in a different location on your content type.

It’s listed just like any other field so you come into your content type, you can come into manage display and you can change the location so I’m going to go ahead move the pager all the way to the top, save that and you’ll notice now I have my pager up top.

So that’s the Flippy Module, extremely easy but if you’re building a blog site or a site that you’re going to have a lot of articles on and you want users to be able to easily flip forward and backward through various posts on your Drupal 7 website go ahead and give the Flippy Module a try, let me know what you think, thanks again to druplaize.me and thank you for watching the Daily Dose of Drupal, we’ll see you next time.

Tags: DrupalPagersContribDrupal 7Drupal Planet

Drupal 7 RobotsTxt Module

Mar 10, 2013

Description:

Episode Number: 124

The Drupal 7 RobotsTxt module makes it easy to control your Drupal site's robots.txt file from the Drupal admin. This is especially useful for multisite Drupal installations in which a different robots.txt file is needed on each site.

In this module you will learn:

How to install and configure the robots.txt file on a Drupal multisite installation

Thanks to Drupalize.me for sponsoring this episode of the Daily Dose of Drupal.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 123. We’re going to be going overt the RobotsTxt Module. The RobotsTxt Module is useful if you’re running a multiple or multi-sites from a single Drupal core code based and basically if you need to have a different Robots.txt file for each site this is the module that you’re going to want to use.

If you’re not familiar with what a Robo.txt module is it’s basically a way for you to tell search engine such as Google, Bing and others not to index specific pages on your site. So essentially if you have some pages on your site you do not want the search engines to know about or to index and to be searchable and you can add those to your Robots.txt file and they will be then not indexed by those various search engines that follow the Robots.txt standard.

Before we get started; as always I’m Shane Thomas, you can follow me on Twitter at smthomas3, you can find me on Google + and you can also sign up for the codekarate.com newsletter. Today’s episode is sponsored by druplalize.me. Drupalize.me is one of the best ways to learn things about Drupal. They have tons of cool videos; you can simply click Browse, search through all their free videos and see if you can find ones that you like.

You can also then of course become a member and you can learn a whole bunch more. If you do decide to become a member use the coupon code CK20FEB, you get 20% off and you let them know that I sent them their way or I sent you their way actually. Let’s go ahead and get started; so I installed the Robots.txt module on two test sites I have here in a multi-site; test3.codekarate.com and test4.codekarate.com.

So as you can see it’s installed on both sites. One thing you need to do when you’re using this module is you need to come into your Drupal core installation and you need to either delete or rename this original Robots.txt file and this is so the web server doesn’t grab this or grab the actual Robots.txt and instead will go to your Drupal site and use or actually look up the information that you’re going to enter from the database.

So I’m just going to call this Robotsold.txt and now we’re going to simply come in and configure the Robots.txt on both sites. So as you can see it’s a pretty standard or this is the standard one that just comes out of the box with Drupal. Just to show that this one is going to take effect I’m going to change the crawl delay to 20 on this one, I’m going to save this.

This is on the test 3 site, on the test 4 site I’m going to come in and go ahead and say just as an example this allow / and this should disallow search engines from indexing the entire site. Now if I simply go to the Robot.txt page on both of these sites you can see the one on test 3, the Robots.txt page has the crawl delay still at 10 so I have to look at … well I think it updated but you can see it’s a normal Robots.txt file, however here all of the other disallow statements have been removed and it just disallow with a /, there we go, crawl delay has been updated now.

I just had to save it again and really that’s all there is to it. If you need to change your Robots.txt file on multiple sites inside a Drupal multi-site installation simply use the Robots.txt file or rename your original robots.txt file or remove it and then install this on every site in the multi-site and then you’ll have full control through the Drupal’s web UI or the Admin UI to control exactly how you want your Robts.txt file to function.

So if you have specific pages you can simply add them inside your Robots.txt file at the bottom pages you might want to disallow. Let’s say you had some page for some reason you don’t want Google to find or you don’t want Bing to find or index, you don’t want people to be able to search for it you simply add a disallow statement at the bottom, save it and it’ll only be applied to this site.

Of course if you come back and you would rename or drop in the old Robots.txt file that we renamed at the beginning then when you went to this page you would get that file instead of the configured robots.txt file that we’ve set up on the web UIs.

So it’s important to make sure you rename or remove that file. That’s all there is today, thanks for watching the Daily Dose of Drupal, thanks to Drupalize.me for sponsoring this episode and we’ll see you next time.

Tags: DrupalContribDrupal 7Drupal PlanetSEO

Drupal 7 Cloud Zoom Module

Mar 8, 2013

Description:

Episode Number: 123

The Drupal 7 Cloud Zoom module makes it easy to zoom in on a Drupal image. The Cloud Zoom module creates an image display formatter that can be used for various types of images including image galleries, product images, and more.

In this episode you will learn:

How to use the Cloud Zoom display formatter on a content type image How to use the Cloud Zoom display formatter to create a simple image gallery Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 123 and today we’re going to be going over the Cloud Zoom Module. The Cloud Zoom Module is a simple way to allow you to zoom in an image as you hover over it.

This is often use on various product websites or E-Commerce websites who actually zoom in on a product image but it doesn’t have to be used just on product websites or E-Commerce sites so we’ll go ahead and show you a simple way to get this installed on any Drupal 7 website. But before we get started as always I’m Shane Thomas, you can follow me on Twitter at smthomas3, you can also go to codekarate.com and sign up for the newsletter.

Today’s episode is sponsored by drupalize.me. Check out drupalize.me, learn more about Drupal and J Query by checking out some of their free videos and if you like what you see go ahead and sign up and if you do use the coupon code CK20FEB, you get 20% off. Let’s go ahead and get started; I followed the instructions on the Cloud Zoom project page so I actually downloaded the Drupal 7 module, I then used the Drush command right here and that downloaded the library.

If you do not have Drush you can click this link to get the zip folder and extract that in your site to all libraries cloud-zoom library and that’s all you really need to do to get started so let’s go ahead and take a look and you’ll see that we have the 7.x-1.1 version of Cloud Zoom or at the Cloud Zoom Module installed and I basically have an article content type here and I change the image field on this article content type to allow multiple images to be uploaded so you can see I uploaded 4 images on this piece of content.

So if you scroll down you can see that right now we have just 4 very large images. In order to make this the new Cloud Zoom formatter we’re going to come into our content types for article and go to Manage Display and for the image we change the format from the default of image to Cloud Zoom.

Once you do that you’re going to see you have a whole bunch of options here so you click on this little gear icon and you can start selecting how you want the Cloud Zoom Module to work.

The first if what you want the actual slide image or the image that you’re going to hover over to zoom in, what image styles you’re going to use. I’m going to select medium and I’ve actually adjusted this image style which you can of course adjust your image styles by going to Configuration Media Image Styles, you can add your own or adjust the ones that area already there.

Once they zoom in I’m going to leave the Zoom area as No Formatter so that way it should zoom in as much as possible. You can also select to use a Gallery Mode and this is going to work well with multiple images so it’s going to allow you to show the small thumbnails underneath the main image and we want to of course do that because we have multiple images and I’m going to select thumbnail as the Thumbnail Image Style.
You can select or change the Zoom area; you can also select and change the Zoom Style. So there’s a couple of different options to change how it looks and how it works and where it’s positioned at. I’m going to leave all those at the default and go ahead and click Update and save.

Now if I come back here you can see I have a smaller image, I have little thumbnails below and you can see as I hover over I’m able to zoom in on various parts of the image using the Cloud Zoom J Query plug-in. So that’s all there really all there is to it. As you can see it makes it really easy to create images or create simple galleries where users can actually zoom in on the image and zoom in on specific parts of the image using the Cloud Zoom Module.

Go ahead and give this module a try, like I said before it’s really good on E-Commerce sites for users to be able to zoom in to products and see the various product images but also can work on other types of sites where you want to display a smaller version of the image and then allow them to zoom in and see a little bit higher resolution of that specific spot in the image. Thanks again to drupalize.me for sponsoring this episode of the Daily Dose of Drupal and thank you for watching, we’ll see you next time.

Tags: DrupalContribDrupal 7Image HandlingDrupal Planet

Drupal 6 Displaying a block multiple times on the same page or in different regions

Mar 6, 2013

Description:

There are some times in Drupal 6 where you push the limits of what the blocks interface can do. If you need to display the same block, multiple times on the same page, you will start to see these limitations. An example of where this is useful is a Newsletter signup form. Sometimes a client may want a newsletter signup form to be in the footer of every page, but also displayed more prominently on the contact form page.

Type: TextTags: DrupalCore ConceptsBlocksDrupal 6Module DevelopmentDrupal PlanetTips and Tricks

Drupal 7 Block Class Module

Mar 6, 2013

Description:

Episode Number: 122

The Drupal 7 Block Class module provides an easy way to add a CSS class to a Drupal block.

In this episode you will learn:

How to use the Block Class module to add a CSS class to a Drupal 7 block Cases that having a CSS class on your Drupal block might be useful

Thanks to Drupalize.me for sponsoring this episode of the Daily Dose of Drupal.

Full Text: 

Hello there everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 122 and we’re going to be covering the Block Class Module. Quite simply the Block Class Module is an easy way to add a specific CSS Class to a block and there’s many useful uses for this module and I’ll go over those in just a second but before we get started as always I’m Shane Thomas, you can follow me on Twitter at smthomas3, find me on Google + and go over to codekarate.com and sign up for the newsletter if you haven’t already.

Today’s episode is sponsored by drupalize.me. You can go to drupalize.me and learn all about the Drupal J Query and a whole bunch of other cool topics. They have free videos and they’re pretty awesome so go ahead and check them out and use the coupon code CK20FEB you get 20% off.

Let’s go ahead and get started; so I have the Block Class Module already downloaded and installed on this test Drupal site, you can see there’s no configuration options because it’s pretty simple module.

Let’s say for instance I want to add a specific class to this specific block; well I can go ahead and see there’s already some classes here, there is a unique idea as well that I could use but let’s go ahead and configure this block; we’re just going to give it a class called My Menu, and I’ll save this and now if I look here you can right in here that there’s a now a My Menu Class and you might be wondering why adding a Block or a specific class could be useful to a block but let’s assume that you want to style these menus the same way.

You could of course add a similar class to both and have some of your CSS Code applied to both of these different menus without having to create two different sections in your CSS code.

The other thing that you can do that’s very useful is I’m going to go ahead and create a new block so I’m just going to create a custom block and this would be useful for some of you who use a lot of the blocks administration pages and build a lot of your pages using blocks if you’re not using display suite or panels or something else for your site, I’ll call this … give it a class of My Block and I’m going to move the My Custom Block to the first side bar and save this. Now you can see that there’s a My Custom Block down here.

If I look at it it has My Class and My Block but you’ll notice that the idea on this is block-block-1. Well if you … depending on how you set it up, if you have two sites and you’re pushing content back and forth from a site and you want to set up the same block on both sites and have your CSS Code apply well it may end up with a different id depending on how the site has been set up or how your blocks have been configured. If for instance you added a block on one site and you added the same block on another site but in a different order it could have a different ID which means your CSS Code that’s based on this specific block may no longer work.

This is where it would be handy to have a unique Block Class or CSS Class you can add to your block so in this case I added my block … my –block, if I add that on both sites I know for a fact that it’s going to of course be able to use the same CSS Code without having to worry and that’s just one edu case.

There’s a lot of other cases where you can use Block Class or the Block Class Module. It really depends on how you or how your workflow as with Drupal if you’re … make heavy use of Blocks and you want to make sure that you can either reuse some of your styles throughout blocks on your site or you want to be able to make sure you can give some of them unique classes if you custom create some of your blocks just to make sure that style is going to apply if you have like a development staging site then give the Block Class Module a try and let me know how it goes.

If you have any questions you can always contact me on Twitter or on codekarate.com, thanks again to drupalize.me for making this possible and thank you for watching the Daily Dose of Drupal, see you next time.

Tags: DrupalBlocksContribDrupal 7Drupal PlanetCSS

Drupal 7 ShURLy Module

Mar 4, 2013

Description:

Episode Number: 121

The Drupal 7 ShURLy module provides a simple way to build your own URL shortening service on a Drupal 7 website. The ShURLy module provides an easy way to shorten URLs, manage the URL after it is shortened, and track the clicks of that URL. The Drupal 7 module also provides an easy way to expose the newly created URL shortening service to the rest of the world with an easy to implement web service.

In this episode you will learn:

How to use the Drupal ShURLy module to create shortened URLs Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 121 and today we’re going to be going over the Shurly Module and if you ever used a URL Shortening servers like Bitley or any of those other tiny URL Shortening services then you may or you probably already understand what the Shurly Module does.

Basically it allows you to implement your own URL shortening services just by installing a Drupal Module. So it’s relatively easy to set up and get started but before we do; as always I’m Shane Thomas, you can follow me on Twitter at smthomas3, you can also go to codekarate.com and sign up for the newsletter here on the left. Today’s sponsor is drupalize.me.

Drupalize.me is one of the best places to lean about Drupal and J Query, they provide tons of useful videos, some of them are free so go ahead and browse their videos and if you do decide to sign up which I highly recommend, use the coupon code CK20FEB and you’ll get 20% off. So let’s go ahead and get started; I already have the Shurly Module downloaded and installed on the Drupal site.

So if I do a quick search you can see it comes with two modules Shurly and Shurly Service and I’ll show you what the difference is and what each one does here in a second. Make sure you configure the permissions correctly. I’m not going to worry about that in this case but you can set permissions, it’s pretty flexible.

I’m just going to go ahead and click the Configure options so you can see what options you have. Basically it lists all the roles on your site and you can limit how many requests each role can actually place. So since I already have administrators as the only role that can create short URLs, only administrators are shown here but if you allowed anonymous users or authenticated user’s you’d have other options and you can limit how many they can actually submit in a specific period of time and that’s just to make sure you don’t have anyone abusing your URL Shortening Service.

So the first thing I’m going to do is I’m going to do is I’m going to go ahead and click Create URL. So I’ll go ahead and go to drupalize.me and find a video here, I’ll just select the first video and you can see it’s a relatively long URL so I’m going to copy this URL here and I’m going to come back to our test Drupal site and keep in mind My URL isn’t exactly short here test4.codekarate.com but this can be whatever you needed to be so if you if you owned a shorter domain you can of course make use of this and it will make a lot more sense.

So I’m going to drop in the entire URL, I can specify my own URL here if I want or I just click Shrink and it will create one for me. I can copy this over here and I’ll go ahead and paste it in. You can see its only three extra characters on the end of my full domain here and I click Enter and of course it redirects me directly to the site.
So as you can see really easy to get started, really easy to use, all you need to do to get this functionality is turn on this Shurly Module and you can click the Create URL page which is just at /shurly and you can start creating your own URLs.

The other thing to notice here is there’s a My URLs page. Each user has their own URL’s page and this is just a view so it’s just using the Drupal Views Module but it tracks how many clicks have actually been created or actually had been click through. So if I go here and do this again and I come back it knows enough that it doesn’t count duplicate clicks but what it does is it just tracks how many people have click on this links so if you create this shortened link and send it out through Facebook posts or Twitter it will go ahead and track how many people have actually click on that link and used it to redirect to wherever the long URL is that you’re trying to redirect to.

It also list the date when it was last used so let’s go ahead and grab another one here. I’m just going to grab a Code Karate video and I’ll drop this is and this is Code Karate video Episode 120 so I’m going to create my own URL, it’s going to shrink it and I can copy it, paste it in. You can see it might whatever URL I want which is CK120, I hit Enter and it will of course brings me to the Code Karate page. Come back to MY URL and of course you can see both of them are listed, I can get rid of the ones I no longer want to redirect.

There’s also a short URLs page which lists as you can see a couple of other URLs that have been here in the past that are now deactivated but it just list all the URL’s in the site, allows you to filter it. This is again just another View so you can keep in mind how this module makes use of the Views Module to create its administrative interface and the other interfaces that it uses.

Now we’re actually going to take a look at what this other module that comes with what it allows you to do. This is where it gets really cool if you wanted to build your own completely functional URL Shortening Service. So there’s a Shurly Service Module which is turned on and I’m going to go ahead and open up the readme files. This first readme file is just a readme file for the entire or the main Shurly module and you can go ahead and read this over.

It’s similar to what’s on the drupal.org page so there’s not much new there but if I go ahead open up the module there’s a Shurly_service directory and there’s a readme.txt file so if you open that up it tells you how you can use basically a web service to go ahead and create the actual short URLs from either using API call getting Jason back or a text format, xml, you can get a PHP serialized array back.

So there’s a whole bunch of different ways that you can go ahead and automatically create URLs. So can build this into some other website that you’re building to automatically shorten that can be built into a Twitter Tool, something like that. Basically use your imagination to find a lot of ways you can use this so I’m going to go ahead and show you how it works.

I’m going to take this example here and I will come up here and paste it in, I’m going to of course have to change this to test4.codekarate.com, it’s going to be /shurly/apishorten.

The long URL I will go ahead and grab another Daily Dose of Drupal video and I will drip this into the long URL portion. Now if I hit enter you can see it returns a Jason String. Jason string says it was successful which is true, there’s no errors. He was the long URL that you submitted and now here’s the new short URL.

You can see that the slashes are … they have a trailing or leading backslash to escape the slashes but it gives you the URL that you could then use that Jason to use them in whatever program you’re writing. You can of course change the format just by adding this little format indicator at the end of it. So if I want a text format simply add this ampersand format = text and now I just get the actual URL in plain text format, if I go to it it will of course redirect me to the page or the long URL that I was saving.

You can also change this to XML format, PHP format. It mentions how you can use API keys simply by going to this URL here and it will give you the API key that you can then use. So as you can see it’s an extremely flexible way and extremely simple way to build out a fully functional URL Shortening Service similar to Bitley or Tiny URL or any of those other URL shortening services that are out there.

It’s a drop in module, you simply drop it in, turn it on, do a tiny bit of configuration if necessary and you have yourself a working URL shortener. This can be used as a complete service as I’ve shown here or it can be used on top of other modules on your Drupal site if you wanted this to be just a portion of it.

Its main focus is or main purpose is to actually be a complete service so your main sites, the whole goal is just via URL shortener but like I said it can work both ways, go ahead and give it a try and let me know what you think. Thanks again to drupalize.me for sponsoring this episode of the Daily Dose of Drupal.

If you’d like to become a sponsor simply go to the codekarate.com, click on the Daily Dose of Drupal and click on the Code Karate sponsorship link here, gives you a lot of information and you can go ahead and contact me through there. Thank you for watching the Daily Dose of Drupal and I will see you next time.

Tags: DrupalContribDrupal 7

Drupal 7 Views Data Export Module

Mar 4, 2013

Description:

Episode Number: 120

The Views Data Export Module provides an easy way to export your views data in many different formats (CSV, XLS, DOC, TXT, XML, etc).

In this episode you will learn:

How to export Drupal 7 views data as a CSV file How to export Drupal 7 views data as an XLS file How the Drupal views page display is handled independently of what is actually exported in the Views data export Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 120 and today we’re going to be going over the Vies Data Export Module. The Views Data Export Module is a module that will allow you to export large amounts of data sets or data from your Views.

You can export them in CSV files, Microsoft Excel, Microsoft Doc, Text or XML and this is useful if you want to provide either yourself or users of your Drupal website the ability to export data from your various content types or anything that can be displayed using views.

Before we get started; as always I’m Shane Thomas, you can follow me on Twitter at smthomas3, you can also go to codekarate.com and sign up for the newsletter. As always or at least it has been recently … drupalize.me is today’s sponsor. If you haven’t check them out yet lease do so because they provide some great Drupal training videos along with J Query training and they have all different types of topics, a bunch of free videos so go ahead and give them a look and use CK20FEB as the coupon code and you get 20% off.

Let’s go ahead and get started; so I have the module already downloaded and installed on this test Drupal site, as you can see Views Data Export, I’m using the 7.x-3.O.Beta 6 version and it’s really pretty simple to get started. So I have a bunch of just added in default random content here using the Duval Generate Module so I have a bunch of articles.

I’m going to go ahead and create a View and we’re going to allow exporting of this view into a CSV in a Microsoft Excel format just so we can take a look at how that looks and how that works. So I’m going to create a new View, we’ll call this one Export Example and I’m going to show content of type article, we’ll allow it to create a page so we’ll go continue and edit and I’m going to select just to show fields here just to build out the very basic views so you can see if you have a view that you start with what you can then do.

I will go ahead and show it in a table format just to make it easier, there’s a title field, we’ll add the body field as well as the author UID and the path, the post and the NID just so we have some data that we can export. I’ll go ahead and leave … we’ll trim the body that keep it relatively small but you won’t have to of course, I’ll leave the rest of the stuff at the default and that should at least give us a starting point.

As you can see if you look down here you can see that the data is being dropped in to a table format, I’m going to give this a label so the title label will now show up down below and now you have your simple view that’s just a table format view, displays a title, the author user ID, a trimmed section of the body based on the number of characters, node ID, path and post-date.

So the goal is to allow users or yourself to export this data. Go ahead and save this and the next step is going to be adding a new display onto the this View and as you can see there’s a data export display that you can add onto this view so we’re going to go ahead and click that.

As soon as we do that you’ll see that it comes up with a new display, it has various formatting options so you can select CSV file, Doc, Text, XLS or XML. We’ll leave it at the CSV file for now, you can select Settings so you can have it set as a file or you can have it set as a feed. We’ll go ahead and say we want to provide it as a file, select the separator. A whole bunch of different options that you can look at, different character and codings, you can make use the first row as a header so you can look through those various options there and you can give this a path.

I’ll go ahead and say export example CSV, you can also attach it to the actual page. You want to make sure you attach it so you can actually see the link. You can select whether or not this should be batched and what this does is if you have a large amount of data you may want to go ahead and select to batch this and this is going to … instead of trying to download the entire chunk of data or all of the rows at one time it will export all of it into a CSV file and in this case it’s going to batch it up into various segments so it’s going to make it less memory intensive and it’s just going to be better especially for larger data sets.

For this case I’m not going to use a batch because it’s not over a thousand rows, it’s relatively small like 300 so we should be fine but just keep in mind that’s an important setting especially if you’re exporting large amounts of data. So I’m going to go ahead and save this and I will click here to view the page, you can see the data is here and you’ll also notice this link at the bottom.

So this is what this Views Display that we added for Data Export does; it adds this little icon here, I click this and you’ll notice that it download this CSV file, I click to open it and depending on what type of spreadsheet software or how you generally open your CSV files on your system it’s going to open it up. As you can see it’s exported the data, you’ll notice it’s only showing me 10 items even though I have much more than 10 items.

So what I will be able to do here is if I come back into this view I can simply edit the view, come into the Data Export and … well actually we’ll come into the page instead of a page here and we can go ahead and select 0 here so it’s going to show all the items, we’ll save that and well come back and view the page. Now you can see it’s a much longer page, I open up the CSV, actually need to set the pager on that display. So it actually separates out the two displays so the Page Display is not necessarily going to be exactly the same as the Export Display.

So you can display set number of items on the first … the actual page but you can actually export a different number of items. So here’s where I can actually select what shows up in the Data Export versus the page show up how much it actually going to display when you’re viewing the page. So right now I set this to show all on the page but the data export is still set to 10 items. Just keep in mind that these can be set independently of each other.

Now as soon as I change this to 0 I can go ahead and re-export and it is going to export all the rows that I have in the database rather than just the first 10. So now when I open this up I will see much more than 10, as you can see there’s about 300 or so in there. So we’re going to go ahead and just show how you can export in one more formats and then you should be able to take the idea and run with it and use it to export any different type of data that you may need.

So I’m going to add another Data Export Display, again if you need to change a number of items you can set that to 0 to show all items, you can also select this item or this second options here to just display all items, either way will work, we’re going to change this to in XLS file so this would be an Excel format, you can provide it as a file if you want or as a feed instead of file for download.

Now we can go ahead and save this, actually I have to make sure I have to give it a path first of course so we’re going to give it a Views Export XLS, make sure we attached it to our page, save it and we should be able to come back to the main page and see another icon down at the bottom. So now you can see I can export this either a CSV or an XLS file, I can add as many different data export views display onto this views I need to so I can have a text file or a doc or an xml and I can of course just click it and export to a file so I have an easy way to download the data that’s being displayed in the view.

Keep in mind that even in the columns don’t have to necessarily have to be identicals. So if I wanted add an additional column to one of these exports I can do that and it will show up in the export but doesn’t necessarily have to show up in the View. So if for instance in this xls I also wanted to add whether or not it was published, I will actually … let me remove that for a second, I will make sure I override so it’s only going to be adding it to this display and now I’ll find the Publish option again.

So as you can see on this Display Only there’s a Publish option on the page, if I click on page there is no Publish option so I’ll save this, come back to the View itself. You’ll notice there is no Publish column however if I come down to the bottom and export to xls and open this up you’ll notice that there is a Publish column. So just keep in mind as we ran into the first case with the pagers everything is independent of each other because there’s just different Views display so what you display on the page doesn’t necessarily have to be identical in the number of columns or the number of rows displayed when you actually export the data using one of the various data export formats.

So really it’s pretty simple, it’s very easy way to export your data off your Drupal site using Views so go ahead and try it out, I’m sure you can find many uses for it on your Drupal sites. Thanks again to drupalize.me for sponsoring this episode of the Daily Dose of Drupal and thanks for watching, we’ll see you next time.

Tags: DrupalContribViewsDrupal 7Drupal Planet

Drupal 7 Special Menu Items

Mar 3, 2013

Description:

Episode Number: 119

The Drupal 7 Special Menu Items module allows the adding of placeholder and separator menu items.

In this episode you will learn:

How to use the Special Menu Items module to create a placeholder menu item How to use the Special Menu Items module to create a separator menu item

Thanks to Drupalize.me for sponsoring this episode of the Daily Dose of Drupal.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 119 and we’re going to be going over the Special Menu Items Module. The Special Menu Items Module is a simple module that allows you to add non-standard menu items inside your Drupal 7 site.

Non-standard menu items could be something like a separator such as a horizontal rule or a couple of dashes, it can also something like a container which isn’t really a link but allows you to have items inside of that container that are links. Before we get started; as always I’m Shane Thomas, you can follow me on Twitter at smthomas3, find me on Google + and go to codekarate.com and sign up for the newsletter.

Today’s sponsor is drupalize.me. If you haven’t not check them out yet you really need to do so. They have a few bunch of free videos, they have a whole bunch of really great topics on learning Drupal and J Query so whether you’re just getting started or whether you want to learn some pretty advance topics go ahead and give them a chance and to take a look if you haven’t already.

If you do take a look and decide to sign up and become a member use CK20FEB to get 20% off. Let’s go ahead and get started; so I have a simple Drupal site here, as you can see the main menu displayed over here, it’s also displayed at the top but you’ll see in a minute that we’re probably not going to want to keep these links up top.

There’s just three menu links right now which is linking of to three different pages and then of course the homepage and I have the Special Menu Items Module already installed so we’ll take a look; as you can see I’m using the 7.x-2.0 version, you can click configure here and you can use the HTML tag that you want to go around, anything you specify is a no link which can ought to be used as Container Menu Items and you can also have an HTML tag do a round the Separator tag which is just a separator between different menu items, you can also select what kind of value to be displayed as a separator so right now it’s using a horizontal value, you can also … if you wanted to add a bunch of dashes, whatever you wanted to do there. Let’s go ahead and start adding some of these items; so as you can see here’s what it looks like now as far as our Menu Items are concerned.

I’m going to start out by adding a container to put this bottom to links in. So I come into my Menus, I’m going to go into my main menu and click List Links and I’m going to add a new link. If you look just on the surface it doesn’t look like anything’s changed, everything else looks pretty much the same. However if you read the description here you’ll see that you can enter No Link to generate a Non-linkable Item or a Separator to generate a separator item.

This is similar to being able to use the Front Tag to go to the homepage. So I’m going to go ahead and create a link title and I’ll just call it “Our Story”. If this is a simple business site it might be appropriate and I’m going to do a no link path here choosing Open Tag No Link then close it off and this is going to create an item that doesn’t actually have a link so we can use this as container.

I’m just going to go ahead and save this and now I’m going to drag these two items inside of this No Link Menu Item that I created and let’s take a look at this. As you see it doesn’t start expended so we want to make sure that we can actually get to the items or see the items that are inside this container.

So we’re going to go ahead and come back to our menu, go to Main Menu and we’re going to edit this and click Show as Expanded. Now when we come back you can see that it’s expanded, I can’t click this because it’s not a link but it does allow these container items to be linked so I can get to any items inside here but I can’t click on the Our Story and this allows you to theme this container as a little bit separate entity or separate item … Menu Item than this Sub-Item so you can theme it where you have a nice looking menu with a nice container wrapper kind of sitting outside of your main menu items.

We’re going to go ahead and add a separator as well so you can see how that’s going to look. This gives it a title, it doesn’t matter what the title is and we’re going to use this separator tag, I’m going to go ahead and save this. I’m going to put the separator right underneath the home link.

You’ll see initially it doesn’t look very clean especially with these list items but a lot times you’re not going to have this list items on your menu so if you want to go ahead and get rid of those list items I’m just going to show you how you could go about doing it and I’m going to go ahead and go into one of these LI’s, find this UL menu LI, I’m just going to overwrite this here, List Style Image Non and I’m also going to add List Style of Non. Now you can see that it looks quite a bit better.

The Separator actually looks like it fits in and of course you can change that to whatever you want and you can theme that to be any type of separator you want if you wanted to use specific image you could load that in there. If you use a different tag it comes with a unique class of separator so of course you can do what you need to using CSS to make that separator look however you want and of course you can do the same thing with the Container which is the class of No Link.

So using that you can theme this or style these differently and make them really stand out. That’s really all there is to the Special Menu Items Module, it’s really simple and it just serves one simple purpose but it can be very useful for building out dynamic menus where you need more than just a standard Menu Item.

As you can see up here in a Horizontal Menu it doesn’t necessarily work as well in this case but if you have a Vertical Menu like this you can build some pretty cool looking menus with this module. So go ahead and give this module a try, let me know what you think either in the comments on code karate or on YouTube.
Thanks again to drupalize.me for sponsoring this episode of the Daily Dose of Drupal and thank you for watching, we’ll see you next time.

Tags: DrupalMenu SystemContribDrupal 7Drupal PlanetUI/Design

Drupal 7 Installation Profiles

Mar 2, 2013

Description:

Episode Number: 118

You may have heard of a Drupal installation profile but are not sure what a Drupal installation profile is or how you can write your own Drupal installation profile. This video will walk you through Drupal 7 installation profile basics, and also show you some examples of how installation profiles are developed. This episode is meant to be a getting started guide for those developers or site builders that want to get a basic grasp on Drupal installation profiles and how they can be used to build flexible and dynamic Drupal distributions.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on episode number 118. And today we’re going to be going over the basics of an Installation Profile. What is an Installation Profile? How do you use it and how do you write one of your own if you need to? Before we get started; as always I am Shane Thomas, you can follow me on Twitter at smthomas3, you can also go to codekarate.com and sign up for the newsletter over here on the left.

Today’s episode is sponsored by drupalize.me. If you’re looking to learn more about Drupal you need to check out drupalize.me. They have tons of videos from the very basics to some of the most advance Drupal topics you’ll ever need to learn about. Go ahead and check them out, use the coupon code CK20FEB for 20 % off.

Let’s go ahead and get started; so what exactly is a Drupal Installation Profile? Well I pulled up a drupal.org site right here, its node 306267 and it talks about how to use an installation profile, it also talks about what is an installation profile. I’m not going to go over every piece that it says here but I’m just going to give a quick summary. Basically every Drupal site that you built it has an installation profile that’s selected when you installed the site.

Each site only has one installation profile, it’s selected when the site is originally installed so if you already have a site that’s up and running well it has the installation profile that it has. So whatever you selected when you install to the Installation Profile that it comes with or that is currently using there’s really no way to change an installation profile easily, you could of course if you want to get to the database and do some other things but for the most part, once you have installed the site it has an installation profile I already built into it.

All installation profile is it seems really complicated; all it is is just for the most part is a collection of modules your Drupal website is going to be installed with. You can also do things during an Installation Profile when this site is being installed such as install various or set up various blocks installed or add various content to other set up tasks so that once the system or the site is done building or installing it has a pre-package and content and block settings and all this types of stocks.

So first thing to realize is it’s not all that complicated, there’s really installation profiles at its core are very simple, just a way to basically package up a reusable modules and configuration and themes and reuse them on a new fresh installation. So examples of different distributions on Drupal if you go to drupal.org/project/distributions you can see a bunch of examples.

Commerce Kick Start if the first one up here. Basically the quickest way to get up and running with Drupal Commerce so it basically out of the box if you install this installation profile before you install you’re Drupal site and you select Commerce Kick Start as the installation profile. It’s going to give you a whole bunch of Drupal Commerce related modules, a whole bunch of setups so out of the box when you start … you almost have a completely working Drupal Commerce store for selling products online. Open Publish is another one, it’s more of a distribution for online news industries, Open Public is for government and public policy organizations, Drupal Commerce or commence is for community based websites.

And so all these things are as you can see there are pre-package set that comes with Drupal core plus it comes with the setup modules and themes and configuration for making this specific type sites. Just saves you from having to download all the modules manually, install them, add content or configurations, you know, download the themes so it’s really a simple way to get up and running. There’s another page on drupal.org for how to write a Drupal 7 Installation Profile. Installation Profiles are similar to modules, there’s an info file, a .install file and a .profile file.

So this is node 1022020 on drupal.org and it talks all about how to write a Drupal Installation Profile. Let’s go ahead and take a look at some Installation Profiles that come with Drupal 7. The first thing I’m going to do is I’m going to show you that this is just a basic Drupal 7 site, it has the site’s directory, you can go to the site’s All Folder and download Modules Themes but the important thing is there’s this Profiles Directory.

Inside this Profiles Directory there are currently four installation profiles. Three of this that come with standard Drupal; minimal, standard and testing. Commerce Kick Start is one that I’ve downloaded and dropped in here so we can look at that as well. So the first one we’re going to look at is the Minimal Installation Profile. Minimal Installation Profile simply installs a smaller amount of modules than the standard and has a little bit less setup.

So if you can get started without having all the extra Drupal Core modules installed so let’s go ahead and take a look; this is the minimal .info file so here’s the info file of this Installation Profile, this is one that comes with core as I mentioned before and it says it starts with only few modules enabled.

The few modules are Dependent or Block and DB Log, so those dependencies, those are automatically going to be enabled when you select this installation profile when you go through the process of installing this Drupal site. If we go into the minimal.install file you’ll see it implements hook_install and this is use to enable some of the standard blocks.

So you can see it gets the default theme, it enables some of the different blocks here, the content block, the main content block, the login block navigation and management block for the Help section and so this is simply just dropping blocks in when you select this Installation Profiles so when you start you have a couple of blocks already dropped into the default regions in the Bartik Theme.

And then in the minimal.profile there’s really not much here, the only thing is this one line which you’ll see in a lot of profile or .profile modules, it’s just a simple line that sets the site name with whatever the server name is so it doesn’t start with a blank site name.

So you’ll notice if I go to the standard profile it’s exactly the same besides the fact that it’s using standard because that’s the name of the profile instead of minimal. We can look at the standard .info file, you can see there’s much more dependencies here. This means any modules in this list are going to get turned on when you install a standard profile Drupal 7 site so you can see there’s things like I already have in the toolbar and the overlay where on the minimal.info you’ll notice there is just not as many modules there. If we take a look at this standard.install you can tell that there’s much more here that goes on when you install a standard Drupal 7 installation profile or Drupal 7 site with the standard installation profile, still goes through hook install and it adds some text formats, you can see it enables some standard blocks, it creates your basic node types so if you use standard profile you’ll get page and an article content type out of the box and the reason I’m going through this is if you’re writing your own installation profile some of the stuff that is in the standard installation profile or minimal installation profile can be basically drop into your own installation profile and just reuse and modified based on your needs so you don’t really have to rewrite the wheel and at the end here I’m going to show you a couple tools that you can use if you want to build your own in a little bit simpler way.

So the last one we’re going to take a look at and what you’ll notice that so far all these are pretty similar … just a standard one and it has a few more options of course so we’re going to take a look at Commerce Kick Start which is not a core installation profile but it’s one that you can download on drupal.org. You’ll see here there’s a lot more files inside here, there’s a Themes folder, Script folder, Modules folder and a Libraries folder.

So also these .make files which I’m probably going to be covering tomorrow how to write .make file to download your different modules and themes for your installation profile or your platform but you’ll notice that there’s still a .profile and there’s still a .install and a .info. I’m going to open those up and I want to come back in and I want to cover up what some of these other things are as well. So I’ll open these three files and you’ll notice the commerce kick start.info you can see this info file is much larger. A lot of the distributions in drupal.org are going to have larger info files because they have to install a lot more modules, a lot more themes when the sites are actually built or installed.

So as you can see they install the core modules first then they install commerce dependencies so these are modules that Drupal Commerce needs to run then installs all the various commerce modules so all these are dependencies, various commerce services, other contributed modules, features, migrates, search API and other distribution related modules for Commerce Kick Start. So as you can see that list is much larger, the Install file is also much larger.

We’re not going to go through all of it because as you can see almost a thousand lines on of code but it is similar to any of these other install file except for the fact the it does a lot more when you install a Commerce Kick Start site. It has to because it sets up almost a completely functioning Drupal Commerce store.

So you can take a look at that, it’s relatively well documented and commented so you can read the comments and find out what it’s doing, you can also look at this .profile for Commerce Kick Start. Here it implements default image style, also has a Hook Form Alter similar to the other ones but it sets more values, it does a hook system info alter and just a bunch more of other things. Hook Update Projects Alter, Hook Update … you can look all these up on drupal.org and see what they’re doing.

Like I said this is well documented, you can follow along and find out what this .profile is actually doing once it’s installed make sure to read on how to write Drupal 7 installation profile as that talks to what can go inside an install file and what can go on the .profile file. Before we stop here today I’m also going to cover … inside the .info file for Commerce Kick Start there’s a lot of dependencies that aren’t in standard Drupal and you might be wondering how is it going to install the Rules module if the Rules module isn’t in my sites All Modules directory or how is it going to install the Views Module.

Well inside this Distribution or Installation Profile there’s a Module and Themes Directory. Inside this Themes you can see there’s a Commerce Kick Start Theme, Omega Kick Start and Shinny, all these are just various themes and once you get inside the modules you’ll see there’s contributed modules such as your Views and your Rules. And so Drupal knows since you’re using this installation profile to look here for modules and themes.

So any themes that you need can be dropped into your Installation Profile and you can use dependencies from these themes or modules to install when you actually are installing a Drupal Site so for instance Cloud Zoom is an option in here which means I can add a dependency to my .info file for Cloud Zoom meaning that when I install this Drupal 7 site Cloud Zoom is going to be enabled if it’s in that dependencies list.
One important thing to note when you’re building a .info file for installation profile make sure to … if there are any dependencies that come first such as Rules or Views in the case of Commerce Kick Start you want those to show up above the modules that depend on the.

So Rules is an example, it shows up before a lot of the commerce modules that’s going to require rules. Just something to keep in mind there and the last thing we’re going to cover real quick before we finish up is on druapl.org there’s project/profiler, it’s this profiler project it’s actually not a module, it’s just a library for writing installation profiles, you can take a look at some of the links here and learn about what this does.
There’s also a Profile Builder which is an extension of the Profiler Installation Profile Simplifier and it creates downloadable package that gives you well-made installation profile and just make file based on the site it’s installed on. So you basically, it sounds you can turn this on, you’re able to download basically a pre-built installation profile based on your Drupal site so if you already have a Drupal site built and you want to deploy other sites like it or you want other people to be able to build sites like yours, you can use tool and it’ll help you get started, I don’t know all the ins and outs of it, I haven’t used it, I always build mine manually but this is a tool here for you to use and take a look at and see if it helps you out.

So that’s all we’re going to talk about today on learning more about Drupal Installation profiles. As I said before there’s nothing really complicated about them. Some of them look a little intimidating when you look at how many lines of codes there but if you think about it in a simplest form it’s just a way for you as a user to install the Drupal 7 site and get a set of modules, themes and other types of configuration right out of the box so instead of getting standard Drupal you’re getting setup for a Drupal Commerce site with a bunch of bells and whistles with modules and themes already there or you’re getting a system for publishers in the case of Open Publish.

So go ahead and look at these other distributions on Drupal, there’s 573 listed here, you maybe be able to find some that you can use in the future for future Drupal sites rather than starting from scratch and use those to get a jump start on your Drupal development. Thanks again to drupalize.me for sponsoring this episode and thank you for watching the Daily Dose of Drupal. Well see you next time.

Tags: DrupalCore ConceptsInstallation ProfilesDrupal Planet

Drupal 7 jQuery SelectBox Module

Feb 28, 2013

Description:

Episode Number: 117

The Drupal 7 jQuery SelectBox module is a simple module that makes HTML select boxes easier to style. It replaces the HTML form select element with easier to style HTML markup.

In this episode you will learn:

How to download and install the jQuery SelectBox module What the jQuery SelectBox module is doing in the background to make the select boxes on the site continue to work correctly

Thanks to Drupalize.me for sponsoring this episode.

Full Text: 

Hello everyone and welcome to another Daily Dose Drupal, today we’re on Episode Number 117. Today we’re going to be going over the J Querry Select Box Module. The J Query Select Box Module basically replaces your standard select box in Drupal with a more stylable, more themeable, more CSSable select box and actually replaces the select box with some HTML that you can then easily change the style to and then of course it communicates back when you click something in this new HTML structure it selects that iem in the actual select list. It uses the plug-in that you’ll need to select the jQuery Select Box plug-in so you’ll have to go ahead and download that, you can see the installation instructions, you need the libraries module.

In the Sites All Libraries directory you’re going to need to create a directory called J Query.Select Box and you’re going to need to download the plug-in from Get Hub and then of course install the plug-in and enable the J Query Select Box Module.
So go ahead and follow those steps and once you’re there we can go ahead and get started but before we do, as always I am Shane Thomas, you can follow me on Twitter at smthomas3, you can also go to codekarate.com check out the other Daily Dose of Drupal videos and sign up for the newsletter. Today’s episode is sponsored by drupalize.me.

Drupalize.me is one of the best places to learn about Drupal so whether you’re just getting started or if you’ve been around awhile, check out their videos on Drupal, they have free videos and if you do want to sign up use the coupon code CK20FEB you get 20% off. Let’s go ahead and get started; so I have the module downloaded in the library where the J Query Select Box library dropped in as well so I’m going to come down here and turn on the J Query Select Box Module, click Save and … but before I do I’m actually going to disable it first to show you a little bit of before and after.

So I’ll go ahead and I’ll go to this Add Content and I have the Select Test Content Type with two different types to select list; a Multiple Select and a Single Select. If you look at the HTML structure it’s pretty much what you should expect, just a simple HTML element with option values, the Multiple Select is also very similar. Now let’s go ahead and turn the module and see what happens. Now the module is turned on I will come back to this page, you can see immediately it looks a little bit different so let’s take a look at the HTML Structure now.

You can see if I hover over this it says it’s a Span, it’s inside of a link and if I click on it you can see each one of these are just a link inside of that Span, well actually it’s its own link UL with allies, list items inside of that and it uses a class of selected. So what you can do here since it’s just a normal HTML list you can theme it or style it however you want and it will look the way that you wanted to.

It takes away the normal restrictions on theming and styling at traditional select box, you can also look at the multiple select as well that that is also just a list. One thing to keep in mind is you’ll notice that there’s a Select option right here and you’ll see right here it says Display None. It’s actually being hidden and you’re selections here correspond with the selections on the actual element so this over here that you’re actually clicking on is just a copy but when you make those selections it of course makes those selections on the hidden element which is the traditional select box, does the same for the single select up here.

So that’s how the Select Box Module works, it makes it easy for you to theme and style your Select Boxes however you want so it gets rid of a lot of the normal limitations so go ahead and give this module a try on your next Drupal website where you need to theme or style your Select Boxes. Thanks again to drupalize.me and the thank you for watching the Daily Dose of Drupal. See you next time.

Tags: DrupalFieldsContribDrupal 7Drupal PlanetUI/DesignJavascriptJQuery

Drupal 7 Views Autocomplete Filter

Feb 26, 2013

Description:

Episode Number: 116

The Drupal 7 Views Autocomplete Filters module adds the ability to create Views exposed filters that are autocompletes. This is useful to replace the traditional text field exposed filter or even a drop down exposed filter.

In this episode you will learn:

How to create a simple Drupal view with an Autocomplete exposed filter How to create a more complex Drupal view using an Entity Reference field with an Autocomplete exposed filter Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 116 and today we’re going to be going over the Views Autocomplete Filters Module. This module basically adds autocomplete functionality to Views Filters so Views View Filters before and you’ve used the text field where maybe you could search for a node title or something like that, this just takes that and adds it so it’s an autocomplete and it allows you to more easily search the content in your View.

But before we get started; as always I’m Shane Thomas, you can follow me on Twitter at smthomas3, also go to codekarate.com and sign up for the newsletter. Thanks again to drupalize.me for sponsoring this episode of the Daily Dose of Drupal, check them out if you haven’t already because there are great resource for anyone who’s trying to learn Drupal.

They have some very basic concepts on getting started with Drupal and they have some of the most complex topics you will ever need to cover if you’re a Drupal developer so give them a look and use CK20FEB if you do decide to sign up and become a member.

They have a bunch of free videos too so check those out. Let’s go ahead and get started; let’s hop over to our test site here and I’ve already downloaded the Views Autocomplete Filters Module so let’s go ahead and turn that on. Once we get that turned on we’re going to go ahead and create a View. I’m going to create two different Views on this example so you can see two different used cases for where this might be useful.

The first View … I’m going to show you first my content types, I have a client content type and a contact content type. The Client Content Type is just a really simple content type with a title I believe and maybe a body field and the Contact Content Type has and Entity Reference Field and if you’re not familiar with Entity Reference Field there is a Daily Dose of Drupal video on how that works and I think that’s where I actually build out these content types.

So I’m going to create two different Views that showed these different types of content and you’ll see that how this works and how each client can have multiple contacts assigned to it so you may have a company that has three contacts or three different people in it, you can set it up that way so let’s go ahead and start by creating a simple View, we’re going to call this Clients and I want to put autocomplete because I may have one other one that’s already called Clients and we’re going to show contents of type Client, we’ll go ahead and create a page and we’ll go ahead and hit Continue and Edit. Well let’s actually make it … we’ll just leave everything at its default to keep it simple.

The only thing we want to do though is instead of showing content we want to show fields just because that’s a little bit easier to show how this works so we’re just going to show the title and we’ll go ahead and add the body, I don’t know that I have anything and any of these but we’ll see.

So it’s just a title and the body of these Client Content Types so as you can see here there’s another clients … another test client ABC and if we want to format this a little better just to make it a little more readable we’ll go ahead and make it a table format, you can of course set this format to whatever you want.

Now you can see here’s the title over here, here’s the body with the text, we’ll give the title a label and call it Client Name to again just make it a little more readable and obviously I only have four here but just imagine that there’s a bunch more, you could have hundreds. What we're going to do now is we’re going to add a filter and we want this filter to eventually be an autocomplete.

So typically; what you do if you wanted to allow people to search by the actual client name is you have to first realize that the client name is simply just a Title Field so I’m going to select Content Title, I’m going to hit apply to all displays and I’m going to exposed this filter to visitors which will allow them to change it. Here I can change the operator and since I want to be able to search for any part of the word I’m going to use Contains. You can of course use different ones here such as Starts With or Ends With or contains any words, contains all words.

I’m just going to use contains because that means I can put any string of text that appears in sequence in the title and it will show up. So this is in general how it works. Here’s the Use Autocomplete checkbox but this isn’t there unless you’ve installed the Views Autocomplete Filter Module. We’re going to go ahead and do or click Apply All Displays and we’re not going to check that quite yet.

So when we scroll down and you see now we have an exposed filter here so if I start typing in the word Client and I hit Apply it gets rid of any of that don’t have that exact string. So you can see that that works. Now I’m going to come back and actually check this Use Autocomplete Checkbox. You can select the maximum number of items in the Autocomplete, select the Field to use for the Autocomplete results so we of course want the client name and then you can have unformatted dropdowns and unformatted suggestions, so we’ll hit Apply All Displays, I’m going to save this and actually go to the page so we can see it in action.

So now you can see that it looks like a little circle here for the Autocomplete and now if I start typing it in you can see that Test Client comes up because that’s the only one that matches, simple click on that and click Apply and it will of course filter just by that. If I want to search for another one you can search another new client and click Apply and it will of course filter that based on that as well.

So as you can see it can be useful especially if the list is very long but its usefulness is somewhat limited because searching by just a string inside of this client name would probably be sufficient. However; what if we wanted to display a list of all the contacts and their corresponding clients? So we want to have a listing of the contacts and the clients but we want it to be able to filter to be able to see all the contacts for a specific client.

So I’m going to go ahead and create a new view; I’m going to call this one Contacts Autocomplete and I’m going to show content of type contact and I’m going to use a table again of fields, we’ll go ahead and show as many as we need here, it says an example, go ahead and get started. Right now we have the title which is the title of the contact, we’re also going to add in the contact phone number and we’ll go ahead and take a look at this down here so you can see here’s the title or the contacts, the contact phone number.

I’m going to change the label here and call this Contact Name, what we also want to do though is we want to display the client that this contact is a part of. So Contact B and Contact A maybe one client in these contact’s may be part of the different client and this is all based up that Entity Reference Field.

So what I’m going to do is I’m going to come into advance and I’m going to add a Relationship and I’m going to find a field that each contact node has a content type that links out to the client. So I’m going to use this Entity Reference so this is going to bridge to the content entity so that means it’s going to bridge to the client that is referenced via the field_client which is on the content … actual content type. So that might be a little confusing but just follow along here and hopefully it will make sense here in a second so go ahead and we can require this because I need that to be there. Now this represents the Client Node.

So each one of these contacts is going to be referenced out to the actual client, so I want to also display the title of the client as well. So I’m going to go in and I’m going to find the content title but I’m not going to display the content title of the actual contact, I want to display the content title of the client so this I select the relationship here Content Entity Reference from Field Client and I change this to client name and I’ll go ahead and hit Apply.

Now this should give me the client name that’s associated with the Contacts. So as you can see ABC Co. has three different contacts, another new client has one contact and another client without a new has two contacts here. So what we want to be able to do though is we want to be able to actually select in an exposed filter the client so we can see all these contacts that are available for that client.

So the first thing I would generally do is I’m going to go ahead and save this and I’m going to open up in a new tab, I’m going to open up the contact content type, come into manage fields and inside this entity reference field there’s a checkbox down here for render the Views filter as the select list. This is generally the first thing I would do because it’s the easiest one to search to and it’s the easiest one to find and I’ll show what this does first.

So now I’m going to add a filter, I’m going to filter on this field client … let me go ahead and find it in here, so this field client … and this is just to show you how you could render it as a dropdown so this is the first where were going to do it and we’re going to go ahead and expose this filter, we’ll go ahead and select this as clients, say as one of … we don’t need to worry about relationship in this circumstance so we click apply and if you’re just doing it this way you don’t actually need this relationship here.

So if you just wanted to display a dropdown you wouldn’t need that relationship and as you can see it works. I can select ABC Co., click Apply, it only shows me this three from ABC Co. Now that works great if you want to do it that way but what if you had 300 clients and 10,000 contacts? At that point this dropdown isn’t going to become very manageable which is why I’ve added this relationship and why I’m going to show you another way you can do this.

So I’m going to go ahead and get rid of this exposed filter so now it’s back to the normal view. Now I’m going to add the Autocomplete in so I need to make sure I add the autocomplete again for the title because I’m searching the title of this client content type so I go ahead and select the title and in this case I do want to use the relationship because this is referencing the actual client content and I want to expose the filter, here I want to change this to contains and I also will use autocomplete.

The important thing here is you want to select the field with the autocomplete results; you need to select this reference field for the client name. Now we click Apply, I’m going to save this and we’ll view the page and now I actually like to change this to say Client Name and not Title but I can search for a specific client name. For instance we’ll search for another client, I select another client, click Apply, it show me only the contacts for another client.

So ideally you’d come back in here and you’d change this to say client name and everything would be good to go and you have a nice view where you’re not only using the Views Autocomplete Filters Module but you’re also using it with the Entity Reference Module with some relationships so it allows you to … in this case I feel like it’s a much more useful way to use this Autocomplete because if you had thousands of clients to look through this is actually going to be able to pull it up for you, allow you to search through this list much more easily than if you just had a dropdown or you just had a text field.

So go ahead and give it a try in your next Drupal project where you need to build out some pretty complex views and you want to use this autocomplete module against the Views Autocomplete Filters Module, it’s a pretty cool module.

Thanks again to drupalize.me for sponsoring this episode. If you’d like to sponsor an episode of the Daily Dose of Drupal go ahead and go to codekarate.com, click on the code karate sponsorship page and find out some more information. Thank you for watching the Daily Dose of Drupal and we’ll see you next time.

Tags: DrupalContribViewsDrupal 7Ajax

Drupal 7 Smart Crop module

Feb 24, 2013

Description:

Episode Number: 115

The Drupal 7 Smart Crop module is a Drupal module that provides an Image Style action that provides more intelligent image cropping.

In this episode you will learn:

How to create a new Drupal image style that uses the SmartCrop action How to create a new Drupal image style that uses the Scale and SmartCrop action

Episode sponsored by Drupalize.me

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 115. Today we’re going to be going over the Smart Crop Module; Smart Crop Module is basically just an image cache or image style action that allow you to do some pretty cool cropping.

It basically looks at the image a little bit and the Crops are based on entropy which as you can see here it says it’s producing a more pleasing result. There are some examples here if you click on this link of what the Smart Crop Module does compared to original images and some of the other image cache actions like scaling crop.
So as you can see some of these images just look a little different when you’re using Smart Crop versus the Image Cache’s Scaling Crop such as this vehicle right here as one of the good ones I think where it know that this image or the vehicle ending image is more important so it crops based on that image and senders that instead of cutting off the images… the Image Cache Scaling Crop does.

So just another Image Cache or Image Style Action that does a pretty good job of cropping images so we’re going to go ahead and get started but before we do; as always I’m Shane Thomas, go ahead and follow me on Twitter at smthomas3 and check me out on codekarate.com and sign up for the newsletter on the left and I want to thank today’s sponsor which is drupalize.me.

It’s one of the best places to learn about Drupal, you can browse a whole bunch of videos, they have free videos as well so go ahead and give those a look and if you like what you see, sign up and use the coupon code CK20FEB. Let’s go ahead and get started; I have a test site here and I’ve turned on the Scaling Crop Module, downloaded it and it is enabled … or Smart Crop I guess, I don’t know why I said Scaling Crop but as you can see its 7.x-1.0-beta 2.

So I have that installed and you can see I have two articles here with images. Right now let’s go ahead and see what image style it is using, I believe it’s using the Medium Image Style. If i come into Article and go to Manage Display and go to the teaser you’ll see that the image is being displayed with an image style of Medium. We’re going to go ahead and create our own image style and use this Smart Crop action. So I come into Configuration Media Image Styles, you can see the three Image Styles I currently have, I’m going to add a new one called Smart Crop. So I’ll click Create New Style and now I have to select which effect I want to do.

As you can see here it shows the original and it show the Smart Crop Image, I’m going to go ahead and click Smart Crop and click Add and you can see there’s also a scale and then Smart Crop as well so you can try that and we’ll show both options here. I’m going to set it to 250 x 250 and I’ll click Add Effect and we’re going to go ahead and close out of this, come into our Content Type Article Display Teaser and change this image style to our new Smart Crop.

Now if I save this and come back you can see it crops the image based on the exact size that I wanted which is 250x250. You can see it definitely cuts off a lot of the image but that’s because it’s a relatively big image and I’m not doing any type of scaling first.
So what we’re going to do is we’re going to create another image style; just come in here to Image Styles under Configuration Media Image Style and we’re going to add a new one. I’m going to call this Scaling Smart Crop and I’ll go ahead and click Scaling Smart Crop here and I’ll click Add and I’ll do the same thing, I’ll set at 250x250, I will not allow up scaling, I’ll go ahead and add this effect, now I come back into my content type manage display for the teaser and change my image style to use my scaling smart crop image style that I just created.

Now if I come back out here you can see it scales it a little bit differently and crops a little differently based on what is showing in the image. So that’s how to use the Scale or use the Smart Crop Module to scale and go ahead and more intelligently crop your pictures. Sometimes you can see you really get results, sometimes it’s not exact but it is often as you can see in this examples it’s often better than just using the Base Image Cache Scaling Crop with a center cropping that comes with the image styles in Drupal 7.

So go ahead and give it a try and see what you think of it. You might have to try it a couple of different images and see your results and see if it ends up being something that you like and you want to use to scaling crop images automatically on your Drupal 7 website. Let me know how it goes and if you like the module, also check out drupalize.me again, thank them for helping support code karate and thank you for watching the Daily Dose of Drupal, we will see you next time. See you!

Tags: DrupalContribDrupal 7Image HandlingDrupal Planet

Drupal 7 Views Calc Module

Feb 23, 2013

Description:

Episode Number: 114

The Drupal 7 Views Calc module provides an easy way to do calculations on the numeric data that is displayed within a Drupal 7 View.

In this episode you will learn:

How to create a Drupal 7 Views Calc view How to use Views Calc to perform calculations such as SUM and AVG on a Drupal 7 field within a View

Thanks to Drupalize.me for sponsoring this episode of the Daily Dose of Drupal.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 114 and we’re going to be going over the Views Calc Module. The views Calc Module allows you to easily use sums, averages, counts, mins or maxs within a View.

Basically it allows you to get a lot of nice calculations about that data that is actually being displayed inside a Views Table so as you can see in this example it allows counting, summing and maxing of the various data that’s shown in this view. But before we get started; as always I’m Shane Thomas, you can follow me on Twitter at smthomas3, you can also go to codekarate.com and sign up for the newsletter.
If you haven’t checked out drupalize.me please do so. Drupalize.me is one of the best ways to learn about Drupal. You can simply come here to browse, see some of the newest videos and you’ll notice that not only do they have a huge selection of videos.
They have a lot of videos here for free so go ahead and go to drupalize.me and start learning more about Drupal. If you do decide to sign up you can use the coupon code CK20FEB and you get 20% off and they know that I sent you over there. Let’s go ahead and get started; so I have a test site here and I already have the Views Calc Module installed so I’ll go ahead and show that.

As you can see down here the Views Calc Module has been installed. I’m using 7.x-1.0 and the Views Calc Module really has two major features that you can use it for. I’m only going to go over one of those today; the first is that you can create custom fields that can be used inside … the actual inside of your View as just another field.

I’m not going to go over that because there’s not really a lot of uses that I’ve seen for that, there can be a few but it’s not as important as being able to actually do the other types of calculations. You can change the settings for allowable functions in operators; you can also export and import your Views Calc fields so you can move it across other websites.

So if you need to move from one Drupal site to another you can easily reuse your Views Calc custom fields. What I’m going to do is I’m actually going to create a new View called Time Entry but before I do that I’m going to show you my content type that I created. I created a content type called Time Entry which if I go to the manage fields you’ll see it’s very simple. It has a title, it has a date value using the date module and it has a decimal value for time log to … think of it as a simple way for people or just simple way to display logged time and just says uses and example so we can show you how this View could work.

So I’ll create my View called Time Entry, I’m going to show content of type Time Entry and I’m going to create a page here called Time Entry. The display format … this is the important part here; I need to select the Views Calc Table, you can select how many items I’m going to display, I’ll go ahead and display all of them and now I click continue and edit.

The first thing I’m going to do is add my fields. Remember I have a date field which I’m going to add and I also have a Time Log field so I’ll add that field as well and click apply All Displays, I’ll go ahead and keep both of these at the defaults. I’m also going to go ahead and remove this title field because it’s not really necessary for this example.
As you can see if I scroll down I have the date and the time log showing up here in the preview. What I really want to do is I want to see the actual sum of this time so I simply click on the settings here; as you can see it was right on the Views Calc table format, click settings and you can actually display the calculation for this time log field. I can do things like sum, count, average, minimum.

I’m going to go ahead and do sum and average to show a couple examples and I click Apply All Displays and it automatically adds those sections to the bottom. So here it sums up the value of all these fields and also shows me my average.

So that’s really all there is to Views Calc, it’s a pretty simple module if you just want to display minimums, maximums, counts, sums or averages in basically like a total section on the bottom of your Views Table. We’ll go ahead and look at the full page just to see how it looks, I need to go ahead and make sure I save my View of course and as you can see it gives you the nice little table with the dates and the time log.

You can do a whole bunch of things like add, expose filters here so you can select different date ranges and it’ll change the actual sum and average time based on the exposed filters value so it’s really flexible, really useful if you’re doing or displaying data that has numeric values that you may need to do calculations on. So go ahead and give Views Calc a try and the next project you need to perform these types of calculations and we want to thank drupalize.me again for sponsoring this episode of the Daily Dose of Drupal.

If you’d like to become a sponsor go ahead and go to codekarate.com and click on the code karate sponsorship page and learn more. I want to thank you for watching the Daily Dose of Drupal and we’ll see you next time.

Tags: DrupalContribViewsDrupal 7Drupal Planet

Drupal 7 Module Development - JavaScript confirm part 3

Feb 21, 2013

Description:

Episode Number: 113

In the last two episodes, we covered building a basic Drupal 7 module that displayed a JavaScript confirmation before a user leaves a specific page. In this episode we continue where we left off and add the ability to display the JavaScript confirm form on specific content type node edit pages.

In this episode you will learn:

How to add a checkbox field on the administration form that displays all the content types on your Drupal site How to verify you are on the node edit page of a specific content type Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 113 and we’re going to go ahead and round out the module that we’ve been developing in the last two episodes so if you want to check out episode number 111 and 112 it can get you up to this point or you can just hop over to 112 and download the zip folder with the module in it if you want to get started.

Before we get started though I’m Shane Thomas, you can follow me on Twitter at smthomas3, also head over to codekarate.com and sign up for the newsletter if you haven’t already, you can also find me on Google + and thanks again to today’s sponsor drupalize.me.

If you want to learn Drupal check out drupalize.me. It has tons of videos on Drupal from the basics to the most advance topics, also has videos on J Query and a whole bunch of other technology in web related topics so go ahead and give them a look if you haven’t already and if you do, use the coupon code CK20FEB so you can get 20% off and they know that I’m sending you over there.

Let’s go ahead and get started; so if you remember yesterday we left off with our js_confirm module where we could add paths to this text area here and when we added those paths as you can see I’m on the front page, if I try to navigate away it gives us this little Java Script Confirm box and one of the main reasons we’re going to be using this or I would want to use this on the site is for making sure people fill out long forms without accidentally clicking so if you have a form or web form or content type that’s extremely long and you want to make sure that they don’t accidentally click a link when they’re filling it out and maybe they get 70% done and they accidentally click away and they might get a little frustrated so you add a little Java Script just to make sure you can prevent that.

One of the things you’ll notice though, it’s easy to add it to a node add form. For instance I can easily add it to a node add article page just by coming in here and changing this to Node Add Article, now anytime I want to add an article and I start typing in and I want to leave the page it’s going to give me the message but what about when I’m trying to edit an article?

In this case it gets a little more difficult because if you look at the path … go ahead and open this in a new tab here so we can take a look at the path a little more easily, It’s Node 65 Edit, well because I want it to just get this Java Script on the article there’s really no way to do this, I can get it out on all node pages by using node/star/edit but that would be for every content type so that would be for basic page, client contact, any other content type I have in my site.

So I’m going to go ahead and add a little code that’s going to add some additional settings or one additional settings to this administration page and it’s going to allow me to check which node edit pages I want to use the Java Script on. So we’re going to start by hoping into our module here and I’m going to scroll down into this settings form and we’re going to start with that.

So essentially we’re just going to go ahead and add another form element and this time this form element is going to be a list of checkboxes so I’m going to say you can add a new form element and I’m going to call this js_confirm_contenttypeedit and I’m going to say this is of course an array.

The type in this case is going to be checkboxes, we give it a title here and for the title I’m going to use Content Type Edit Forms, you can add a default value and this default value is … this is where the whole old value are going to get pulled in and we want to make sure we use the same text that we use right here.

So the same piece is going to be used right here and we also want to give it a default in case there isn’t currently a variable I’m just going to use an array because it’s multiple checkboxes so there could be multiple values selected, I’m going to give it a description and I’m going to go ahead and just copy in this longer description here that I have. This longer description just says select the content types from the list to display the js_confirm pop up on, the pop-up will be displayed on these content types node edit pages, you need to change this to a double code here and the last section is going to be the actual options that we want to display and here we’re going to use a handy Drupal function called Node Type Get Names.

You see here in the nice little dialog and you can look this up on the api.drupal.org as well but this returns a list of available node type names and the way it works is an array and the key of the array is the actual type … the node type so in this case it’s going to be article with an _a and then the actual value is going to be the nice printed name. So in this case it’s going to give me a list with a key of article page client, these lower case values here and the actual display is going to be this nicer displayed vale right there.

So that should be all we need there, just go ahead and add a semi colon here, save this and we’ll go ahead and come back to our form and now you can see it pulls in all our content types, I can select article and client or whatever other content types I want to click save, the values will be stored of course but the next step is to of course make sure it actually gets displayed or the Java Script gets added on those pages.

So we’re going to come over here and I’m going to add a section down here right below our page match section that we have in this Hook In It function and remember the Hook In It function where this Hook In It hook in Drupal which in this case we use our module name in it runs every time a page is loaded.

Keep in mind this isn’t going to work on cache pages so just keep it in mind it’s not necessarily going to work on cache pages, it’s not going to run every time the page loads so if you have cache pages and you change the settings on your administration page you’ll have to clear the cache and then I believe it still will work after that point but just keep in mind if you have caching Hook In It is a little less reliable because it only runs the first time before the cache is built but the first section here we do the page matching, the second section we’re actually going to do this node edit matching so we’re going to match and see if we’re on a node edit page and if we are we’re going to check to see if we’re on the correct node type.

So in this case we of course only want it on article pages or I think I selected Client Pages and then whet we’re going to do is we’re going to check if it matches either the page match section or the node edit match section. We’re going to go ahead and make sure we add this Java Script that’s listed down below. So I’m just going to start by just setting a variable, I’m going to default it to False.

The reason I’m going to do that is that it just gives me the fallback so if everything goes through and it doesn’t match any of my other conditions it of course doesn’t match that it’s on the correct node edit page. I’m then going to use a function called ARG in Drupal which basically allows you to pull arguments from the URL starting with a zero so in this case the zero is going to match up with … if I’m on a node edit page here the zero is going to pull this node value, 1 would pull the 65 and 2 would pull edit.

So I want to say if the very first argument or the 0 argument in the URL is node and our 2 which is the 3rd argument in the list is Edit which essentially means we’re on a Node Edit page then I want to use a Drupal function called Menu Get Object and this is going to load by default the node object based on the page here on. So if you’re on Node 65 Edit as in the case up here it’s going to get the full node object for Node 65. If also false on the View page in the Node View so node/65 without the edit it’s still going to pull in the information for Node 65.

Each node object has a specific type so in this case we can use the node type to check if it’s in the variable that we of course set in this form field right here. So in this case we select it in Article and Client and when we created this form or when we submitted this form we want to check if this Node Type is either an article or a client type and if so then we’ll say the Node Edit does much so we’re going to go ahead and say if it’s in an array and then we had to select the actual needle or the thing we’re searching for so if the node type of this node which it could be article or it could be anything is in the array that is actually the variable we’re going to be pulling from which in this case if you remember we have this variable is going to pull an array with Article and Client because those are the two values we selected on our administration form then if this all comes through then we’re going to say Node Edit Match is True, we’re going to come down here and change this if statement because we want to add this Java Script if either the page matches which is calculated and checked right here or if this Node Edit matches which is right here.

So if it’s either on the Node Edit page that you selected or it matches one of the pages it’s going to go ahead and add the Java Script code that we wrote in the first two episodes or first two parts of this module. So let’s go ahead and give this a try; assuming everything is created correctly, you can see we of course have two values, Article and Client selected for our content type edit forms I am on the Edit Article Test so I am on an article page, I refresh the page and now if I click away you’ll notice I get the Java Script pop up, if I come into content and try to find a basic page here I will say here a Test Type and I edit this you’ll notice if I click away, nothing happens.

Of course I come back to an article type, try to click away and I guess maybe you actually have to open it up inside a new page. Let me see here; oh there it worked, let me open this up here, edit … okay so this is working, if you go to an article edit page and you try to navigate away the Java Script is going to pop up, if you go to any other page such as a test content type page and a basic page content type page or anything else that’s not selected, the Java Script is not going to work.

There seems to be some slight minor issues with pulling up and giving the Java Script to work inside this administration window here but for the most part it works and it was a really simple module, hopefully you learned something and if you have any questions you let me know. Thanks again to drupalize.me for sponsoring this episode of the Daily Dose of Drupal and thank you for watching and we’ll see you next time.

Series: Module Development - JavaScript ConfirmationTags: DrupalDrupal 7Module DevelopmentDrupal PlanetJavascript

Drupal 7 Module Development - JavaScript confirm part 2

Feb 20, 2013

Description:

Episode Number: 112

In the last episode we covered creating a simple module to display a javascript confirmation popup before leaving a page. In this episode we take that a step further and add a nice administrative interface to the module.

In this episode you will learn:

How to implement hook_menu to add an administrative page to your custom Drupal module How to build a Drupal administrative form Series: Module Development - JavaScript ConfirmationTags: DrupalDrupal 7Module DevelopmentDrupal PlanetJavascript

Drupal 7 Module Development - JavaScript confirm before leaving page

Feb 19, 2013

Description:

Episode Number: 111

Learning module development in Drupal is not easy, but this Daily Dose of Drupal episode provides a very simple but practical module development video tutorial to use when learning about Drupal Module development. If you have a complex form on your Drupal websites, whether it is a Node creation form or perhaps even a webform, you may want to warn users before they navigate away from the page. This can help inform users that if they navigate away from the page before submitting the form, they may lose the contents of the form.

Series: Module Development - JavaScript ConfirmationTags: DrupalDrupal 7Module DevelopmentDrupal PlanetJavascript

Drupal 7 Style Guide Module

Feb 18, 2013

Description:

Episode Number: 110

The Drupal 7 Style Guide module is a very simple module that helps you when building a Drupal theme. The module provides a single page displaying how your Drupal theme renders common Drupal elements, form elements, and other HTML elements. By having all of these elements rendered in one page, it makes it much easier to ensure your theme covers all the basics.

In this episode you will learn:

How the Drupal Style Guide module will help you build better Drupal themes Tags: DrupalContribDrupal 7Theme DevelopmentDrupal PlanetUI/DesignCSS

Drupal 7 Block Up Down Module

Feb 15, 2013

Description:

Episode Number: 109

The Drupal 7 Block Up Down module allows easy management of your blocks from the front end of your site (rather than having to go to the Administer Blocks page).

In this episode you will learn:

What the Block Up Down module is used for How to use the Block Up Down module to re-position or disable blocks on your Drupal site

Thanks to Drupalize.me for sponsoring today's episode.

Tags: DrupalBlocksContribDrupal 7Layout ToolsDrupal PlanetSite Administration

Drupal 7 Coffee Module

Feb 14, 2013

Description:

Episode Number: 108

The Drupal 7 Coffee Module is a handy module that streamlines the administration of a Drupal 7 site by allow a quick search like mechanism for navigating to various administrative screens or for adding new content to your Drupal website.

In this episode you will learn:

How the Drupal Coffee module can speed up your Drupal administration tasks How to use the Drupal Coffee module to navigate around Drupal administration pages Tags: DrupalContribDrupal 7Drupal PlanetSite Administration

Drupal 7 Views Accordion Module

Feb 13, 2013

Description:

Episode Number: 107

The Drupal 7 Views Accordion module allows you to build a Drupal View with results displayed in jQuery accordion tabs.

In this episode you will learn:

How to install and configure the Drupal Views Accordion module How to build a simple Drupal View using the Drupal Views Accordion module How to change the Drupal Views settings to alter how the Views Accordion module works Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 107. Today we’re going to be going over the Views Accordion Module. And the Views Accordion Module basically provides a display plug-in for the Views Module that lets you take advantage of Accordion like features within your view.

So as you can see from a little demo image here you click on each section and it’ll have it expand and collapse based on which section you click. So before we get started; as always I am Shane Thomas, you can follow me on Twitter at smthomas3, also go to codekarate.com and make sure to sign up for the newsletter.

Today’s sponsor is drupalize.me and if you haven’t checked out drupalize.me already please do so. It is one of the very best ways to learn Drupal, they have hundreds and hundreds of videos on learning Drupal from the basics that go over modules like the panels module, they have stuff on Drupal Commerce, they have pretty much anything Drupal related, you can find it in drupalize.me.

So go ahead and check them out and if you do, make sure to use promo code or coupon code CK2FEB and you get 20% off and you let them know that I sent you their way. So let’s go ahead and get started; I have a test site here where I have the Views Accordion Module downloaded and installed, I have a whole bunch of test content that I’ve generated, just a whole bunch of articles and I’m going to create a very simple Views Accordion View to show you how it works and you’ll notice it’s pretty much just like the other Views.

So once you get the hang of it you can pretty much run with it and build any different type of view using the Views Accordion Module that you’d like. So first we’re going to go ahead and show ahead and show that I do have the module installed, it’s 7.x-1.0.RC2 version and we get started by just going to Views Add New View so we’re going to create a new view here, I’ll go ahead and call this accordion and we’re going to show content of type article and we’re going to create a page called Accordion and the display format ... this is the important part here; it’s going to be Views Accordion.

You’re going to make sure you want to select Fields here and you can select as many items as you want on a page, we’ll use a page here and leave the rest at its default. Just make sure you select Fields and the way it works is the Views Accordion Module takes into account two fields. The first field is used if you look at the demo image here as the actual text that you see when you click.

The second field or any other fields that you add after are added into the more of a content section. So I’m going to go ahead and add another field here; we’ll call it Body and to keep things consistent to make everything about the same size I’m actually going to strip the HTML tags from the body and trim to we’ll say 400 characters just to keep things about the same size and I’ll go ahead and add that.

I can also check out the Views Accordion settings, you can see there is an animation effect so you can have a couple of different animation options here instead of just a swing. Auto Height; we’ll use the highest content part for the height so basically it looks for ...and this is why I stripped it out of the HTML tags and looks for the tallest block and tries to set them all to that height making sure it can provide more consistent animations.

You can of course uncheck this, you can have it apply unclick or unmouse over and a couple of different options here such as disabling if there’s only one result filling the space so you can go ahead and try those options out as well, I’m going to leave everything at its default just to show you how it works out of the box, I save this and I click on here to view the page and as you can see I have an Accordion already set up.

You can see there is a page here around the bottom so it’s just like any other view.
However; when I click this on the title it drops in just like an Accordion should. As you can see it’s all set up to be at the same height because I trimmed out the HTML from the fields but I’m going to go ahead and add some additional items so I’ll add for instance ... let’s see here and add a link so you can get the content we’ll also add the post date and we’ll leave it at that for now.

So I’ll add the link and call it View Post, we’ll use the date format to say how much time has passed since it’s been created, I’m going to reorder this to put the link at the bottom, the post date is second on the list so as you can see I got a couple of different fields here and the title is the only one that displays in the top section and the rest is going to display inside the actual Accordion after it expands. So as you can see it tells when it was posted the body and I have a link to view the post but one thing you will notice is if I come back to my view this title field actually right now is said to be a link.

It doesn’t matter if I have this checked or not. Views Accordion will not let you set anything in this area of top as a link because of course it needs that. I’m going to go ahead and change these settings just to show you a couple of different options. I’ll change this to Slide and I’ll change it to Mouse Over just to show what else might be possible. Now when I save this, refreshes, you can see this is a little bit different of an animation as it goes away, it has a nice little bounce to it.

So as you can see that is the Views Accordion Module, if you view the View it’s going to be really familiar. There’s not a lot a lot of differences from other View style plug-ins. Go ahead and give it a try.

There’s a lot of different things you can do with this especially if you need to group things in an Accordion fashion of course. It works according to the drupal.org page, works with groupings and relationships so it’s going to be really familiar to other views type things that you’ve worked in the past so go ahead and give it a try. Thanks again to drupalize.me for sponsoring this episode of the Daily Dose of Drupal and we will back again next time. Thank you for watching.

Tags: DrupalContribViewsDrupal 7Site BuildingDrupal PlanetUI/Design

Drupal 7 HTML5 Application Cache module

Feb 11, 2013

Description:

Episode Number: 106

The Drupal 7 HTML5 Application Cache module allows you to easily implement an HTML5 manifest file and begin caching pages for offline viewing (often called HTML5 AppCache).

In this episode you will learn:

Tags: DrupalContribDrupal 7Drupal PlanetHTML5

Drupal 7 Colorbox module

Feb 8, 2013

Description:

Episode Number: 105

The Drupal 7 Colorbox module is one of the many Drupal modules that allows you to display things in a lightbox style modal dialog window.

In this episode you will learn:

How to use the Drupal Colorbox module to display image fields in a Colorbox window

Thanks again to Drupalize.me for sponsoring this episode of the Daily Dose of Drupal.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 105 and today we’re going to be covering the very basics of the Colorbox Module. Most of you or at least many of you may be familiar with this module already and so I’m not going to spend too much time on it, I’m going to go over just the basics for those of you who haven’t or using some other type of Lightbox plug-in or some other type of Drupal module to handle your model dialog type windows.

And what the Colorbox Module is really good at is displaying images inside basically a Lightbox on your Drupal sites. So one of the main uses I use it for is along with Drupal commerce and displaying product images, it also can be used for slideshow, things like that, I’m going to go over just the basics and how it integrates in with the core image module and we’ll also discuss a little bit how it can be integrated with views and that type of thing. There are other screencast on this that go into more detail.

I haven’t watch them but I’m sure they can at least get you started or continue along the path if you do want to learn more about this module. There’s also some documentation here which talks about installing the module, it’s a little bit more complicated of an install. You have to install the module and the plug-in so you’ll need the libraries module as well if you’re using the Drupal 7 version and you’ll have to install the J Querry plug-in in the site’s all libraries directory.

So before we get started; as always I’m Shane Thomas, you can follow me on Twitter @smthomas3, also go to codekarate.com and sign up for the newsletter if you haven’t already and today we’re getting sponsored by drupaliza.me. You should definitely go to drupalize.me and check it out especially if you’re interested in learning more about Drupal.

Drupalize.me is a whole bunch of really really well put together Drupal videos from the very basics to the very advance type topics so whether you want to learn about scaling Drupal or whether you want to learn how to build the Drupal view. Go ahead and check them out, use the code you see here CK20FEB and you get 20% off in anything you purchase at drupalize.me so go check them out and let them know that you appreciate them sponsoring the Daily Dose of Drupal, I certainly do.

We’re going to go ahead and get started; I already have the Colorbox Module installed and I have the plug-in, the J Query plug-in also installed so we’re pretty much ready to go. You can see there’s some configuration options. Some of these extra features are very handy such as Enable Colorbox Load. This enables you to use custom links to open forms and paths in a Colorbox.

So you simply use Colorbox load as a class on the link and then you put together URL like this and when you click on the link you will then automatically load that inside of a Colorbox. You can also use Colorbox In-line and allow you to open In-line content in a Colorbox; you just use the Colorbox In-line class. So these two are handy especially if you want to go outside the basics of what Colorbox can do and allow it to be more flexible.

There’s a couple of different styles which is nice; you can have different styles right out of the … right after the Fresh Install of the Colorbox Module, you can also add your own and there’s some instructions I believe in the documentation and in the Read Me file on how to create your own Colorbox Style and of course you can do a lot with just CSS as well so you can make some of the changes just to CSS, you can allow Custom Options so it’s very configurable, you can have … change a whole bunch of information about how it’s displayed when you click on something that triggers Colorbox pop-up and there’s some other advance settings such as hiding it on specific pages and what type of compression level.

Obviously if you’re on development you can uncompressed it but on production sites you want to keep that in the minified version. So that’s all the configurations option and another thing you want to check is this is probably before you even started configuring the site. Just make sure that the Colorbox. jQuery plug-in is installed and the Colorbox module recognizes that it’s there because obviously without this plug-in the Colorbox module isn’t going to work correctly.

So while that loads I’m going to go ahead and show you a content type we created in the last video that happens to have… it is used in the Conditional Fields Module but it has an image field and that’s going to be good enough for us to get started. As you can see in the Status report there’s a Colorbox plug-in section, make sure that shows up in green and not in red and you should be good to go. So I created this simple content type which is just a picture.

It says favorite vegetable but if you watch yesterday’s video you’ll understand that I was just demonstrating how to use an image fields with a conditional fields module. Simply an image has been uploaded to this content type but what I want this to be is display perhaps a thumbnail, in one click display the full size image in the Lightbox or at least a much larger image.

This can easily be done using the manage display tab on the content type. Obviously the manage fields tab has the actual image itself, the manage display tab allows you to set the format to Colorbox. Inside the Colorbox settings you can go ahead and say the content image style so we can set it as a thumbnail.

This is how it’s going to originally display as well as the Colorbox image style so I can set this as a medium or a large image or leave that the original, I’ll select Large here. You can say how you would like them to group and group the images into a gallery so it can be per post, per page, per field. So we’ll leave it per post and you can have the caption be All text, Title Text or Automatic.

So I’ll go ahead and set that and now I will refresh this page, you can see we have a nice thumbnail image and when I click it … for some reason it didn’t want to load the Colorbox. Let me flush the caches here, there we go. I just had to clear the cache after I install the module and configure it for the first time. A hard refresh for the page probably will done the trick as well but you’ll notice as I click this it brings up the image, it has a caption, if I hop over it which is just the caption pulled I guess from the of the node. One thing we can try here is in this manage fields for this test content type.

I’m going to allow multiple images to be uploaded here and show you how they can then be group together into a gallery. Number of values I’ll just go ahead and select Unlimited, I’ll just upload a couple. Now when I come back to this content I’ll upload a few more images and I will save this.

Now you can see that they’re show up. They all show up as thumbnails but when I click on it you’ll notice that now I have … it says 1 of 3, I can simple flip through the images and I now have an image gallery. So you can see it’s incredibly easy to just get the Colorbox Module working with the Core Drupal 7 Image Module, works pretty much out of the box so just nice Display Formatter option on the field.

It also works great with views so if you do have a view where you’re displaying an image you can do the same basic settings that you saw on the actual manage display. It’s very similar and of course you’re using the Views interface instead of this but you’ll be able to set a lot of these same options and you’ll be able to configure it so when you have a view that displays an image you can allow that to also show up in the Colorbox.

Go ahead and check out the other documentation on the Colorbox drupal.org page for more information and it also lists modules that have built-in support for Colorbox and a bunch of other cool things so go ahead and check that out. The Colorbox module is just one of many of these types of modules but this is the one that I used the most so go ahead and give it a try if you haven’t already and see which one you like best.

Let me know in the comments or you can find a way to contact me and we can have a discussion about the best Lightbox plug-ins for Drupal. Thanks again to drupalize.me for sponsoring this episode of the Daily Dose of Drupal and thank all of you for watching, see you next time.

Tags: DrupalContribDrupal 7Image HandlingDrupal PlanetUI/DesignModal Forms

Drupal 7 Conditional Fields Module

Feb 7, 2013

Description:

Episode Number: 104

The Drupal 7 Conditional Fields module makes it easy to build dynamic and complex forms with Drupal 7 Fields. Any Drupal entity that has fields can pretty much be built into a dynamic and conditional form. The Conditional Fields module essentially lets you set conditions for how specific fields act based on another dependent field on the form. The simplest example is that this module can hide or show a field based on the value of another field. If you are still confused at what this module can do, watch the video to find out more!

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 104. Today we’re going to be going over the Conditional Fields Module and this is a really cool module that allows you to display or hide various fields based on the values of other fields.

You can do a whole bunch more with it but that’s in essence the basic board it is, we’ll go over it and go a quick example and show you how you can begin using it on your Drupal websites but before we get started I’m Shane Thomas, you can follow me on Twitter @smthomas3, also head over to codekarate.com and sign up for the newsletter and if you haven’t checked out today’s sponsor already please check out drupalize.me and use the coupon code CK20FEB for 2% off anything at drupalize.me.

Drupalize.me is one of the best ways to learn about Drupal, it has very informative Drupal videos from basic concepts all the way to some of the most advance Drupal concepts you’ll need when building your Drupal websites. So go ahead and take a look at them and tell them thanks for sponsoring the Daily Dose of Drupal so we can make these videos happen.

Let’s go ahead and get started; I have the conditional Fields Module already installed on my Drupal website as you can see here. The great thing about the Conditional Fields Module is it’s set up to work with pretty much any entity that you can imagine so it works with comments, nodes, in this case I have the Fields Collection Module Installed, private message, taxonomy term, users, anything that has fields it pretty much works with.

It’s only in a dev state so keep that in mind, it’s not necessarily 100% ironed out so make sure you test thoroughly before using it. It’s not recommended yet to use on production sites but you’ll have to go ahead and try it out for yourself and make that decision. Before we get started on configuring this because there are a lot of configuration options and I’m not going to be able to go through all of them. I’m going to show you the simple content type that I’ve created.

I just call it Test, there’s a couple of different fields in it and it’s all about just favorite foods. So I’ll go ahead and just actually add a test piece of content. It asked for a title, asked for my favorite foods but I want these fields not to necessarily all display so for instance if I select Fruits here I want this field; what are your favorite fruits to show up then I’ll use checkboxes if this other checkboxes checked. I want this other fruit text box text to show up.

I only want this favorite vegetable which is just an image upload field for an example if this vegetable selection is selected otherwise I don’t want to see it and same with this other food text area only if other is selected here. So basically when I get to this form I want to see a title field and these favorite foods and depending on what I select here I want to display other fields dynamically. Like I said this is only one example, you can do a whole bunch with this.

This is an extremely flexible module but once you see the example here hopefully you can figure out different ways that you can use it on your sites. So go ahead and get started and in this overview page it has a basically all the different options that are up here. Because it’s a little bit long I’m going to go ahead and click on just Node which is just going to show this everything in this section.

As you can see a lot of the sections are empty and basically that’s because there aren’t at least two fields so you have to have at least two fields because one field has to be dependent on the other field. Click on node here just to simplify the interface a little bit and I’m going to scroll down to me test content type. The first thing is to add a new dependency and the dependency is always going to be dependent on something else which is the dependee.

So the first one that I’m going to do is I’m going to select … I’ll start at the bottom actually. I want this favorite fruits or I’ll go ahead and say I want other food … so that’s at the bottom, that’s a text area and it’s going to be dependent on this favorite foods filled. And just so we can take a look I’m going to open up the manage fields option so we can take a look.

This other food text area I want dependent on this favorite foods so you can look on the machine names and the labels. And I want the dependent field to be visible when the dependee so that dependent field, this other food to be visible when the dependee has a specific value which is correct so I’m going to ahead and click add and this is just another … this page just rehashes some of what we went over so it’s going to be based on the value and it’s going to be values inserted from the widget and the favorite food we’re going to select is other.

So if others select it we’re going to display that text field, interaction with other dependencies so when this dependent has more than one how should this condition be evaluated? So you can go ahead and use that if it needs to interact with other dependencies. We want it to be visible but you could make it visible, invisible field with a value, disabled, check, there’s a whole bunch of options. It’s not just show and hide.

Show and hide is probably the most common use case but it’s not the only one so you have a bunch of different options of things you can do, different stage you can apply that form field. You can show and hide, fade in, fade out, slide up, slide down. I’m going to go ahead and select slide up, slide down for this first one, you can select the speed.

There’s a couple of other options here; you can activate per user role settings, you can hide the dependent if dependee is not in the form so for some reason I don’t have permission to see this favorite foods box you can force this one to be hidden which is a good real thumb but you can of course control it here and reset the dependent to its default values when the form is submitted if the dependency is not triggered.

So essentially if you want to make sure the value gets reset when the form is submitted if for some reason dependency is no longer triggered you can go ahead and set that. Advance; I’m not going to go over that and there’s a couple of other options here just with the view context settings and I’m not going to go all those but you can read through those and try those out.

So we’re going to go ahead and give this one a quick try. So essentially I should see all this field except for this last one. If I select other you’ll notice that other field or other food field slides down. If I pick something else it no longer slides down anymore and it just works.

Let’s go ahead and quickly browse to see these other ones to get it working in the way that we wanted to. We want this favorite … what are your favorite fruits field as dependency on favorite foods as well. Dependents is going to be visible when the dependee, this favorite foods field again has the value, in this case of fruit, I’m going to leave everything else.

This one I’ll just leave show/hide as an example, leave all the other options the same, click save and I will add one for vegetables as well. So we want favorite vegetables, dependee is the favorite foods, the same thing it’s going to be visible when it has the value of in this case vegetables, leave all the rest the same, save it and we’ll go ahead and create another one.

Now you can see it’s getting a little closer, has select fruits, I only see the fruit, select vegetables I only see the vegetables, I select other the other field slides in. I just need this other fruit now to be dependent on this checkbox. So I’m going to add that to dependency as well and as you can see this basically just build upon each other so you can have a whole bunch of dependencies on one form and it’s really … I guess just a dependency building tool for as many fields as you may need. So I’m going to select other fruit as the dependency.

This is based on your favorite fruit field and it’s going to be visible when the dependee has a value of other and this one I’ll go ahead and fade in, fade out. Now I’ll make this fade in, fade out a little bit longer so we can really see it that it’s working and we’ll save it and we will give this a quick test, I select fruits it shows up, I select other and I can select the other ones as well but as soon as I uncheck other you can see it fades out.

If I select this other here you’ll notice that there’s a couple of issues because since this field is still technically setting these values this field is till displaying. So what we’ll need to do here is we can add a couple of other things. We’re going to have to change a little bit on these settings to make sure that it is only set when the other one is displayed. So we’re going to go ahead and click the Hide the Dependent if dependee is not viewed by the user and the dependency is not triggered, I’m going to make sure I’m on the right one here, oops I selected the wrong one, let me go back, I want to go to other fruit and select that checkbox.

Hide the dependent if the dependee is not viewable by the user and if dependency is not triggered. Let’s try that out and see if that’s going to do it for us and no it doesn’t look like it’s going to so let’s look at this one more time. I’m pretty sure there’s a way to get this to work so I’ll take a quick look here. So what we’re going to need to do here is we’re going to need to add another dependency for this other fruit field because essentially we want to make sure that the other fruit field only displays one when the other checkboxes checked but it also needs this favorite foods field to be selected as fruit otherwise we don’t want it to display.

So I went ahead and I select this and then we’re going to say the dependent field is visible only when the dependency has the value of in this case Fruits. This is where the interaction with other dependency has come in because here it’s acting with an And so basically we’re saying we only want this other fruit field to be displaying when there’s the checkbox on other and the select box on fruits.

So it has to meet both conditions before this will display. So I’ll leave this here and click Save. You can see now it adds this little dependency here so it says Other Fruit, it’s dependent on favorite foods when favorite foods has a value of fruits and when your favorite fruits has selection of Other. So let’s go ahead and give this a quick try. Now if I select Vegetables, it works of course just like I did before and so as Other, select Fruits, everything is working, I select Other it shows up.

Now when I select something else this Other Fruit should go away which it does and then of course brings up the Favorite Vegetable or if I select Other it brings up the other food. You’ll notice when I come back to fruits it saves this value so the other fruit is still displaying. So it remembers where you’re at, it does a nice job of showing hiding things and allowing you to make really dynamic in flexible forms for your various entities that … any type of entities that has fields.

One of the things you’ll notice is that since these values have been selected, if you want these values to be submitted I believe that’s where this checkbox of reset the dependents to its default values when the form is submitted. So basically if the dependency hasn’t been triggered this will reset it to its default values which in this case was blank. So just keep that in mind.

Go ahead and give this module a try, it’s very flexible, it’s a little confusing because there’s a lot you can do with it but it’s extremely powerful when you figure out how to get all the different dependencies to interact with each other and how to build those really interesting and the complex forms. Thanks again to drupalize.me for making this thing possible and thank you for watching the Daily Dose of Drupal, I will see you next time.

Tags: DrupalEntitiesFieldsFormsContribDrupal 7Layout ToolsSite BuildingDrupal Planet

Drupal 7 Service Links Module

Feb 6, 2013

Description:

Episode Number: 103

The Drupal 7 Service links module makes it easy to add social networking or bookmarking links and widgets to your Drupal 7 website. From Facebook, to Twitter, to Google Plus, and more... this module has it all.

In this episode you will learn:

How to download and configure the various settings in the Service Links module How to add service links and service widgets to a content type page

Thanks to today's sponsor Drupalize.me

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on episode number 103. Today we’re going to be going over the Service Links Module. The Service Links Module makes extremely easy to add social networking and sharing links to your Drupal website. In fact it’s one of the easiest way to get started if you want to add not only links for social networks but also different widgets from Twitter and Facebook, Google +, LinkedIn and among others.

But before we get started I’m Shane Thomas, you can follow me on Twitter @smthomas3, also go to codekarate.com and sign up for the newsletter and we’d like to thank drupalize.me for sponsoring this episode of the Daily Dose of Drupal. Go ahead and use coupon code CK20FEB for 20% off at drupalize.me.
If you haven’t use drupalize.me or haven’t look into it go ahead and take a look, it’s one of the best ways to learn Drupal. It’s helped me a lot in the past and it can help you as well whether you’re a beginner or an advance Drupal developer, they can help you so go check it out.

Let’s go ahead and get started; so one of the things that you’ll notice when you download the Service Links Module is there is an extremely large amount of modules that come with it so if you come into service links you can see that there’s a couple here but we get on to the Service Links services you can see there’s an extremely large amount in this section as well.

So the first thing we’re going to do is turn on just the main Service Links Module and I’m just going to turn on just a couple of these services. The Genera Service is just one which is one that you’re going to probably want most of the time as well as the widget services which allows you to have a Facebook Like button, your Google + 1 and your Twitter widget as well.

You can see there’s a ton of other different types of services, you can take a look and see if they apply to your site and of course add that if you need them. So I’m going to go ahead and save this, as soon as this comes back up I’m going to come back in to the services section and I’m going to click on configure. There are a lot of settings here so I’m not going to go over all of them, I’m going to freeze through them but you can always come back in and try them out.

A lot of them have to deal with where to display the Service links and how to display them among the content. So the first thing is the content types that you want to display the links for. I’m going to go ahead and just select Article, you can of course have them display for any other type of content on your Drupal site.

You can also show them for terms from the selected vocabularies so in this case I only have the tags vocabulary but I could check this box that wanted to show up for that term. Basically in this … where to show Service Links section you’re going to tell it where you actually want the links to show up. So it shows this in the links section right now on teasers and full page view.

That’s the default and that’s where I’m going to leave it but you can see you can show just on the full page just on the teaser or you can completely disable it and also you can say you wanted to display service links in nodes and you can have it show up right after the text of the contents.

So if you want to it not in the link section but actually after the text of the node you can use this option here. You can use page specific visibility so if you don’t want everything ever to show up on the homepage or you don’t want things to show up on certain paths you can go ahead and exclude or include them there, you can choose if you want to show just text just image or both, I’ll leave it a default you can also not show links of the contents not published and don’t show links that the user is the author of the node.

Here you can select and add your icons so all you need to do is find the folder and you can add your own icons and use this change folder and then you can always fall back the default icons if your icons are missing for whatever reason. So it allows you the flexibility to really select your icons that you want for the various social networking or sharing sites that you want to have the icons for.

I’m going to select that I want to open the link in a new window, that’s just my preferences. You can have it in the same window or you can have it open in a new window, you can add a following text to the URL, you can change the title tag with the sharing and you can select whether you’re not … you want to use short links. So you can see there’s a ton of configuration options, I did the very minimum but you can go ahead and experiment and see what works for you.

On the services pages you’re going to list all the different services. I’m going to go ahead and turn on the Show Dig Smart button link which is a widget. As you can see there’s list General Services and Widget Services, I’m going to show the Facebook like link, the Google+ 1 widget. I’ll go ahead and add the delicious links as you can see so them as a general services listed in there.

I will also go ahead and add Read It, Stumble upon and Twitter. That’s enough for now but you can of course configure this to your needs, I’m going to go to the last tab here which is widgets. Here you can add different configuration options for each widget so I can set my Twitter handle here, you can have select how you want to counter to display.

There’s a couple of different options for the Facebook Like widget, if you want a button or standard of box count, you can set the width font whether not to show faces which action to take the big button, you can select different type Google +, you can select different sizes in whether or not to show the counter and link in share button you can also make some changes as well. So pretty flexible; the goal is you have this one module that panels all the sharing and bookmarking functions for your entire Drupal site. So let’s go ahead and get started and actually taking a look at this module.

So now that I have everything configured I’m just going to wait for the page to load and I’ll scroll down and find the article. As you can see it immediately see these social sharing links. There’s the Like button, the Google + button and the tweet. I guess these are all widgets as well as a couple of other ones here.

So I’m going to go ahead and go into this, so I’m going to go ahead and show just so I can click the tweet widget there, tops it up, it adds my Twitter handle at the end, brings in the title, brings in the URL, it can of course just send out the tweet through that if I wanted to estimate this to stumble upon I simply click that, it’ll of course add it to Stumble Upon and these other links of course to their respective things depending on the social network.

So as you can see extremely easy to get started, you simply turn the module on, configure the services you want, change the settings, select the content types or taxonomy, I believe there’s also some blocks that you can set it up so it doesn’t have to be in the link section and you can maybe use the block if you want it somewhere else. So it’s very flexible, let’s you control where you want this links and you want these links and you can then and allow your users to start sharing on your Drupal site.

So that’s it for this time on the Daily Dose of Drupal, thanks again to drupalize.me and make sure you check them out and thank you for watching the Daily Dose of Drupal, see you next time.

Tags: DrupalContribDrupal 7Social ToolsDrupal PlanetUI/Design

Drupal 7 Font Your Face (@font-your-face) module

Feb 5, 2013

Description:

Episode Number: 102

The Drupal 7 @font-your-face module is one of the easiest ways to get started with adding web fonts to your Drupal 7 website. It provides an easy to use administrative interface which makes adding web fonts simply point and click.

In this episode you will learn:

How to download and configure the @font-your-face module How to use Google Fonts API with the Font your face module How to use a custom CSS selectore with the @font-your-face module Tags: DrupalContribDrupal 7Drupal PlanetUI/DesignCSS

Drupal 7 Menu Badges Module

Feb 4, 2013

Description:

Episode Number: 101

The Drupal 7 Menu Badges module is a neat little module that allows you to add numbered badges next to menu items on a Drupal 7 website. It integrates nicely with views so you can easily add your own numbered icons to any menu link. You will also need the Link Badges module for this to work.

In this episode you will learn:

How to add a Menu Badge to a Drupal PrivateMsg link Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 101 and if you haven’t checked out episode 100 yet I suggest you do so, it’s a pretty good episode.

Today we’re going to be going over the Menu Badges Module. The Menu Badges Module is a really cool little module that allows you add this Number Identifier Badge next to Menu Links and this can be really useful for letting people know how many items are going to be displayed when they click that link so you can see in this little screen shots it shows how many messages this link will actually hold once they click on it or how many items are in the user’s shopping cart.
But before we get started; as always I am Shane Thomas, you can follow me on Twitter @smthomas3, you can also go to codekarate.com and make sure to sign up for the newsletter. Today’s sponsor is drupalize.me and if you haven’t learned or haven’t heard about drupalize.me I highly suggest them out if you’re looking to learn anything from the basics of Drupal to more complex topics on Drupal, drupalize.me is the place you should check out.

They have 674 videos and over 245 hours of Drupal training and I can tell you that it is worth your time to check out because I’ve learned a lot from dupalize.me. I was a subscriber from a long time in the past and I can thank them for a lot of what I’ve learned with Drupal and I learned a lot of the more complex things there like security and website scalability and all those things but it’s good for beginners up until potentially experts as well so go ahead and check that out and use the promo code or coupon code CK20FEB to get 20% off.

Alright let’s go ahead and get started; I have a test site here and I’ve already downloaded the Menu Badges Module and also with the Menu Badges Module you will need to download and install the link badges module but I have both of those enabled on our test site you can configure the permissions but all that it allows you to do is select who can administer the Menu Badges Module.

The first thing I’m going to do is I do have the private messages module installed, you can see a past episode of how I got that installed but basically it’s going to show … we want the little icon to show on the top right corner to say how many messages I have or how many new messages I have.

So that’s … the good thing about this is it’s already built into the module itself, the link for the Menu Badges Module so I simply come in to my user menu and I will go to the links. It says here I have one new and if I go in edit this menu it’s going to allow me to select a display menu badge and now as you can see there’s already some prepopulated in this list.

So I simply select unread count for the current user, click Save and you’ll see now I already have this little display icon or badge up in the top right corner. So I simply save this and close out and I have my little menu badge. So while that is obviously very useful there are maybe come times when you need to display it your own custom pages or custom views.

So in the past episode I created a bookmark section and I’m going to show you an example using Views so make sure you have the Views Module installed of course of how to get the little icon that show up on the top right of this My Bookmarks link inside the navigation menu. So the first thing I’m going to do I’m going to go in and I’m just going to edit this view and I’m going to add another item here and I want to select Menu Badge as the type of view and I’m going to basically take … I can give this a title if I need to but I’ll go ahead and leave that, you can leave all the rest the same, you can select the field.

Since you’re going to be aggregating these fields you can go ahead and select just the content and ID will work, unselect the label because it’s not needed, I’ll also need to select the filter criteria so I’m going to use the same filter criteria that I use over here so I need to make sure I use only publish content but I’m also going to need to set this relationships this is using the flags module.

As I mentioned before you can make sure you go and check out that module for that episode of the Daily Dose of Drupal if you haven’t already as it will allow you to see I actually got this view set up in the first place. So I’ll add the relationship which is just going to give me a relationship for that flag and I want it for the current user include only the flag content, select the bookmarks, I’m also going to need to add a content offer relationship I believe, I’ll just check one thing here.

I actually don’t believe I need that so I’m going to go ahead and take that one off and I don’t think that one is actually needed because we’re not using any fields that require that relationship. So I’ll go ahead and make sure I also select to use aggregation and this is important. If you’re familiar with SQL or making database queries this aggregation is basically going to allow you to group things so this grouping is of course going to limit the number that’s shown so it’s actually not just going to give you just the NID so if I go ahead and turn this off you’ll be able to see what’s showing down here right now is this NID.

If I group this it’s not just going to show the NID, I can come in here and select the aggregation settings and select Count. Now it’s going to say I have one item instead of just the Node ID of 3, it’s saying there’s just one item because I’m counting the number of Items.

This aggregation is similar to using a group by type claws inside of an SQL statement if you’re familiar with that and that is how that works so we’re going to give that a Save. Now we need to come into our Menu links so I’m going to come into my menus, my navigation menu, I’m going to my bookmarks and select Edit and I’m going to select display menu badge, I didn’t give it a title but if you had given a title it will be a little easier to differentiate there, I’m going to save this.

Now you can see it shows I have one item bookmark, it’s this Test Article 2, I’m going to see if I can bookmark another item. Now if I click you can see it shows I have two items now bookmarked. So that’s really how the Menu Badges Module works. There’s also another element to the Menu Badges, there’s a Tab Menu Badges and this can be used for administration pages if you created an administration page and you wanted an icon up here on the top of an administration menu tab you could use this as well.

You simply come in here and you select the item. For instance in the settings I could select this item, settings should be up here I believe but that would be the admin appearance settings but if I save it you’d notice that the item now shows up in this menu tab as well.

So you can use it not only for the front end but you can also use it for the administration pages and it’s a really handy module. I’m actually using it in a project I’m working on currently so go ahead and give it a try and let me know what you think. If you have any other suggestions for future modules you want me to review go ahead and let me know on Twitter or end me an e-mail or contact me on codekarate.com. Thanks again to drupalize.me and thank you for watching that Daily Dose of Drupal. See you next time.

Tags: DrupalMenu SystemContribViewsDrupal 7Drupal PlanetUI/Design

My Drupal Development Environment

Feb 2, 2013

Description:

Episode Number: 100

The big 100th episode! In this episode I go over my company's Drupal development environment (http://beginr.com). I discuss how we use Aegir (http://www.aegirproject.org/) to manage and deploy our Drupal websites. I also mention how the development process works using development and live environments spread across multiple servers dedicated to hosting Drupal websites. I mention what operating systems we use along with my personal preference for browsers.

One thing I didn't mention is that I use Komodo Edit for my code editor. I think it is pretty awesome.

Nov 14, 2014 - Update My development environment and process has changed drastically over the last few years. However, take a look at the 5 Secrets to Becoming a Drupal 7 Ninja Ebook as I cover setting up you Drupal Development Process extensively.

Tags: DrupalAegirDrupal 6Drupal 7Drupal PlanetSite AdministrationSystem AdministrationDeploymentServers

Drupal 7 Entity Connect Module

Feb 1, 2013

Description:

Episode Number: 99

The Drupal 7 Entity Connect module makes it extremely easy to add or edit referenced entities from within an entity reference field. If you have ever used the entity reference module, this module is definitely one you need to check out.

In this episode you will learn:

How to add a new node from within an entity reference field How to edit an existing node from within an entity reference field Tags: DrupalEntitiesContribEntity ReferenceDrupal 7Site BuildingDrupal Planet

Drupal 7 Entity Reference Prepopulate module

Jan 31, 2013

Description:

Episode Number: 98

The Drupal 7 Entity Reference Prepopulate module allows you to automatically populate an Entity Reference Field from the URL. This is similar to a Drupal 6 module called Nodereference URL widget, but works with all entities.

In this episode you will learn:

How to configure the Entity Reference Prepopulate module How to construct the URL to get the Entity Reference Field to fill in automatically Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode number 98, getting very close to 100. As always I’m Shane Thomas, you can follow me on Twitter at smthomas3; you can also go over to codekarate.com and sign up for the newsletter and check out the other things on the website.

Today we’re going over a very simple module that has some specific uses depending on what type of website you’re building. It is the Entity Reference Pre-Populate Module. In the past episode of the Daily Dose of Drupal I went over the Entity Reference Module so you can go ahead and search for that and look at that before you watch this one if you haven’t already or if you’re not sure what the Entity Reference Module is.

It basically allows you to reference different entities so you could have for instance a Client Management System which is what I’m going to kind of use as a rough example in this case in which you have a client company with multiple contacts at the company. So you have two different types of nodes as you can see on our test site here I have a content type for client which is going to be similar to a business and contact.
So a client could have multiple contacts and every time you add a new contact you reference which client you’re actually a part of. So if you take a look, the client is simply just a blank content type which had a title right now, you could put other things in there, there’s a body field as well.

The content or contact content type has just a contact name which is the title, a body field, a phone number. You could put multiple things here, e-mail address, whatever you need to collect about the … whatever type of information you need to collect about that contact and it has this client field which you can see as an Entity Reference Field. So what I’m going to do is I’m going to first mention what the Entity Reference Pre-Populate module does.

Basically this lets you pre-populate this entity reference field so if I go in and I want to add a new contact for a client I can say this is Jane Doe, I can add some information about Jane Doe, give her phone number and then I can say which client this contact is a part of. So as you can see it references a client content type that I already have so I created a node called ABC Company, I can save this and now I have a contacts that references this client.

But what I really want to do is let’s say I want to add a client or excuse me a contact but when I add this contact I want to make sure that this is already filled in, maybe even hidden because you want … you don’t necessarily want to have to look to client so ideally what I’d like to do is go to a client page and somewhere on this client page to be able to actually click a link that would then allow me to create a contact for this specific client and the Entity Reference Pre-Populate module only does a small piece of that.

It doesn’t necessarily give you the link; you have to do that yourself either through using the panels module or display suite module or some custom code. You can use any of those options and you can easily use tokens to generate a link but we’re going to just show you how it would work with the Entity Reference Pre-Populate Module.

So I’m going to go ahead and turn this module on so we can at least see what it allows you to do. So I’m going to go ahead and find it in the list, I will turn it on and save it and now I will come back to my content type and I’m going to go to the Contact Content Type, the one with the Entity Reference Field, as you can see here I’ll click Edit and there will be a new checkbox here called Entity Reference Pre-Populate.
It will default to uncheck so you can go ahead and check it. Now you get to basically say what you want to happen. So first is the action to take one pre-populate in the field with values so you can first have it do nothing which basically means it’s going to just show you the field with the text in it.

You can have it to completely hide the field or you can have it actually have the field disabled. I’ll go ahead and select Disable and you can force it to apply when you edit it so you won’t build to change that actual client but I’m going to go ahead and not do that so you’ll make it so you can edit the specific client that a contact is a part of.

Fallback behavior; you can set an error, redirect, hide the field or do nothing and this is basically what happens if you try to create that piece of content without the URL setup correctly. You can also set who can skip the access permission so you can basically set it and it will not be affected by this fallback behavior. You can also use it with the Oriented Groups Module but we’re not going to go over that.

But basically what this allows you to do is now that I set that I can of course since I have a fallback behavior to do nothing I can still create a contacts normally just like this and everything works, I can still reference the client company as normal but what I want to do is I want to come up here and I’m actually going to start by going to /node/add/contact.

So this is going to give me just to the basic page still everything’s still the same but what I’m going to be able to do is I can put question mark the name of the field which in this case I’ll show you where but says field_client=and then the node ID of that actual client. In this case it’s node ID of 6.

So now that I set that you can see if I scroll down it automatically pre-populates this field with this Node ID which is 6 and it’s said it to be disabled. If would have set it to hidden this field won’t be here, I could have set it to do nothing and it would be just pre-populated with this text and it would be editable.

So now I can of course put a test contact in, put a phone number in, that might be too many digits but that’s okay and I will save it and it automatically created that link to that client company for me. So now it’s reference correctly to ABC Company for the client for this specific contact. So as you can see it’s a simple module, it doesn’t give you the link out of the box but you can easily create it if you’re using anything with actually changing how this node displays.

Just simply add a link using the Panels Module and some tokens or I guess they’re consider like contact substitutions in panels depending on how you look at it and it’s also available pretty easily using Display Suite. So go ahead and take a look at this module and use it on sites that you need to link references or entities together very easily and just to show you quickly where I got that field name if you’re not familiar.

If I come into the contact content type, you can see the machine name or the field name was field_client. So that’s how I got that part of the URL, it’s just simply node/add/whatever the machine name is or your actual content type. In this case it was just contact then it’s the question mark to create the query string on the URL and it’s simply the field name which in this case is field_client and then the actual node that you want to reference.

If I try to reference something else it’s not going to necessarily work. You can see it doesn’t populate it because I’m only allowing client nodes to be in here. I change this to a 6, come back because node ID of 6 is an actual client content type or client node, it works. So go ahead and try this out when you’re needing to build complex structures using the entity reference module, it will make things easier you can easily populate values using the URL.

You will of course need to do more either some custom development or use some other display modifying modules in order to get it to work easily but you can go … I’ll leave that as an exercise for you to try out. Just go ahead and let me know if you have any questions and as always thank you for watching.

Tags: DrupalEntitiesContribEntity ReferenceDrupal 7Site BuildingDrupal Planet

Drupal 7 Field Collection Views module

Jan 30, 2013

Description:

Episode Number: 97

The Drupal 7 Field Collection Views module makes the Field Collection module even better by allowing you to harness the power of the Drupal Views module to make the display of a Field Collection extremely flexible.

In this episode you will learn:

How to use the Drupal Field Collection Views module to change the Field display formatter for a Field Collection to a custom view Full Text: 

Hello everybody and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 97 and as always I’m Shane Thomas, you can follow on Twitter at smthomas3, also go to codekarate.com and sign up for the newsletter on the left and find me on Google + as well.

In episode number 59 I believe I went over the Field Collection Module and what the Field Collection Module allows you to is it allows you to basically add a field to a content type that allows multiple field values to be attached to that and the best way to show you would be to … with an example.

So I have the Field Collection Module installed and I have a content type called the Playlist. In this content type called Playlist I had a field collection called the Songs. So if you take a look at one of the playlist I created it is called Classic Rock and it has a couple of songs. It has … you can see there’s song title and artist and there’s multiple of those so I have 1, 2, 3, 4 … it looks like about 6 songs in here and you notice that for every song title there’s an artist so I’ll walk this way with Aerosmith, We are the Champions, Queen and if you take a look at the edit form you’ll see how it works. Basically it has the two fields; the Song Title and the Artist and it allows me to of course rearrange these or to add another field here if I want to, if I want to add another song and artist and I can of course add these two fields.

I can add any number of fields I wanted just by simply going to the Field Collection’s page after I added it to the content type and manage the fields that go inside this Field Collection so I have a song title and an artist. And the only reason I’m showing you this is because it ties in to the module we’re going to be going over today. We’re going over the Field Collection Views Module.

As you can see on this display page it’s not necessarily the format that I would want this display to be in, it’s just kind of a list, it tells me the song title, the artist. I can make some minor changes to this format, if I come up over to the content type page for my playlist and I go to manage display I can have it show the Field Collection Items or links to the Field Collection Items.

So I’ll go ahead and have a Show Field Collection Items and I’ll click Save and you can see now it shows in a little bit different format, I can edit and delete, there’s an Add Link so I can add a new song title and artist to this collection and I can edit an existing one but this isn’t necessarily the format that I want but what I want here is I kind of want it to be on a table based format just so it’s easy to read and easy to see and this is where the Field Collection Views module comes in.

This basically allows you to use the power of the Views Module with your Field Collections. So I’m going to start by turning this module on and I’ll save this and now there’s a couple of steps that you’re going to need to follow; there are some instructions on the Field Collection Views page so you may need to take a look at that if you get lost.

It basically will allow you to change the display settings for this particular field collection so I’m going to come back to the content type page I’m going to go to manage display for my playlist and now I’m going to look and see that there’s a Views Field Collection Items option here so I’m going to select that and now what this allows you to do is it allows you to use the name of your view so this is the machine name of the view as well as which display ID and if you want to have an Add Link in the actual display itself.

So I’m going to use the default and show you how the default view works so I save this, I come back to the page and now you can see I’m already … you can tell it’s a View and I’m already using a table based format. Right now it just tells me the Field Collection ID gets me an Edit and Delete link and has this Add Link at the bottom. Of course I want to modify this but before you go and just modify this view directly, there’s a couple of things you should note; this default View probably shouldn’t be modified just in case you have other Field Collections you add later you want to be able to use this view as an example.

So what I recommend you do and I think it’s also recommended this way in the instructions here is I’m going to go ahead and clone this Field Collection View and you could of course just add another display to the Field Collection View but I like to … I guess just change it so it’s a completely separate view then I can export it with the Features Module or something else if I need to and I will go ahead and name this Playlist Field Collection.

And since this is a clone you’re already working with the exact items that you need so it already has all these different fields in it and you need to make sure you keep most of these fields here. So what I’m going to do is I’m going to go ahead and this Field Collection ID I’m going to just exclude this from the display so it’s not showing up and I’m going to then add my various fields that I want which are song title and artist.

You can see it’s just a basic view if you haven’t use the Views Module before you’ll obviously need to learn how to use that first but if you have it’s going to be very familiar so I’ll go ahead and leave the labels and walk through the next steps and I’ll rearrange this so I put the song title first then the artist then the edit link and the delete link. Let me see what this is; that’s the Add link that is there, it’s going to be shown at the bottom so I’m going to go ahead and save this and now when I come back to the playlist.

You’re going to notice nothing has change yet. I need to actually come back into my content type, go to Manage Display and change the new machine name of this view and in case you don’t know what the machine name is you can hover over or you can come in here and if you hover this view name you can see it says machine name, playlist_field_collection.

So I’m going to change that playlist_field_collection and as far as the machine name; if you hover over or you go into the advance section it’s going to give you the machine name of this view. In this case it’s a page, what I try want to do is I try want to not make this a page because … this is the wrong view actually so I want to click on the right view this time.

So it’s actually not a page, it’s just the master display so if you hover over it’s going to say and if you look at the URL down here right at the bottom when I hover over this it says … you’ll notice that there’s the word Default in there right at the end and that default is the name or the machine name of this display.

In most views if you added another View; for instance I added a block it would allow you to change this machine name if you wanted to but we’re just going to leave it at a default so the display ID which is just the Display ID not the machine name of the View is going to be default. If I added a different one that I could of course maybe change it but for the most part they’re should probably left at default. If you want to have the Add Link you leave that there, of course this was the actual machine name of the view, go ahead and click update, save it and things should begin looking the way I want it to now. And there you have it.

Now we have Song Title, Artist, Edit and Delete. This is a view so I can do a lot of different things here and control how this works and how this looks and it’s just that easy to have a content type with a Field Collection that you can build out and now you can also control very easily how that is presented on the page.

So that’s it for this time on the Daily Dose of Drupal and we’ll be back again next time with another episode. Thanks for watching and let me know if you have any questions or anything else you would like me to cover in future episodes. See you later.

Tags: DrupalFieldsContribField CollectionViewsDrupal 7Layout ToolsSite BuildingDrupal Planet

Drupal 7 Mollom Module

Jan 29, 2013

Description:

Episode Number: 96

Spam is always something you need to consider when developing a Drupal website. One tool that makes spam detection and prevention extremely easy is the Drupal 7 Mollom module. This module uses the Mollom service to give your Drupal website capabilities to add captchas to forms, or even analyze text for content that looks like Spam. The service has a completely free version so you can easily get started preventing Spam on your Drupal 7 website.

In this episode you will learn:

Tags: DrupalContribDrupal 7Drupal PlanetSpam Prevention

Drupal 7 Blocking IP Addresses and User Restrictions module

Jan 26, 2013

Description:

Episode Number: 95

Drupal 7 has the ability out of the box to block specific IP addresses from accessing the site. On top of that, the Drupal User Restrictions module can be used to block specific usernames or email addresses from creating accounts on your Drupal website.

In this episode you will learn:

How to block IP addresses on a Drupal 7 website How to use the User Restrictions module to block usernames and email addresses Tags: DrupalCore ConceptsUsersContribDrupal PlanetSite AdministrationSpam Prevention

Drupal Module Comparison: Scroll to Top and Back to Top

Jan 24, 2013

Description:

Episode Number: 94

In this Daily Dose of Drupal episode, we really go for a double dose as we look at two modules that have very similar functionality. We first look at the Drupal 7 Scroll to Top module and see how it can be used to create a nice button that scrolls to the top of the page using JavaScript. We then look at the Drupal 7 Back to Top module to see how it differs. These modules do different things but they have different settings/configuration options that make them unique.

Tags: DrupalContribDrupal 7Drupal PlanetUI/DesignJavascriptJQuery

Drupal 7 Flag Module

Jan 24, 2013

Description:

Episode Number: 93

The Drupal 7 Flag module allows you to build very dynamic and flexible flagging/bookmarking systems on a Drupal website. You can use this to create a favorites section, create a bookmarks page, or even allow users to flag content as inappropriate or offensive.

In this episode you will learn:

How to install and configure the flag module How to create a simple bookmarking system How you can use views to edit the bookmarks page Tags: DrupalContribViewsDrupal 7Site BuildingDrupal Planet

Drupal 7 Form Builder Module

Jan 23, 2013

Description:

Episode Number: 92

The Drupal 7 Form Builder module is a handy module for those new to building forms with the Drupal Form API. The module provides a nice, centralized interface for building out Drupal forms.

In this episode you will learn:

What is the Drupal 7 Form Builder module and why might it be useful How can the Drupal 7 Form Builder module be used to export Drupal 7 Form API code. Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, as always I’m Shane, you can follow me on Twitter at smthomas3, you can also go to codekarate.com and sign up for the newsletter if you haven’t already.

Today we’re on Episode Number 92, I’m going to quickly go over a module that is called the Form Builder Module and it’s on drupal.org/projects/form_builder and basically the goal of this module is to be a centralized interface for building out various form elements.

However right now I believe it only works for … actually exporting the Form API code that basically gives you the PHP Code that you can drop into a module and use, it also can be integrated with the Web Form Module I believe. I’m just going to go over the first option and how you can use it to build or at least get a baseline of some of the PHP code necessary to implement your own custom form in a custom module and it doesn’t necessarily provide the cleanest of all Form API code but it can get you started so we’re going to go ahead and just take a real quick look at what it can do.

It’s kind of a fancy looking module once you get it going and it’s all Ajax and Java Script based so it’s pretty nice and easy to use. I’m going to go ahead and turn the Form Builder Module and this module is more of a framework so without any of the other implementing modules it will not really do anything so I’m also going to turn on the Form Builder examples module and in the future episode I may cover its integration with the web form module as well.

But for now we’ll just stick with the examples module. After I install that there’s another … there’s a link that’s been added to this navigation section and I click on that and it’s a form builder example.

It comes stocked with a bunch of our form elements I already added, I’m going to go ahead and just get rid of some of this so we can start with the blank form. So I’m going to go ahead and start by adding some checkboxes, you can then edit this and then I’ll add a couple options here, you can also set it so you can customized the keys of the actual values which will give you the ability to actually customized what will be sent in when it’s selected, not just what’s displayed to the user and you can also make this required so they have to select one.

Now that I close that you can see I have check boxes here, I can click on this Export tab anytime and it gives me the code here that I can drop in to a module and it’ll actually be a working form in that … once you copy this in and you get it set up it’ll just work. The only thing that you need to notice is this is only going to give you the code to display the form.

It’s not necessarily going to give you the code of how to handle where the data goes once it’s submitted or any other extra validation you may need, it’s also … it does just name this a random … looks like a collection of numbers maybe be based on the timestamp so you may need to change this to be something a little more readable for you so you can better handle the output of the form and you’ll also going to make sure you add a Submit button if you do somehow take this form code and drop it into a module.

We’ll go ahead and add a couple of other things here; so you can see as I’m changing this it is modifying the actual form element here, you can easily rearrange things in the Form Builder, we can also make an image if you want a number select variable, have a number field, you can add a prefix and you can see it’ll add a prefix here, you set the default value.

So as you can see it’s very useful, easy to use, allows you to easily and quickly build out various form elements and it basically saves you potentially some time if you’ve never built out a form with the Form API before this can be a good starting point. If you already built out many form structures you probably are not going to find a lot of use for this, it’s kind of more of … in the example modules is more of a proof of concept to try to provide that centralized Ajax interface for building out various forms whether it’s web forms or in this case just building out form code that you can then export and put in your own module.

But it is kind of handy especially if you are unfamiliar with building out Form API structures and you want to have just the example code to go off of when you’re building your own, it can give you that good head start and in some cases you may find it to be actually faster than writing the code yourself.

Maybe you can build you form here, export it out and drop it into a module much faster than writing the code yourself. I’ll go ahead and give it a try and see what you think, see if it is useful. I’ve never really used it on forms because I didn’t know about it until recently but I can see how if you are a new comer and you’re trying to learn how to build forms using the Drupal Form API getting a little head start with the code and then examining what code is given to you here can be potentially useful and it can obviously give you a quick jumpstart on giving those longer forms out.

So that’s it for this time on the Daily Dose of Drupal and we’ll be back again next time. Thank you for watching.

Tags: DrupalCore ConceptsFormsContribWebformModule DevelopmentDrupal Planet

Drupal 7 Modal Forms (with Ctools) module

Jan 22, 2013

Description:

Episode Number: 91

If you need to launch a Drupal form inside a JavaScript dialog or popup window, the Drupal 7 Modal Forms (with Ctools). The module seamlessly works with the User registration, User login, Password reset, contact form, and comment form.

In this episode you will learn:

How to configure the Modal Forms module to work with the various user forms How to configure the Modal Forms module to work with the comment form Tags: DrupalFormsContribCtoolsDrupal 7Drupal PlanetUI/DesignModal Forms

Drupal 7 Registry Issues After Drupal Core update

Jan 19, 2013

Description:

I recently was helping a new Drupal developer with some issues after they attempted a Drupal update that really messed up their Drupal website. They were getting a bunch of Fatal errors that were causing the site to be completely broken. This user was on a Windows system running a Drupal 7 development site on their localhost. Here are the steps I tried and how I fixed the problem.

Download a new Drupal 7 core Type: TextTags: DrupalCore ConceptsDrupal 7Drupal PlanetSystem AdministrationServersTips and Tricks

Drupal 7 PrivateMsg Module Part 2 filters, roles, limits, emails

Jan 19, 2013

Description:

Episode Number: 90

This episode continues where the last video on the Drupal 7 PrivateMsg module left off and goes into many of the various sub modules that the come included with the Drupal 7 Private Mesages module.

In this episode you will learn:

How to send emails to users when they receive a private message How to allow users to block other users from sending private mesages to them How to configure Private Msg blocking rules Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 90 and yesterday if you watched the previous episode we’re going over the Drupal 7 Private Message Module.

The Drupal 7 Private Message Module that we went over yesterday was just a very basic module. Just the ability to send and receive Private Messages between users on the Drupal site.

Today we’re going to look at the different sub-modules or at least a good number of them that come with a private messages module but before we get started as always I’m Shane Thomas, you can follow me on Twitter at smthomas3 and you can also go to codekarate.com.

It’s just a site right here and sign up for the newsletter right here on the left if you have not already. So let’s go ahead and gets started; I have the Private Message module installed just from yesterday, we’re basically starting right where I left off and I will go ahead and get started.

You can see we have the Private Messages block over here that allows you to easily get to your messages. You can also get to it from this link up here or if you go into my account there’s also messages link so that’s how you can get to your messages but we’re going to look at the different modules that we can turn on. In this Mail fields you can see that there’s a whole bunch of them over here.

So the first that we can turn on is the Private Message e-mail notification and I’m just going to go over these very briefly to show you what they can do and how you can start to configure them. I’m not going to be able to go into all of them in complete detail because there’s quite a bit in this list.

So we’ll go ahead and turn that one on and now if I come back here I’ll click this configure link and you can see there’s a new area over here and I know I didn’t go through all of these different options completely yesterday but they’re pretty self-explanatory for these first four configuration options.

This e-mail notifies now new because I turned on the module for e-mail notifications, you can say if you want to default, notify or not notify new or uses of new private messages you can configure the e-mail that gets sent out. It also allows you to then come into your account settings or you can allow users to come into their account settings, edit the account and in this Private Messages section select whether they want to receive e-mail notifications.

You can also with permissions select whether you want them to be able to turn on of turn off Private Messages. A lot of these are all permissions based so you’ll have to look at the Permissions and just make sure that you have setup correctly for the different roles on your Drupal 7 website. We’re next going to go to this Block User Messages. This is going to allow users to block other users from sending messages.

So once we get this one turned on we can come here and click Configure and you can see this actually adds a tab. I’ve added a rule here that basically says if the author is an administrator and the recipient is an authenticated user then the user cannot block the author and you can add a whole bunch of other different types of rules if you need to but basically you can add rules to make sure that maybe certain roles can’t send two other roles or maybe certain users should not be able to block other users.

So that’s the first step as you can configure out the different rules for different ways to block users and then of course when you come into your messages section there’s now a tab for Block Users and here you can select specific user names, you can then block this user if you want, they will no longer be able to send you message if, it will let them know that they’ve been blocked and then you can of course unblock them so that’s how that works, pretty simple.

Let’s go in and check out the next module; the Private Message Limits Module is another handy one especially if you have a lot of users on your site and you don’t want people to take advantage of the private Messaging features so we’ll come back into the configuration page and there’s a Limits tab up here. Basically this one will allow you to set different limits depending on sending and receiving. So you can limit the number of conversations or number of messages per conversation. You can limit how many or the total messages or conversations that the user can receive; you can limit either the messages or the conversations and of course set the max.

You can also change that for specific roles if you want administrators not to have a limit you can set that there but have authenticators be limited to maybe only 50 different messages. And this is probably the most important one is you can limit the number of messages that a user can send in a specific time period and that’s to prevent users from taking advantage of private messaging and spamming other users on your site so you can limit to say they can only send 5 messages in a given time period whether that’s an hour, a day, 30 minutes depending on the needs of your website then you can of course overwrite that role so you can remove the limit for administrators and then you can also limit how many recipients then can add to the message so they don’t add or try to send a message to every user on the site or an extremely large amount of users and of course it’s all over writable by role. So that’s what the Private Message Limits Module does.

We have a couple more we’re going to go through quick; the Private Message Roles Module is second to last one we’re going to go through and this one is another handy one. It doesn’t necessarily have any configuration but what it does allow you to do is if you come into your messages section on your Drupal site in your account and you go to write in new message you see there’s another area here that says you can enter the name of the role to write a message to all users that have that role.

So I can send to all authenticated users or I can send to all administrators and this is a permission based so in this case you probably only want to allow admins to have this access but depending on your site’s need. You can open up to other users as well and it allows you to send a private message to everyone in that specific role. So it’s definitely handy if you make changes to your site or you need to notice or send notices to all users at once.

We’ll go ahead and check out the last one here and this is the Private Message Filter Module. So this is going to make quite a few changes here to the way that your messages are setup. So if I come back to here I don’t believe that there’s anything else that’s added.

Well I guess there is the tags so I’ll go over this in a second but the rest of it is pretty much the same for configuration options. However when I come back to the messages page you can see now I have extra tabs. I have my Inbox which show nothing because I’ve already read all the messages. It lists my sent messages and also all my messages and then I still have the Block Users tab from before.

This one allows you to do a couple of things; I can filter messages by subject so if I want to search for subject with test of course I get this one still showing up. If I search for something that’s not it will not show up, you can search by participants so I can search just for the test user that I have conversations going with, you can also save this filter. You can then also apply tags.

So I want to apply this test tag to this message, I can apply that and it allows you to undo that if you need to but now when I come back here it allows you to filter by specific tags and you can then remove tags if necessary but you can also filter by this. So you can think of tags as similar to folders. You can organize it if you have specific conversations you want to put in different tags depending on the topics, you can do that and all the configuration page for private messages that had the tags on it, all that does is list the different tags that are in use and lets you know if they’re public.

Basically what that means is my tags that I’m creating are only available to me and it tells me how many times this tag has been used. There also are ways to I believe make tags public so anyone can use those tags but we won’t go over that this time. So that’s really all there is to those modules, we also went to some of the other core ones like blocking user messages, e-mail notifications prior message filtering, the limits and the roles, we’re not going to go the real name or rules integration although those are also well built and can be helpful on specific sites.

So that’s it for this time on the Daily Dose of Drupal. Hopefully you learned a little bit about how to enhance just the basic Private Message Module with some of the other additional modules that come with it and how you can build a very flexible private messaging system on a Drupal 7 website. As always; follow me on Twitter if you’re not already and we will see you next time with another episode. Thanks for watching.

Series: PrivateMsg Basics SeriesTags: DrupalContribPrivateMsgDrupal 7Drupal PlanetEmail

Drupal 7 PrivateMsg Module

Jan 18, 2013

Description:

Episode Number: 89

The Drupal 7 PrivateMsg module allows users on your Drupal website to send and receive private messages to one another. The PrivateMsg module is very configurable and can be used on a wide variety of Drupal 7 websites such as community sites and social networking sites.

In this episode you will learn:

How to set permissions and configure the Drupal PrivateMsg module How to send a private message to another Drupal user Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 89. As always I’m Shane Thomas, you can follow me on Twitter at smthomas3, you can also come over to codekarate.com sign up for the newsletter here on the left side.

Today we’re going over the Private Message Module. This is a module I’ve used on quite a few sites in the past, Drupal 6 and Drupal 7 and it basically allows you to configure your websites so users can send and receive messages within the website.

This can be useful on many different types of community based sites or social networks, things of that nature and it’s a very useful and very well developed module with a whole bunch of different sub-modules and so I’ll to get a few of them now and maybe I’ll do another episode later with going into more detail on the other sub-modules that come along with the Private Message module.

So I have a test site here and it’s pretty much a basic Drupal 7 site and I’ll come in here and look and see that I have a private message module downloaded, you can see it comes with looks like about 8 different sub-modules. I’m to first just turn on the basic Private Messages Module and we’ll start there.

You can see it does have e-mail notifications, the ability to block user messages, the ability to filter messages using tags, you can set private message limits using this module, there’s a real name integration which the real name module would basically allow you to specify a user’s real name and then of course integrates with that so you can message someone using their real name versus their user name on Drupal, you can send messages to members of a role and you can also integrate this with rules which I have some past videos on Rules and this can of course be handy if you’re using Rules for some of your different workflows on your Drupal website.

We’re just going to start with just a Private Messages Module so I went ahead and turn that on and I’m going to go ahead and first come in to Permissions and down here there will be some permissions for private messages. So I’m going to allow authenticated users to read the private messages, to write new private messages, to delete their own and reply to private messages, we won’t let them use tokens or select the text formats so we’ll go ahead and use that for permissions so basically allowing authenticated users to send and receive private messages back and forth.

Now I will come back into … and click on the Configuration so we can do a little bit of configuration here and the good thing about the Drupal 7 version of the Private Messages Module is it’ll integrates with Drupal Fields so you can configure things pretty easily here.

So here it says threads per page, you can configure page to show participants, different options there, select a number of messages, you can also go through different displays. So what we’re going to do is we’re actually going to look at the Manage Fields section and you can see that this just uses just the regular old Drupal Fields API so you can add as many fields as you want, it comes with a two which is recipient field, subject, the body so you can add multiple fields there.

I’m not going to actually do any of that because when it comes with this … pretty much covers most used cases or at least my used case in this simple example. You can also of course manage the display if you add extra fields but we’re going to go ahead and actually start by adding or creating a message here. So already went to the settings, we already went through the permissions.

Now we actually are going to create a private message … oops that’s not what I want to click. And I’m going to add this private message links to the first side bar just so I actually can see the links, you can of course add your own links once you know the path so you can use this … the links that are provided in this block so I’ll go ahead and I’ll close this. You can see now I have write new messages, I can also view my messages, I go here it says I have no messages available, I’ll go ahead and write a new message, I do have the user called “Test” and that’s the user name, you can enter multiple recipients so I’m going to go ahead and send the message there and once I send it you can see it says that it was sent by me and it says it’s a test message between you and test and come to my messages and see that it has been sent out, you can mark it as a read or unread, I can check this and delete it.

What I will go ahead and do is I’ll hop over here and log in as this test user, it says I have one unread message here in this messages section on the Drupal site, you can also see it says I have one new message, I can see that it says that it’s new, click on it and I can reply.

Once I send that it says that the Shane User which is the original user sent this message and I sent this message. Of course that works both ways if I come back it says I have a new message and you can of course send messages to all different types of users depending on their permissions of course. If I come to the user’s profile page I got here of course by clicking on the user name here but if you’d had profiles like a social network you can of course put a link here to send this user private message and it will default that user in the two fields.

So that’s really it for the basics of Private Messages, this can get you started for allowing users to communicate back and forth on your website in a private manner so that only they can see the messages so it’s good for private conversations on a website.
Go ahead and give this module a try and next time we’ll go through some of the other modules that come with private messages module and we’ll see what other features we can add for this. Thanks for watching the Daily Dose of Drupal and we’ll see you next time.

Series: PrivateMsg Basics SeriesTags: DrupalContribPrivateMsgDrupal 7Drupal PlanetEmail

Drupal 7 Node Clone Module

Jan 17, 2013

Description:

Episode Number: 88

The Drupal 7 Node Clone module allows you to easily make a copy of any node on your Drupal 7 website. This can be useful in many situations such as make a copy of content before making changes on a production site (for those that do not have a staging environment) as well as using an individual node as a template to make other nodes out of. The Drupal 7 Node Clone module is also very configurable.

In this episode you will learn:

How to use the Drupal 7 Node clone module to make a copy of an existing Drupal node Full Text: 

Hey there everybody and welcome to another Daily Dose of Drupal. As always I’m Shane, you can follow me on Twitter at smthomas3, also hop over to codekarate.com and make sure to sign up for the newsletter right over here on the left side. We’re on Episode Number 88 of the Daily Dose of Drupal today and it’s going to be a quick one. We’re going the Node Clone Module.

Generally; what this module can be used for is for I guess it sounds it up pretty clearly, it enables you to nodes. This can be useful if you have a very complex page and maybe you want to make some changes to it, it’s on a live site but you want to test those changes before you actually change on the live site so you can make a clone of it, put it on unpublished status, do all your changes and make sure it looks good and then copy those changes over or if you have a lot of nodes that are going to look the same, you can use that to kind of give a jump start so it cuts down the amount of work you have to do.

Obviously in the first situation you can use a development site and push it up through that but this is kind of a simple module that allows you to copy different pieces of content so if you have nodes and you want them to copy, not everything works as you’ll notice there’s a little warning.

If you have a really complex node type it may not clone completely cleanly, however in most cases it will so it can be a helpful little module if you just need to copy an existing node and then make changes to it. So we’re going to go ahead and take a look. I already have the Node Clone downloaded and it is installed, you can see I’m using the 7.x-1.0-RC1 version.

We’re going to start by going to the Configuration page. It gives you a couple of different options here; you can either have it pre-populate the node form fields so it doesn’t actually create the node when you click the link or you can have it actually go ahead and create the new node right away and then allow you to edit it and we’ll go over both those or you can tell if you need a confirmation when it creates a new node you can have it clone the menu links, you can set, reset publishing options for specific content types and you can also set which content types should not be cloned.

So if you have a content type that you know won’t work with this Node Clone Module you can omit certain content types here. So I’m going to leave that as a default and I’m going to come over to an article here, this is just an article content type but a couple of different fields, it has a five star rating, it has two other fields on it, one of them is hidden right now but what I can do is I can click this link that says Clone Content.

So right now it creates a Node Add Form basically that gives me all these content. It does add Clone Of at the beginning, it does load in the different fields so the status field had none, it does have the Bullian test checkbox checked, tag of test box was set correctly. So it has not actually saved the database yet until I hit Save.

So once I hit Save now it’s saved to the database and now you can see this is the Clone Of so I can go ahead and of course change things and make it a completely different copy so it’s not the same as the original as you can see if I open up the original here it looks different. It doesn’t have the extra field showing but it allows me to quickly and easily make a copy and then I can make changes of this.

Of course if I wanted to not allow other people to see the changes as I was making I can of course unpublished it and now it’s not going to show up on my list of articles but I can use it as a testing to see how an article would look after I copied it or of course just make changes or make another article based of that original one. We’re going to go ahead and check out the other configuration options just really briefly and you can see we can have it save as a new node and then have it edit.

So in this case we’ll also want a confirmation so I have this set as Required Confirmation. Now that I save this I’m going to go back and I’m going to clone this Test Article 2, I’ll click Clone Content it’s going to say that it’s creating a new node and I’ll be redirected to the edit page, I’ll click Node or Clone it clones that node, it says Clone of Test Article 2, this is now is saved to the actual database itself.

As you can see it’s on the Node 7 Edit page, it has actually already created the node on this case so even if I close out of this and I come back there’s clone of Test Article 2 which is exactly the same as Test Article 2 besides the fact that the title is a little different. It didn’t copy over any menu items or anything like that. So it’s an extremely simple module but it does serve a purpose on some sites. It’s not something you’re going to use everyday but it is something to have in your development toolkit and we’ll be back again next time with another episode of the Daily Dose of Drupal. Thanks for watching.

Tags: DrupalContent TypesContribDrupal 7Drupal PlanetSite Administration

Drupal 7 Fences Module

Jan 16, 2013

Description:

Episode Number: 87

The Drupal 7 Fences Module is a lifesaver for the HTML purist in all of us. By default Drupal adds a lot of extra markup that is not always needed. The reasons Drupal adds the extra markup is to make sure it can work out of the box for as many different requirements as possible. However, in many cases this markup is not needed. This is where the Drupal Fences module comes in. This module not only lets you choose how to structure the markup around your Drupal 7 fields, it also comes with a wide variety of completely customizable field templates.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 87. As always I am Shane Thomas and you can follow me on Twitter at smthomas3, also hop over to codekarate.com and check out the other Daily Dose of Drupal videos and sign up for the newsletter, you can also find me on Google +. Today we’re going over a pretty cool simple little module called Defenses Module and this module solves a problem and there are some of you out there who are very … who this will … you’ll definitely appreciate this module I’ll say that.

Basically it allows you to simplify some of the markup that Drupal outputs. So a lot of times in Drupal because aims to be as flexible as possible and to fit as many purposes as possible it includes a lot of extra markup.

So as you can see here’s the Drupal 7 default markup for a field. You can see there’s a lot of divs there, a lot of nested divs just to make sure that it can fit pretty much any scenario you would need. 90% of the time that’s not necessary on most sites so what defenses allows you to do is that it allow you to simplify that markup. So here’s the defenses default markup and as you can see it’s much simpler.

So we’re going to go ahead and just demo this quickly and show you how it can used so let’s go ahead and open the site up and I have a pretty simple test site here, I just created a simple content type with a couple of fields and we’ll go ahead and open up our developer tools and take a look at this one here.

So as you can here is the field, this wraps the entire fields, here is the label and this was a select field, I called it Test Select, you can see there’s then a div that’s says it’s a classic field items and there’s item lists that says 1. So all that markup just to get this little output right here.

So we’re going to go ahead and I’m going to turn on defenses module which I’ve already downloaded and save this and now that I’ve saved this module I’m going to come back over here, I’m going to open this up in a new tab so we can compare and we’ll see if anything’s changed yet.

I haven’t done any configuration so it looks just about the same. Lets’ go ahead and configure this module now; okay so you can go ahead and look at the options that I have here; it generally says if it’s a new site you should go ahead and select override on both of these.

So now that we click save we’re going to come in to our content type that I created and I’m going to go into Manage Fields, I’m going to go into this Test Select. Now as you can see while I’m in this field there’s a wrapper markup selection and there’s a big list of all these templates that you can use for outputting your fields.

So the generic container is just the div but if we wanted this to be for instance a bold you can go ahead and select Bold, we’ll save this or refresh here, you can see now it says Bold or it is bold, it still says the same thing, you can see the label is much different, it’s much simpler HTML wise in comparison so it adds the label as an H3 and adds bold around the actual value so you can see how much simpler it is markup wise.

There’s no div wrapping everything, it’s just much simpler. So you can then of course use your CSS in your style sheets to go ahead and theme this however you want. We’ll go ahead and try a couple of other ones here, we’ll go into the Test Text and select different one, you could use a paragraph format which that … we’ll go ahead and try paragraph format.

As you can see there’s a whole bunch of options and I’ll show you how you can change these options or add to this list as well here in a second. So I’ll come back and refresh this, now you can see this is wrapped in a paragraph tag. So the label is H3 and this is wrapped in a paragraph tag and it’s pretty much as simple as it gets, you can go ahead in any field then you can of course configure it however you want making it extremely easy to change the markup for this specific field and that of course keep things simpler means, you know, the page is a little bit because you don’t have as much markup, your CSS is going to be applied a little bit faster, doesn’t have as much markup to parse thru.

Just overall if you can use less markup there’s no reason not to do it. It just makes things a little bit better. So how can we modify this? Let’s say we wanted to modify this template for this paragraph tag.

Well we can hop into the module and it comes with a whole bunch of templates so I’m going to go ahead and open this up and as you can see I’m in this defenses module here, it has a bunch of files but there’s a folder called templates and inside this there’s all of these different templates that you can use.

So for instance we can go ahead and open up this paragraph template if that was in here and you can see here is the template for this paragraph. If I wanted to change this template across my entire site all I need to do is make a copy of this template, bring it into my theme and put it either in my top level or my theme directory or a theme’s templates directory, save it, I can then modify this and then all I needed to do to get it to take effect is of course clear the cache in Drupal, so it’s really pretty easy.

You can also see if you know a little bit about PHP it says if the element is inline use a span, if it’s not, if it’s above use an H3. So that of course means that if we want this label to be inline instead of making it an H3 we can go ahead and come up to our content type and go to manage display and change the label of these to inline.
Save this and come back and you’ll notice now that they are inline. You’re going to have to of course do … add a little CSS to make this look the way you wanted to. It’s not going to maybe be as nice initially right out of the box but it does cut down the markup and allows you to control how the end output looks and doesn’t leave it all up to structure of the HTML itself. So that’s pretty much it for Defenses Module.

The one last thing I’ll cover before I quit is if you go down to the bottom it allows you or tells you how you can define your own templates. So let’s say you want to add your own template to this template list; so you wanted to add a template here you basically need to follow this format down here.

You build a template, you place the template file in your theme and you use this name and can mention. Use field--defenses-name of element, you can also use field--defenses-name of element-multiple and that’s just because some elements need to look differently if they have multiple values.

So if your field has two or three values maybe you can select multiple checkbox or something for your field, you’re going to want that probably have a little bit of extra markup around it than just a single selection. So you can go ahead and try to add your own elements and once you add this, clear the cache, they should show up in that list.
So that’s all we’re going to go over today, as always you can let me know if you have any questions or follow me on Twitter if you’re not already and try this module out and see if it helps you cut down on all that extra markup. Thanks for watching the Daily Dose of Drupal, we’ll be back again next time.

Tags: DrupalFieldsContribDrupal 7Drupal PlanetUI/Design

Drupal 7 Entity Construction Kit

Jan 12, 2013

Description:

Episode Number: 86

The Drupal 7 Entity Construction Kit Module (ECK) can be used to build your own entities on a Drupal 7 website. In this long episode of the Daily Dose of Drupal, I attempt to go through what I know about the Entity Construction Kit module and how it can benefit a site builder in order to build their own custom entities.

In this episode you will learn:

An overview of Drupal 7 entities and how the Entity Construction Kit can fit into the mix Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 86. I’m Shane Thomas and you can follow me on Twitter at smthomas3, you can also go to codekarate.com and sign up for the newsletter on the left and check out the other Daily Dose of Drupal videos and blog posts.

Today I’m going to attempt to go over the Entity Construction Kit Module and attempt because I’m not going to claim to be the absolute expert on when this should be used in all cases and how it should be used but I’m going to go through it to the best of my ability and if you have any suggestions or anyways that you’ve used it I would be anxious to hear about it.

So there’s two different ways you can use it; you can use it from a site builder’s perspective or a developer’s perspective. I think the goal would be if you can do it through the developer’s perspective if you have that capability I would suggest maybe doing it that way it’s probably going to be a lot easier to maintain.

However; I’m going to go through this site builder’s perspective in this case because it’s just a little bit easier to get started with and you can get started right away. So first of all; what is the Entity Construction Kit? Well Entities are new in Drupal 7 and basically what this Entity Construction can allows you to do is create your own entities and basically you can think of it as it’s almost like a way to model your data using a little bit more like object oriented approach.

If you’re familiar with programming terminology basically it’s going to allow you to model your data in a specific way. For instance there are entities on your Drupal 7 site when you get it installed. The Node Entity, the User Entity, the Comment Entity and each of these entities has what’s known as the Bundle. The Node Entity has the Content Bundle and what that’s use for is displaying content across your site.

Many times in the past I know I have and many of you have used especially if you’re from Drupal 6 use CCK or content types in Drupal to build out different types of data that you’re going to store. In many cases it may not be suited to actually be what is considered content. If it doesn’t need a URL or commenting or any of the extra features that the Node Module allows you to have then it may need to be or maybe best to be structured as it’ s own entity and the Entity Construction Kit allows you to rapidly build those different entities out.

So there’s a lot of confusion in where you should use content types versus when you should use Entities using the Entity Construction Kit or building your own Entities through code and although there’s no hard and fast rules since there’s a lot of grey area where it could work both ways. You can kind of think of it as if it’s displaying content that you want users to see on a full page on your Drupal site then you probably are best using a content type.

If you’re just storing the data for use in other things and it’s more of just a Data Storage tool and you want to model the data in a certain way then the entity Construction Kit can often help you with that and maybe a better solution if you don’t need all the extras after Node Module gives you.

So we’re going to go ahead and get started; the first thing I would recommend you to do is look through the documentation. This isn’t a simple module that you’re going to understand all the concepts on how it works in just a few short minutes. So you may want to read through the different documentation and we’re going to go through the example that they provide here in our example so we’re going to follow along this or for the most part at least a portion of it.

So you can see what building an Entity is like. So it this example it uses Vehicles. You can think of vehicles as a vehicle may have specific types of information, in this case they mention make model and year but they also mentioned that there’s different types of vehicles. You may have a car, you may have a truck and those are two different types of vehicles and a car and a truck may not have all things that are the same.

So the things that are the same, this information here is for both cars and trucks but for instance a truck may have a truck bed. In this case it’s a different piece of information that the car would not have. So when you look at it in Entity terminology because a lot of different terminology that you’re going to hear … we can look at it this way; a vehicle is considered the entity type.

This entity type can have different properties and this … all these properties are available in all the different bundles in this case that are going to be created. All the different implementations or objects that are going to have these specific properties. So in this case the properties of the vehicle entity type are going to be make, model and year. You can notice that there’s bundles and fields. Well each entity is going to have at least one bundle generally.

In this case we’re going to have two bundles; we’re going to have bundle for cars and a bundle for trucks. And then example of node in Drupal 7 the Node Entity has a bundle of content which is used and you notice that when you build a content type you can add fields. Well when we build out the car bundle or the truck bundle we’re going to be able to add fields to either of those bundles and you’re going to build the manager just like you would on normal content type.

So in this case we’re going to need a field for Bed Type that we’re going to add only to trucks because we want the trucks to have it but we don’t want the car to have it. And entities or the individual entity itself is going to be the actual implementation of this data. So if I enter in a 2004 Ford Ranger with an open bed that is going to be a specific entity.

So it’s still maybe a little hazy or a little confusing on how this works so I’m going to go through a quick example. I already have the module installed, this is a pretty much a fresh Drupal site, you’ll see it requires C Tools and the Entity API, I have the Entity Construction kit enabled, there’s also an ECK example Module which I would recommend if you’re looking to do some of the or use Entity Construction Kit from code.

So I’m going to go ahead and go to Configure, you can also go to Structure and click on Entity Types to get you the same place and we’re going to add our Entity Type, I’m going to add the Entity Type for Vehicle. Here I’m going to specify our bundle, I’m going to start with car, we’re going to need to specify both though.

These properties are what … the properties are going to be shared across all of the different actual entities that we create. So the entity type is going to have these properties that are going to be shared across all cars and trucks. So I’m going to select Title and I could select Author, Created and Changed and it would create these, I’ll go or add these properties, I’ll go ahead and select Created and click Save.

Now it has created this entity type. So as you can see I have vehicle here; if I click on Vehicle it brings me to the different bundles. I have a bundle for car. I’m going to make sure I add my bundle for truck as well. I can go into manage properties for here and you can see that I have the title and the created.

It allows you to add new properties so you can select the different type of data you want to store and in this case I want to store text and I want this to be the make. Now these behaviors is a little confusing and it’s still be a little confusing to me but basically the behaviors are how the functionality of this property is going to work. So if I were to select change author or created, that’s going to have a different behavior necessarily on the title.

You can define your own behavior and functionality for how you want this property to react in code and there’s some documentation on drupal.org for how to do that. Because I don’t want to use any of this but I guess I’ll go ahead and select title just so the field is actually displayed but you’ll notice that this isn’t exactly ideal either but I’ll go ahead and use this and I’ll show you why in a second.

After you had add Property you’re going to want to make sure you select this box and check it so it actually gets turned on. I’m also going to say model, I’ll select the same thing, edit, check it and then save it and then I am going to select year which is going to be an integer and I’m going to select the same one; add Property and then save it.
So now all of these properties are going to be shared across both of the bundles. In this case the bundles that we have are Car and Truck. So I’m going to go ahead and click on Truck and you’ll notice this is going to look a little bit more familiar. There’s Manage Fields and Manage Display. Similar to how you build a content type. We’re going to put in Truck Bed as a Field and we’ll call this a Text Field but we can use any different type of field here as you can see because it just uses the traditional field system.

So after we get this we’ll save it, we’ll go through the defaults here and now we have a field and it’s only on this Truck bundle. You can of course manage the display for how that’s going to be displayed but you’ll notice if I go into vehicle, go into car in manage fields there is no field here. So in this entity list you can actually add data, I’m going to go ahead and do that.

You can see I have title, make and model. Looks like I didn’t actually get the year added … I forgot to check that so let me go ahead and add that. It’s a two-step process for getting this properties added. I actually have to do that and then make sure you actually check it there and now I’ll go into Car and I’ll add a Car so we’ll do 2002 Chevrolet Cavalier.

So the make is a Chevrolet, the model is a Cavalier and the year is 2002. So I save this and you’ll notice this behavior that we selected which was title. You’ll notice that the behavior requires the field to be selected, it also does some other things that makes it less than ideal so that’s why I’m not exactly sure the best way to select or have this common properties across and still use this interface but we’ll go through it and you’ll notice that the name here says 2002.

Well this is because it’s the last title behavior that’s selected so it’s going to show this field. If I didn’t have these three fields it would show this one. It’s a little confusing and like I said I’m not exactly sure why this is and I’m not sure that this is even the exact ideal way to use it but you can see that you have the various different fields and it does have the various lists of the different cars that you have.

So I’m going to add another car and we’ll go 2001 say Chevrolet Corvette. Now I’m going to go ahead and head over to Truck and I’m going to just add one truck, you’ll notice that there’s a truck bed. It’s not required because I didn’t make the field required but I’ll say this is 2002 Ford Ranger. It’s a Ford model is Ranger 2002, let’s say it’s an open bed Ford Ranger.

So we’ll click Save, you can see it’s still the same little issue here. Okay so what this allows you to do now that we have our Entity created and we have the vehicle entity and the two different bundles. Now you can of course view one of these. When you view it it says it has the different listings here; this is the title, the model, the year. If I come in to Truck and select this one it’s going to also show me the truck bed field which I can change that from the Manage Display.

As I mentioned before you may want to look into writing your own custom behavior for this property so you don’t have the same issue but one of the cool things you can do with this now is if you go ahead and download the Views Module and enable that, you can do some cool things because it integrates with Views right out of the box. So we come back in here, the Views module is now downloaded, we’re going to add a new view and this time I’m going to show Vehicle.

So let’s Vehicles and you could select if you will only show Cars or Trucks so let’s say Vehicles, I’m going to give it a path because I’m just going to create a simple page, click continue and edit. Now we can add the different fields, you can see I can add the make, the model, the title and we’ll also add the year.

I’ll go ahead and add and Edit and Delete link, let’s leave all these at the default to keep it quick and I will change this to a table so it’s just a little bit easier to get looking nice and I will rearrange this a little bit to have the ID, Title, Make, model, Year then Edit and Delete link at the end and we will save this and check out the page and see how it looks.

Now you can see I have created my entities, I have created the bundles and I have a listing of all the different data that I’ve stored, I probably want to get rid of this comma. I can do that through Views of course. And now it works with views just like any other content type would. You can display the data, you can use that in any other type of data storage and data model that you need on your Drupal site and it just allows you a little bit extra flexibility. It kind of adds that extra layer.

You’re not only just have a content type which is one layer. If you’re going to do the same thing you would have to have a Car Content Type and you’d have to have a Truck Content Type and then none of those properties would be able to shared, you’d have to have fields on each or you’d have to have one content type called Vehicle and have some type of conditional fields where you’d select what type of vehicle is this and then depending on the vehicle you’d see different fields there.

As you can see it gets confusing but using entities that adds that extra layer so you can kind of abstract some of the commonalities which in this case the make, model and year away from the bundle and put it into the actual entity itself. So it kind of adds that extra flexibility, it also doesn’t have all the extra overhead that the node system has. So if you don’t need to display it, in this case I’m just storing the data, I don’t need a specific page for each car, I don’t need comments for the car, I don’t need any of those extras so the Entity Construction Kit would work out pretty well in this example.

And as I’ve said before if you have any suggestions for how you use the Entity Construction Kit or any ways that I could be using it better or more efficiently please let me know. I’m just getting started using it and I would appreciate any feedback. So thanks for watching this episode of the Daily Dose of Drupal. Go ahead and follow me on Twitter if you’re not already and I’ll be back again next time with another episode. Thanks for watching.

Tags: DrupalCore ConceptsEntitiesContribDrupal 7Site BuildingDrupal Planet

Drupal 7 iToggle Module

Jan 11, 2013

Description:

Episode Number: 85

The Drupal 7 iToggle module is a simple module that makes checkboxes look much nicer. This module can be used on the promoted, published, and sticky checkboxes of a content type and also has modules that allow it to be integrated with Drupal Fields and the Drupal views.

In this episode you will learn:

How to download and install the iToggle module How to use the iToggle module on Node promoted, published, and sticky checkboxes How to use the iToggle Drupal module with Drupal 7 Fields Full Text: 

Hello everyone, hello everyone and welcome to another episode of the Daily Dose of Drupal. I am Shane Thomas; you can follow me on Twitter at smthomas3, also go to codekarate.com and sign up for the newsletter, check out the other posts and videos. Today we’re on Episode Number 85 of the Daily Dose of Drupal and we’re going to be covering the iToggle Module.

This is a neat little module that I just found out about recently and it basically allows you to have nice looking On Off checkboxes and you can use it either with the promoted status or publish status and sticky options on a node or content type, you can also use it on fields, you can create your own fields with the iToggle Fields Module and you can also use it in Views.

So we’re going to through those pretty quickly and take a look at all of them, I already downloaded this. After you download and installed the iToggle Module if you want to easily download the dependencies because it does have a few dependencies and you can use a handy Drush command, Drush iToggle-DL and that will take care of all that for you so you don’t have to do it manually.

So I’m going to go ahead and get started; so I already have the module here, I’m going to go ahead and install it again. So now that I have it installed we’re going to take a look at what it can do. So I’m going to pick a content type, in this case I’ll use the Article Content Type. I will come in to the Content Type’s page and you’ll see that there’s an iToggle Settings, I’m going to go ahead and turn that on, you can save that and we’ll go ahead and go to one of the article content … pieces of content and we will click Edit. If we come down now to the publishing options you’ll notice now the checkboxes are available and they of course work as you would expect nice little Yes, No checkboxes.

So all in all that’s essentially what the iToggle Module can do, is that functionality right there but it can also do a lot more so we’re going to go ahead and first look at the Configuration page. So you can see that there’s a couple of options here; we’re using the Production version, Animation Speed, we’re going to go ahead and enable Easing because we did install the jQuery Module or I guess that’s a plug-in not a module and we’ll go ahead and save that.

There’s some advance settings which you can use different callbacks and setup some Java Script but we’re not going to go through any of that today so we have that enabled and you’ll see it doesn’t … you’ll notice a huge difference but it does use the J Query Easing plug-in. And so now we’re going to go through the other modules that come with iToggle. The first one we’re going to go over is the iToggle Field.

So I’m going to go ahead and enable that, I’m now going to come into the same content type and I’m going to go to Manage Fields. You’ll notice I have added a Bullian Field here, I just called it a Bullian Test just to show what this can do, this one is just a simple On, Off checkbox, if I come to Manage Display I can now change this display to iToggle Widget and you can see it says the display types on and off, you can make it yes or no, 1 or 0 so there’s a couple of different options there, we’ll leave it as on or off, I will save it and I will come in to this test article and you’ll notice that right here it still looks the same, just a regular checkbox but since we changed the display on the front end it shows the nice little display.

It’s not clickable though so what we want to do is we also are going to add another field to this content type, come in to Article, go to Manage Fields, I’m going to add a Toggle Test Field and we’re going to select iToggle Widget. We’ll leave it at the iToggle Widget and go ahead and click Save.

Now we’re going to come in here and we’re going to make the Widget clickable, we could add Help Text, let’s change this to yes or no instead of the On or Off just to show the difference, here you can see the default value, the number of values and now we’ll save it, we’ll come back to our article page and edit this. Now you’ll notice that you can see I have the iToggle Widget. I’m going to go ahead and set this to No, I will save this and I will come to the Test Article page.

You’ll notice now that the Toggle Test is then set to No but you’ll also notice if I hover over it I can actually click on it. So now that I click that and if I come in here and edit this value again it has changed. It uses Ajax now to automatically update that value from the actual Node View page and sends it back and actually does an update so you don’t have to worry about actually editing it just to change that value.

So that’s kind of a neat little feature, now we’re going to take a quick look just really briefly of what the iToggle Views Module can do. So go ahead and turn that on and save it and I’m going to build a very simple view; I’ll call it Toggle View and I’m going to show content of type article, I’m going to create a page, I’m going to create a table of fields and I’m going to go ahead and hit continue and edit. For the Fields I’m going to add this iToggle section here and I’m going to say iToggle Promoted to Front Page, iToggle Content Status and iToggle Content Sticky and Lists. So I’ll add those … well we’ll just go ahead and leave this labels the way they are for now so you can see how it works so I’ll click apply in all three of those, I will click Save and I will view the page.
Now you can see if I want to unpromote Test Article 1 I can go ahead and just check it so I have a nice little view. So now it’s not promoted to the front page, if I come in here and edit this you will notice that it is no longer promoted to the front page. I can unpublished it here so now they’re all set to No, I come back to my View which I need to find the path to that so I’ll go back to my view here and you’ll see now it does even show up in the view because it’s not even published.

I can of course fix this in the View to make it show on published, go ahead and remove this just so the unpublished content will show up in the View so we can see this last example and I’ll go ahead and view the page you’ll see now my Test Article 1 is back, I can of course publish it by just checking that box and now my content is published. So you can see it can be really useful to allow you to easily publish and unpublished articles from nice looking interface without having to go in and click the Edit button and then scroll down and check the box and save it.

So it can definitely be useful especially if you’re doing a lot of administration with a lot of different content. I know I will be using it on future sites that have a lot of administration work that needs to be done. So go ahead and give it this module a try and let me know what you think and that’s it for this time on the Daily Dose of Drupal and we’ll be back again next time with another episode. Thank you for watching.

Tags: DrupalFormsContribDrupal 7Drupal PlanetUI/Design

The Top 10 Daily Dose of Drupal Videos of 2012

Jan 10, 2013

Description:

top 10 of 2012

I wanted to put together a list of the 10 most watched Daily Dose of Drupal videos of 2012. I am basing this list off of how many views the video received in 2012. I know this more heavily favors the older videos, but this should still provide a good list of the most watched Daily Dose of Drupal videos from last year.

Type: TextTags: DrupalDrupal PlanetTop Lists

Drupal 7 Entity Reference Multiple Display module

Jan 10, 2013

Description:

Episode Number: 84

The Drupal 7 Entity Reference Multiple Display Module extends the Entity Reference module by allowing you to differentiate the display anytime you are referencing multiple entities from one Entity Reference field. For example, if you reference 3 entities, you may want to display the first entity as the full entity, and the next two entities as teasers. This module allows you to do just that.

Note: I apologize for the audio issues with this video. Was having some issues with my microphone.

In this episode you will learn:

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 84. As always I’m Shane, you can follow me on Twitter at smthomas3, find me on Google + and go to codekarate.com and check out the other videos and sign up for the newsletter.

If you’ve been watching the Daily Dose of Drupal before you may have seen the Entity Reference Daily Dose of Drupal episode which was episode 7. This module that we’re going to go over today is the Entity Reference Multiple Display Module. It’s a relatively new module in drupal.org however it can be useful on some specific situations.

So the Entity Reference Module for a quick recap is just a way … it’s a Field type that can be used to reference different entities. So you may have one content type that you then need to reference another content type or maybe you need to reference specific users or any type of entity where it needs to go ahead and reference another type of entity and this could be used on any type of web application.

Maybe you need a CRM System where you have different content types like projects and you need to reference what type of client or which client the project is for. You could use something like the Entity Reference Field for that and there are of course many other users but that’s just one that came to my head but let’s go ahead and get started with this Entity Reference Multiple Display Module.

I have the Entity Reference Module installed right now and I added a content type called Test Entity Reference and it’s just a simple content type. All it has in it is the title and body field which comes by default and also this reference articles fields and it’s an Entity Reference Field, I have an Auto Complete Field and I have it Tag Style so it means we can reference it multiple and it’s pretty simple.

In the display right now I have it just the format is at Label so I went ahead and I created one called my Favorite Articles. So if I edit this you’ll notice that in this Reference Articles I have multiple articles, you can of course just start searching, it will pull them up and then you can use commas in between two of course Reference Multiple Articles in this case.

So I referenced those three articles, if I go to this page it just list these links because it’s referencing that these three entities are reference so I could say these are my favorite articles, I reference my three articles but let’s go ahead and say we want to actually display the articles on this page. So I can go into Content Types and go into this Test Entity reference and go to Manage Display and I can use this Rendered Entity and I can render it as a full content or the teaser, I’ll go ahead and select teaser and save it and if I come back here now you’ll notice that I have the three teasers in the order that I reference the articles in on this Edit screen.

So that looks great, however; there may be some situation where you have a list of these entities and let’s say you want this first one to be the full node and the second two will just to be the teasers or maybe you wanted the first two to be the teasers and just the last one will be the full node.

Whichever order you might want but you want these Reference Entities to be different formats. Well that’s where this Entity Reference Multiple Display comes in. So I’m going to go ahead and turn this module on and I will save this and all this is going to do is give me another option here if I go into Content Types and Test Entity Reference, we’ll go into Manage Display and it’s going to give me another format option.

Now there’s another option called Rendered Entity with Different View Modes. So now that I saved that I can then click on this or now that I selected that I can click on this little gear icon and I can select how many different groups I need and in this case I can … I’ll go ahead and say three.

The first one that I want to display is the full content and so only that one element so only the first one, the second one I want to display a Teaser and then the third and any following which you can use actually this number sign I want to display as the Search Result.

Obviously this isn’t necessarily a realistic example. Most likely maybe I just want the first one to be full content and the rest just to be a list of all the teasers but we can go ahead and set it as that, take a look at it so now that I save it I come back to this page you’ll notice it’s still my favorite articles node here and it has a list of reference articles. The first one you can see is a full node, the second one then is a teaser with a Read More link and then the third one is the Search Index or the Search Listing I guess. So if I come back here I can of course change that.

Let’s say I only want the first one to be the full content, the rest to be teasers, you can go ahead and set that and I will update and save it and now there’s a test article 1 and test article 2. You can see these two are teasers but this first one is the full content. So as you can see it’s a very simple module, it’s not something that you’re going to use on very many sites probably but if you do have something where you’re referencing multiple entities from one entity and you need to display them in different ways then … especially based on the order that you are referencing them so I reference this one first, this one is going to be a full content, the next two are going to be teasers and it’s not just limited to just full content and teasers that can of course we’ll go over the list here and the stuff that or all the different display options so you can have full content teaser RSS, Search Index or Search Result but you can go ahead and try this module out and use it if you need to render … reference entities differently based on the position that they’re referenced and go ahead and let me know if you find it useful. Thanks for watching the Daily Dose of Drupal; we’ll be back again next time with another episode. Bye!

Tags: DrupalEntitiesContribEntity ReferenceDrupal 7Site BuildingDrupal Planet

Drupal 7 Field Formatter CSS Class Module

Jan 9, 2013

Description:

Episode Number: 83

The Drupal 7 Formatter CSS Class module (not to be confused with episode #82 and the Field Formatter Class module), can be used to add a CSS class to the display of a node based on a specific value in that node. For instance, it can be used to add a class based on what the user selects for a dropdown value when creating the piece of content.

In this episode you will learn:

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 83. As always I’m Shane, you can go ahead and follow me on Google +, also find me on Twitter at smthomas3 and go to codekarate.com and sign up for the newsletter. Yesterday if you watched episode number 82 we talked about the Field Formatter Class Module.

Today we’re going over the Field Formatter CSS Class Module. So as you can tell the names of the module are very similar and they have a somewhat similar purpose but there is a distinct difference and we’re going to go over what that is and how you can use the Field Formatter CSS Class Module on your Drupal Sites.

So the Field Formatter Class Module that we went over yesterday, well this one will allow you to change or add a class around a specific field item. So for instance we can change a class around this wrapper div or give this wrapper div a specific CSS Class. The Field Formatter CSS Class Module; it allows you to change a class around the higher node so the entire node here but have it be based on a specific value set in one of these fields.

So depending on the value set and for example maybe this field or this field you can change a class that wraps this entire node. This isn’t necessarily just for nodes, it can also be used on field collections using the Field Collection Module or Fieldable Panels Panes and it works with text fields, list fields, bullying fields and taxonomy fields.
Today we’re just going to look at the list field because if you didn’t do it with the one you’ll understand how it works and you can use it with any of those 4 fields. So we’re going to go ahead and get started; as you can see I have a simple article content type with this Status Field.

I’m going to go ahead and show you how that was built; simply go to the content type and manage fields on the article content type and you will see that I have added a field for status. This is called Field Status, it’s a list field that contains text and it is a Select List Widget. I have a list of key value pairs for the allowed value.

These are Needs Review ready to be publish or article publish and this is just one example of how I thought of an idea of how to use it, you may think of many of your own once you understand how it works. In this case let’s assume that this article needs to be reviewed by multiple people so this is a separate mechanism than just a published checkbox. Let’s say maybe an editor needed to review it and change the status before someone actually change this article to publish and then check the publish checkbox. You know obviously you can use your imagination here and figure out how it could apply to other scenarios that you may need it.

The trick is you come into the Manage Display tab and you find the field that you want to be able to control the CSS Class and you change the format from the default to this new CSS Class format. So once I’ve change this and save it, now keep in mind I have added a little bit of CSS and I’ll show you and as you can see the Status Field is gone and now I have this green bar on the side which I’m just using that as a simple example of how you could use that CSS Class to give a visual indicator of the Status.

And as you can see it applies to the entire node, not just one field. So I changed it to In Review instead of ready to publish, save it, it has a different color. This is all driven off of one class. So if you look at this Div that wraps this entire node you can see it has a list of classes. Node, Node-Article, Node-promoted and the important one here Needs Review.

In this class is just that Value from that dropdown so I go ahead and change it back to Ready to Publish and I save it. Now it changes to green and you can see there’s a class called Ready to Publish on this node.

You can see my CSS right over here, I just simply have it adding a border … a green border with a little bit of adding … I just threw that together really quickly as an example, you can of course change that to whatever you might need. If I change the Status then to Article Publish I don’t have any CSS applying to this specific class so then it makes the article look normal without any bar on the side or any type of indicator. Of course we’ve changed the Field Formatter for that field back to the default.

It’s not going to have this CSS Class down here and thing will be back to just the normal way it displays with the Status Field displaying as text. So as you can see the Field Formatter CSS Class is a pretty powerful little module if you need to change the display or styling or theming of an entire node based on a specific field.

So I’m sure you can use your imagination and find many ways that this could be useful on your next Drupal Project. If you have any questions or you have any other ideas for future Daily Dose of Drupal modules, go ahead and contact me on codekarate.com and I will see you next time. Thanks for watching.

Tags: DrupalFieldsContribDrupal 7Drupal PlanetUI/DesignCSS

Drupal 7 Field Formatter Class Module

Jan 8, 2013

Description:

Episode Number: 82

The Drupal 7 Field Formatter Class module allows you to add classes to the display of individual fields that are output by Drupal using the Field API. This module is useful to help save you from writing as many lines of CSS as you can use this to implement common classes across multiple fields or even use it to differentiate the same field used across multiple content types. This is a flexible tool for those site builders or themers that need a little extra help when styling the display of their Drupal fields.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, we’re on Episode Number 82 today and as always I’m Shane, go ahead and follow me on Twitter if you haven’t already at smthomas3, go back to codekarate.com and check out the other Daily Dose of Drupal videos and sign up for the newsletter. Today we’re going to be going over another very simple module; it’s the Field Formatter Class Module.

Again this isn’t a module that you’re going to use on every website unless it’s something that you really need to use for a specific design purposes but what it allows you to do is it allows you to specify a class to be on the wrapper div that goes around any fields for any of your content types.

And basically what this is going to allow you to do is let’s say you have specific classes you want to add for a specific types of text or specific design or display purposes you can use the same class across multiple fields and you can simplify your CSS file so you don’t have to write as many CSS rules and it can just really helps simplify. This is probably not anything you couldn’t do without it in all reality but it can drastically simplify how much CSS you need to write especially if you have a lot of common displays across different fields.

So it’s a really simple module but before we get started if you were anyone you know is interested in getting an e-commerce site developed to Drupal, go ahead and contact me on codekarate.com. My development team has a few empty spots in the next coming months and we’re looking to fill a couple. So I’m going to go ahead and get started. I already have the module, the Field Formatter Class Module downloaded and installed. It also has a requirement for the Field Formatter Settings Module so you’re going to want to download that and get that one installed as well.

So we’ll go ahead and show you that those are installed. You can see the Field Formatter Class and Field Formatter Settings API have been downloaded and enabled and all these does is it gives you a simple option on the manage display page of a content type. So if we go to content types and in this case I’ll go to article, click on Manage Display, you can see that there’s no class here.

If I click on this test field that I created I can add a class. Before we look at what that does let’s go ahead and go to an article that had this field filled out. As you can see I have a field there with some text in it, if I hover over it it has this wrapper div that goes around the entire field. You’ll notice it already had a bunch of classes and this is why I said it’s not something you’re going to need in every case because a lot of times you’ll be able to use the class that are given but if you have a lot of for instance text field classes and maybe a couple of text area of classes or something with a bunch of text and you want to have one class that you can use all between all these or you can probably come over the whole bunch of ideas if you have worked with CSS quite a bit for ways to help lessen the amount of CSS you need to write but we’re going to add a class to this field just to show you how it works. So I’m going to go ahead and come into the content type’s page, go back to article and go to Manage Display.

I’m going to go over to Test Field 1 and go ahead and add a My Test Field Class. If I update that, save this and I refresh this page and come back to this wrapper you’ll notice right here there’s My Test Field is at the end of this in the classes list. This means I can of course target this with specific CSS and then maybe for this class I wanted the color to be red or some other design type of purpose.

Then in this case I could set My Test Field and have certain field item show up as red. So maybe you have a bunch of text fields and you don’t want them to all be the same but you do want some of them to have a red color, you can go ahead and add this class to a couple of them and you can of course change that.

This of course works across all your different types of fields so you could of course add it to … looks like you can add it to your tags field or even your body field, you can go ahead and add this classes, change the design based on specific fields and add a CSS to your various field displays.

And that’s really all there is to this module. Like I said it’s a very simple module, if you’re a designer or a theme developer you’ll know if you’d run into these pain points before and you will know when it’s probably necessary to add this module to your Drupal website. So that’s it for this time on the Daily Dose of Drupal, we’ll be back again next time with another episode. Thanks for watching.

Tags: DrupalFieldsContribDrupal 7Drupal PlanetUI/DesignCSS

Drupal 7 Speedboxes module

Jan 4, 2013

Description:

Episode Number: 81

The Drupal 7 Speedboxes module makes the checking and unchecking of checkboxes on your Drupal 7 site simple. The module is pretty easy to get installed and provides a draggable interface for multiple checkbox selection/deselection.

In this episode you will learn:

How to download and install the Drupal 7 Speedboxes module How to use the Drupal 7 Speedboxes module Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 81. As always I’m Shane, you can follow me on Twitter at smthomas3, you can find me on Google +, also go to codekarate.com, sign up for the newsletter if you haven’t already and check out the other videos and posts.

Also if you or anyone you know are interested in getting an e-commerce site developed please contact me on codekarate.com, my development team and I have some openings in the upcoming few months and are looking to do a few e-commerce site. So I’ll definitely appreciate any referrals on that front.

Today we’re going to be going over a simple module that’s not useful for every instance of every Drupal site that you build probably but it can be useful on some Drupal sites depending on the right context. For instance; I could see the usefulness of this module on sites where there’s a lot of forms or checkboxes especially on some sites that I build that are more business applications that are used to manage customers or projects or things like that.

If you have anything with a lot of checkboxes, the Speedboxes Module on drupal.org can help. Basically what it allows you to do is it allows a nice little interface for you to select multiple checkbox that wants a simple module, it’s relatively new, it doesn’t have a lot of downloads so go ahead and see if we can get that download count to increase a little bit by trying this one out.

So I’m going to go ahead and show you how it’s currently set up to work; like I said it’s relatively new. Hopefully it will eventually be move so it uses the libraries module or something else but currently the way it works, just go ahead and download the Speedbox Module and select the 7.x-1.2 and you also need to extract the Speedboxes Java Script and it says you need to put it in the Modules folder.

Eventually like I mentioned; hopefully this would be in its own library but it works for now, I’ll just go ahead and go into the Speedboxes Module, I will download the Zip file, unzip it and get rid of that zip file that I don’t need any more and we should be good to go. We’ll go ahead and enable the module now and the module should now be downloaded, installed and working.

So I’ll hop over to my test site that I just installed this on and we will confirm that it is in fact installed which it is, I’ll go ahead and go to the permissions page and if I scroll down you’ll notice that the Speedboxes module is currently set so only administrators can use it which is probably what you want but you can of course change it.

Let’s say we want it for anonymous and authenticated; simply click and drag, you can check all, uncheck all, check reverse so we can go ahead and easily select and unselect multiple checkboxes. So obviously this works well for the administration page, you can select a whole bunch at one time and it just works right out of the box. Very simple, very functional, you don’t have to do a lot to get it set up and it’s one of those modules that just works.

There also is a little bit of information if you wanted to just set it up somehow as a browser plug-ins across all sites, I haven’t look at that, I don’t know how that works but you can of course take a look and like I said it’s not probably you’re going to use on every site but if it’s a site where there’s a lot of administration or a lot of forms that need to be filled out and you have admins who need to go in and check lots of boxes at one time this can be a module that can just help you save some time.

So thanks for watching this short episode of the Daily Dose of Drupal and we’ll be back again next time. See you!

Tags: DrupalDrupal 7Layout Tools

Drupal 7 Legal Module

Jan 4, 2013

Description:

Episode Number: 80

Have you ever needed to add a terms and conditions page to your Drupal website? You know the legal stuff that most people don't care much about but is actually important. If so, the Drupal 7 Legal module can help.

Note: This module automatically adds a /legal page to your website. I forgot to cover this in the video.

In this episode you will learn:

How to install and configure the Drupal 7 Legal module How to manage and track Drupal 7 terms and conditions revisions Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 80. As always I’m Shane, you can follow me on Twitter at smthomas3, you can also go to codekarate.com and sign up for the newsletter.

Today we’re going to be talking about the Drupal Legal Module. The Drupal Legal Module is a very simple module in theory, it just provides you a way to have a terms in condition section on your site and allows you to easily manage that but it does have quite a few nice features for managing different revisions to your terms and conditions and making sure that every user has accepted the most recent version of the Terms and Conditions.

So I already have this downloaded on the test site here, we’re going to go ahead and turn it on. So go ahead and find the legal module and turn it on, the next thing you want to do is check the permissions for the legal module and make sure that the right users can view the Terms and Conditions and then you want to save that of course.
The next step is to actually start building out your Terms and Conditions and you can do this from the Configuration page. And what this is going to allow you to do is we’re going to basically be able to set up a Terms and Conditions and there’s a couple of different formats we can choose and once the Terms and Conditions are set up then we’re going to go ahead and run a test with a user that we’re going to go ahead and create and show how they can accept Terms and Conditions and even view a new revision to those Terms and Conditions.

So if you make a change to their Terms and Conditions and then they log in the next time it’s going to make them accept those changes before they can login to the site. So as you can see there’s a legal section here, we’ll go ahead and click on that, this first part is just an example so it says that there’s no Terms and Conditions yet so we haven’t created one.

There’s 4 different display styles; you can have a Scroll Box, Scroll Box with CSS, just a full HTML text to Terms and Conditions or a page length. I’m going to leave it at the default for now. Obviously you’ll have Terms and Conditions that are probably much bigger than this but I’ll go ahead and just paste some text in there so we can see it, you can also add additional checkboxes.

So if you needed to add a checkbox, the example to use I believe on the project page is the checkbox to say I am over the age of 18 so I’ll add an extra checkbox. Make sure that they agree to that before they can sign up to the site but you obviously put something that you can actually want them to agree to it in order to accept your terms and conditions and if you have any changes since the previous version you can add them here.

So go ahead and click Save, now you can see here’s an example of how it’s going to look. If we go ahead and change the style I believed it changes it up there. Also note that it tells you the version ID and when it was created. So we’ll save that, that didn’t really change much I guess.

The other thing to make sure you do have installed the Views Module because what it’s going to allow you to do is view the terms and condition history, it tells you the additional changes, the data was added, it also tells you to a list of all the users that have accepted the terms and conditions.

So what I’m going to do is I’m going to login as a different user to the site, actually I’ll create a new account so I’ll start from the beginning. As you can see here’s the Terms and Conditions, if I come back to the other browser I’ll go ahead and change the scroll box a little bit and save that so we can see what design changes have effect, you can see that caps the height and gives me a scroll box so it looks a little cleaner that way.

We can also do HTML text but that’s just going to display the entire thing and the page length is just going to give you a link so I’m going to keep it the way it is and I’m going to go ahead and sign up for an account . So test Terms and Conditions, so now that I accepted those it sends me the e-mail with the welcome message since I don’t want to go grab that e-mail, I’m just going to hop in here and reset this user’s password so I can login quickly.

Obviously I can take that e-mail and login as I normally would but I’ll just reset that so I can get in so now I’ll go ahead and login. You’ll notice that when I come to my account and I edit, it’s going to show me the terms and conditions that I’ve accepted. So that works pretty well out of the box but what’s interesting is now when you come in and you’re actually able to change the terms and conditions. So let’s say I need to add a new section to the Terms and Conditions; So I add a new section in there and then I go ahead and … as you notice before I saved it, it says I’m on Version 1, it tells me the specific date it was created.

Once I save this it sets me on Version 2, updates the date and as you can see now the new section is in there. What this then allows you to do before we jump over we’ll go ahead and take a look at the accepted page, you can see that it says this user’s test terms … it should be Terms and Conditions, test TOC, this Version 1, revision 1 and tells me when to accept it and also if I go to the history I can see the first version and the second version here.

So now if I login we’ll go ahead and logout and then log back in as this user you’ll notice it brings me to a Terms and Conditions page, it also gives me a changes list which gives me a bolded list of all the lines that I added so it says I added a new section to the terms and conditions, it allows me to review it, I then have to accept both again, confirm it and also there’s a warning there that I’ll take a look at but if you go ahead and come to the other page you’ll notice that it’s back … looks like I’ve accepted it because I have … it is the newest version with the new section and everything works.

I come back over to the accepted page and now it says that I accepted the first version, I also have accepted the newest version which is the second version. So it’s a relatively simple module but it does do an important thing especially if you need to have a legal section of Terms and Conditions on your site and not just have the text there but actually want the user to have to physically accept it then this is the module that’s going to get that job done for you. So go ahead and take a look if you haven’t already and thanks for watching the Daily Dose of Drupal and we’ll see you next time.

Tags: DrupalDrupal 7

Drupal 7 XML Sitemap module

Jan 3, 2013

Description:

Episode Number: 79

The Drupal 7 XML Sitemap module generates an XML sitemap and can be configured to submit it to the Google and Bing search engines. This can be useful to help balance your SEO strategy by assisting search engines in indexing and crawling the content on your Drupal 7 website.

In this episode you will learn:

How to configure the Drupal 7 XML Sitemap How to set up the XML Sitemap to be submitted to Google and Bing How to include Content, Menu, Links, and Taxonomy in your XML Sitemap Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 79, I’m Shane as always, you can follow me on Twitter at smthomas3, you can also go to codekarate.com and check out the other Daily Dose of Drupal videos, sign up for the newsletter and check out the other blog post and see what’s going on over there.

Today we’re going to be talking about the XML Sitemap Module. The XML Sitemap Module basically allows you depending on whether you want your post, your content of your site, your users, your taxonomy, your menus, any of that different type of data or pages or anything that you could submit to the search engines for them to index can be done to this XML Sitemap Module.

Basically it builds an XML document that is then submitted to the search engines, in this case we’re going to submit it to Google and Bing and that helps the search engines better index your site. So we’re going to go ahead and get started; I have our test site here, I’m going to go to the modules page, I already have the XML Sitemap Module downloaded, I’m going to go ahead and start turning some of these on.

I’m going to show you quite a few of them, you don’t necessarily need them all, just determine based on your sites which ones you need. For instance if you don’t have user accounts or user profiles you probably don’t need this Sitemap User Module but I’m going to go ahead and turn.

The first one on which is XML Sitemap, that’s the based one that’s needed, I’m also going to turn on XML Sitemap engines because you can’t do much without that one, I’ll go ahead and turn on the menu, node, taxonomy and user. And each one of these is responsible for adding items to the sitemap based on obviously this 3rd name here; menu, node, taxonomy or users from your Drupal site.

So go ahead and hit Save, I’m not going to go over the XML Sitemap custom but I will go over thus basic ones. So we’ll go ahead and come back and you’ll see there’s obviously Configure links, I’ll go ahead and click on the Configure link here. You can see there’s a URL for Sitemap XML, there’s currently nothing there, it’s never been updated, you can see a couple messages up here. It says there’s a couple of problems with this sitemap configuration. First; in order to list user profile links on the sitemap, anonymous user must have the View User Profiles Permissions so I’m going to go ahead and set that.

So if I scroll all the way down anonymous users are going to need to be able to view user profile in order for the search engines to actually be able to index them. So go ahead and save that and we will come back to the XML Sitemap page and now you can also see the XML cache files are out of date so you need to run Cron manually to regenerate the files. So click that link and let this run, you can see now it has been updated.

This time it tells you there’s one and has one page. So you can of course edit it but doesn’t let you do anything with it right now, you can delete this sitemap but basically; we need to figure out why there’s only one page here. So what this allows you to do is it allows you to change the settings based on what you want included in this sitemap. So a couple of options here for the minimum sitemap lifetime, it says the recommended value is one day but you can change that based on the need of your site, there’s also some advance settings that you can go through.

Most of these you shouldn’t have to touch generally and here’s where it gets interesting; here’s where you can actually set different settings for what’s included in your sitemap. So by default the front page is always included and it’s the highest priority, you also can set how often that generally changes and all the priority in the change frequency values do is basically tell or inform the search engines which content on your site issued index or crawl first.

It doesn’t really have any ranking or it doesn’t really have any ranking at all on how your pages appear in the index or when someone searches for example your front page isn’t necessarily going to show up higher than a more specific page just because of your priority but it is a good rule for which page will be indexed and crawled first by the search engines. So we’ll go into Menu links; let’s say for instance we wanted to include our main menu in the XML Sitemap.

You can simply click here on Main Menu, change the settings to include it, we can give it a priority whatever we want and click Save. Now you can see when we come back it’s been included, it tells you that there’s one available, zero have been indexed and zero are visible. You can do the same which each different content type; you can come and click on the article.

All this does is bring it to the content type edit page, that’s the same as going to structure content types and clicking on the edit link on the article content type, we come into this sitemap settings and you can change this to include it of course, you can change the priority to whatever you want depending on how you want the search engines to index your site and you can save it.

So we’ll come back to the XML Sitemap configuration, you can do the same with taxonomy. As you can see it’s very simple; you basically set what you want to be included in this sitemap and then of course you can do the same with users. The other thing you need to look at is the search engines. This tab allows you to select which search engines you want to submit the sitemap do.

So I’m going to select both, say that I don’t want to submit more often than every day and only submit if it’s been updated, so I’ll save that. Another thing you may want to consider doing and I would recommend is going to either Bing Webmaster or Google Webmaster Tools and making sure that you submit your sitemap through those tools and I go over those or the basics of those in the site verification module Drupal video so if you want to take a look at that I don’t really touch on submitting a sitemap of course but I touch on using those simple tools or those webmaster tools to help get your site verified with the search engines. So let’s go ahead and come back to rebuild links. It says the sitemap is up to date and it doesn’t need to be rebuilt but I’m going to click rebuild anyways just so you can see what it does.

You can see it has three links one page, if I click on it it will then show me this sitemap. It says there’s three URL’s in the sitemap and of course this is the human readable CSS file that is in these settings here. So you can turn that off and that should I believe make it, I guess it doesn’t but basically you can change that settings to include a style sheet for humans. So as formatting and tables and makes it easier to view the sitemap instead of just viewing the raw XML.

Search engine of course don’t care about the style, they just care about the XML data so you don’t have to worry about that either way, I usually just leave it on. So that’s really all there is to it, it does a lot but really it’s simple. All it does is it generates and XML file but it can work with your nodes, your menus, your taxonomy, your users. So go ahead and give it a try and start submitting your content to the search engines through an XML Sitemap I highly recommend it on almost all Drupal sites.

I used it on almost all Drupal sites in which I want to get organic search traffic from the search engines. So I’d go ahead and give it a try and see what you think. As always; follow me on Twitter and let me know if you have any questions. Thanks for watching the Daily Dose of Drupal.

Tags: DrupalDrupal 7SEO

Top 3 Drupal Site Administration modules

Jan 2, 2013

Description:

If you find yourself administering or managing a Drupal 7 site, there are a few modules that can quickly make your life much easier. These Drupal 7 modules were selected based on the following criteria:

The module makes something easier for the person in charge of managing the Drupal 7 website by simplifying some task (or set of tasks) Type: TextTags: DrupalContribDrupal 7Drupal Planet

Drupal 7 Are You a Human PlayThru Module

Jan 1, 2013

Description:

Episode Number: 78

Are you sick of the same old Captchas? If so, the Drupal 7 Are You a Human PlayThru module is a good alternative to the traditional captcha on a Drupal 7 site. The module basically uses a simple game to verify that the site visitor is in fact human and not a bot.

Note: If you run into an issue that does not display the game and gives an error message. Uninstall the module, then re-install. Make sure to enter the publishing/scoring key first, followed by the form id's. These steps seemed to work for me.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal and welcome to 2013, today we’re on Episode Number 78. As always I’m Shane, you can follow me on Twitter @smthomas3, you can also go to codekarate.com and watch the other videos and sign up for the newsletter.

Are you sick of the same old captchas? Where you have to show up a fill in this wiggly text and hope when you hit the Submit button or the Save button that you got it right. Well if you are then perhaps you’d be interested in Are you a Human Play Through Module.

This is available on drupal.org and it basically takes the typical captcha and turns it into a simple game in order to verify that you are in fact a human. So we’re going to go ahead and get started, I already have this module downloaded and installed on my Drupal 7 test site.

As you can see here I’m going to go ahead and click the Configure button. The first thing you’re going to notice is you have to enter your form ID’s for any form that you want but you also need to enter a publisher key_key and you can get this from the areyouahuman.com site, you’ll have to create an account, it is free for the basic versions so you can go ahead and get started with that without having to pay anything.

So I’m going to go ahead and enter in a site and I’m not going to follow the download instructions here of course since we already have the module, I’m just going to click on the dashboard page where it list my publisher key and the scoring key in this right column.

So I’ll come back in here and enter in both of those values and I’m also going to pick a form and as you can see you do need to know the form ID of the form, I’ll just pick the User Login form for now, we’ll go ahead and click the Save Configuration button, I’m also going to add the User Login Block form and I’m going to save that. We’ll go ahead and give this thing a try quickly, I’m going to start by letting the page load here for a second and I’m going to logout and I’m going to log back in.

And as you can see it pops up the little light box here and ask me to prove that I am human, I go ahead and hit start, it says “Place the food in the refrigerator” so I have to find out obviously the ones that are food, it verifies that I am a human, I can go ahead and hit continue and it uses HTML 5 and it falls back to flash only on older browsers. So that’s how that works. Let’s say for instance you do not know what this Form ID is or this form here.

There’s two options; you can come in to the Settings and there is a check box that displays the Form ID or the current form so you can check that and hit Save, now you can see that it displays the Form ID’s of both the Search form and the Mailchimp form for the newsletter, you can also use your developer tools in your browser, find the form itself and look for the form element or form input with the Form ID name and you can find the value here so you could grab it from this area as well.

We’ll go ahead and turn this off for now so we don’t have that message popping up in every page. But as you can see it’s incredibly simple to add too many forms on your site. I did run into a few small issues with it where the game wouldn’t work and I think it depended on making sure I had the publisher key first and then adding the Form ID’s and once I did it in that order it seem to work fine but if you do run into that issue I simply uninstall the module and reinstall it and everything seem to work.

So go ahead and give it a try and you can have users play a little game rather than trying to fill out a captcha in order to prove that they are in fact human. Thanks for watching the Daily Dose of Drupal and we will be back again next time with another episode.

Tags: DrupalContribDrupal 7Drupal PlanetSpam Prevention

Drupal 7 Automated Logout

Jan 1, 2013

Description:

Episode Number: 77

The Drupal 7 Automated Logout module makes it easy to logout users of your Drupal 7 website automatically after a set amount of time. This can be useful for security purposes to help prevent unauthorized access from other individuals that may be using the same computer. This module also has some extra features to allow timeouts to be configured by role and even some settings that can be configured on an individual user basis.

In this episode you will learn:

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, this is Episode Number 77. As always I’m Shane, you can follow me on Twitter @smthomas3, you can also go to codekarate.com and check out the other Daily Dose of Drupal videos and sign up for the newsletter if you haven’t already and stay tuned for upcoming courses on Drupal and other web development things.

Today since it’s the last day of 2012 we’re going to go over something very simple but very useful for certain websites and the module that we’re going to be going over today is the Automated Logout Module. In fact the trickiest part of this module is actually just choosing which version to use.

As you can see there’s the 7.x-2.0-beta one version which is the recommended release but there’s also the 7.x-4.0 version that’s another other release, there’s also the 4.x-dev which is the version that I am using in this demo. I’ve tried all three of the versions that are here for the 7 or at least the top three versions for Drupal 7 and I’ve been able to get all of them to work for just a simple situation of logging a user out after a specific set of time but you may need to of course try the ones out and figure out which works best.

We’re going to go ahead and get started with just a very simple example; we’ll go ahead and login to my test site here, I already have the 4.x-dev module installed so I’ll come in to the auto logout settings and you can see the configuration page is relatively straight forward. First you’re able to set the time out in seconds, I’m going to set this to 60 so we’ll keep this nice and short. This is the max time out settings and I believed this setting is used because there’s a setting on a user’s account page which I’ll go over.

I think this is the max value that can be entered in that field, we’ll go over that after a couple of seconds here and the time of padding is how many seconds to give a user after the nice little logout dialog window comes up, warning the user to about to be logged out.

You could also set a role timeout which is what I’m going to do. I’m going to set that all authenticated users are going logout after 60 seconds; you could also vary the roles depending on if you had multiple roles on your site but I’ll just keep it simple and say just authenticated users which in theories all logged in users after 60 seconds. Where we want the redirect to go? To the login page of course and the message to display in the dialog window, you can also enable logging and enforced the logout on admin pages like the one that I am on right now.

We’ll go ahead and give this a save and we will logout and login as just another authenticated user just to give it a true test and while this is waiting here for approximately I minute just take … I’m just going to take some time to remind you that if you’re using a dev version of a module or an alpha or a beta version for that matter just be prepare that not everything may be as it should be or there may be bugs, there may be issues or new features that you think need to be added. Just keep in mind that you should check the issue queue on drupal.org and see if your issue or your feature has been requested and you may find a fix there or you may have to post one yourself, just make sure you’re doing adequate research ahead of time before you are posting your own issues.

As I’ve mentioned before I’ve been able to get all of the modules to all three versions that I tried to work however I would usually recommend going with the newest version and as you can see we now got our session is about to expire and you want to reset it, I can click Yes and it will continue my session.

If I would click no it would bring me to the user login page. But as I was always mentioning I generally tend to use the newer version so in this case the 4.0 just because in general this isn’t always true but in general it’s going to be the more supported version going forward into the future.

So if it has all the features you need I generally like to use the newer version because that’s generally where the feature is going for the module. I’m going to go ahead and log back in as the Admin User and just show you one other small thing. In each users account there is a … your current logout threshold. So this is how many seconds the user has to respond to the logout dialog before it ends their session and this can be configured on a per user basis if the permissions are set accordingly.

So if you come into permissions there’s Automated Logout Permissions. You can allow users to change their own logout threshold and I haven’t tested this portion so I can’t vows that it is working, I’m assuming it is but if it’s something that you’ll need on your site you’ll have to give it a test and try it out. So that’s really all there is to this episode of the Daily Dose of Drupal and we’ll be back again next time in 2013 with some more exciting episodes. So thanks for watching and sign up for the newsletter if you haven’t already. See you next time.

Tags: DrupalDrupal 7

Drupal 7 Backup and Migrate module

Dec 29, 2012

Description:

Episode Number: 76

Backing up your website data is extremely important, however often times this backup process is forgotten until the day comes that it is needed. The Drupal 7 Backup and Migrate module makes this process extremely easy to implement and I highly recommend using this module if you are on some type of shared hosting or a server setup that makes it difficult to implement proper backups.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 76. As always I’m Shane, you can follow me on Twitter @smthomas3, also go to codekarate.com and sign up for the newsletter and if you’re on Google + you can find me there as well.

Today we’re going to be talking about primarily used for people who would administer Drupal websites and the module that we’re going to be looking at today is the Back-up and Migrate Module.

Now I’ve used this on the past, I don’t use this on every site because I do have a lot of back-ups from the server of level but if you are one of those people who are using shared hosting or something like that and you can’t really control the server, you can’t setup your own backup system the way you want to, the Back-up and Migrate module is just a fantastic module for being able to do that.

Let’s go ahead and get started and we’ll walk through some of the basics, I’m not going to go through all of it because it allows you to do quite a bit. It’s all based around being able to just back-up the database on your Drupal website and it allows you to do things like schedule back-ups, there’s even helper modules that you can look at for encrypting your back-up files, you can store the back-ups on the server or you can request it and have it downloaded so you can actually have a back-up file downloaded to your local computer.

So a whole bunch of different options here; we’re going to go through a few of them today and you can explore the rest yourself. Today we are on a test site here, just pretty basic, not a lot of content. I’m going to go ahead and hop over to the module’s page and show you that I already have the Back-up and Migrate Module installed.

Go ahead and you can check out the permissions here. There are quite a few permissions for the Back-up and Migrate module; there are permissions to access the Back-up and Migrate Admin section, perform a back-up, access back-up files, delete, restore and administer the entire Back-up and Migrate module. So you’re going to want to take a look at that and see who you want to allow to be able to access that.

Generally you’re just going to want administrators to be able to do that kind of stuff but it’s pretty flexible. We’ll go ahead and click on the Configure link here and now you have bunch of options here and a bunch of different menus.

The first thing you can do is do a quick back-up. Basically it’s going to back up the default Drupal Database and you can have it downloaded to go to the backup’s directory in the default settings. So I’m going to go and click Download and I’m going to let that run for a second and as you can see it has already pop down here, it gives me a file which I can open up.

Let me go ahead and pull this over here so you can see it and as you can see it gives me a g-zip of the actual database file. So I can save that and let’s say I want to come back and re-upload that or restore it. I just click Restore, choose the Back-up file and I’m ready to go.

So we’re going to go ahead and give that a quick test just to show you how that works. I’m going to come in here and I am going to add a new piece of content so I’m going to add just another test article here, I’m not going to spend a lot of time on it because it’s going to be going away here in a second, so I went ahead and save that.

Now if I come back into the modules page, find Back-up and Migrate and click Configure and I click Restore, I’m going to go ahead and choose the back-up options here, let me go ahead and find it, there it is and I hit restore now and it should go ahead and restore the file, you can see it gives you a little bit of information here, it also gives you a warning restore and we’ll delete some or all of your data and cannot be undone so it says always test it on a production server.
You can also force your site to go offline during that process which is potentially useful especially if you’re doing it on a live site. But now if we come back to the homepage you’ll notice that there’s still only two articles.

That third article that we just created is now completely gone just because we restore that back-up. So that’s how simple and easy it is to just roll back to another point in time using the back-up and migrate module, you can also do a lot more of it so let’s go ahead and take a look at some of this other tabs.

The Destinations options allow you to specify different destinations. There are two already setup for directories; one is the Manual Back-up directory so if you manually back it up it will be drop in this location on the server. So it says private back-up_migrate/manual. In case you’re wondering what the private actually means, I’ll show you that here in a second but the scheduled back-ups directory is very similar, private back-up_ migrate/schedule, it’s also the destination of the actual database itself. That is being backed up. So here in mine it looks like that, yours will probably look different especially if you’re running it on your own local host.

You can add another destination, you can add a server directory on my sequel database, you can even specify FTP directory. So if you want the back-up to be dropped in to a specific FTP location, you go ahead and fill out that information and you can specify that as a back-up directory, you can also use Amazon S3 although it does require if you read the note here it does require the installation of another library I’ve never used it but it’s very cool concept, you can have an Amazon S3 bucket and have all your back-ups to be stored in that one location and you can also have it sent through e-mail.

Probably not good for extremely large databases but if you have a simple site and you just want it e-mailed to you maybe every week or every day you can go ahead and specify e-mail location just by giving an e-mail address and just a name for your own preference and for your own use to have it show up here in this table.
Okay so now that we know what the destination are I’m going to go ahead and show you what this private means, if you come over here to the configuration page and click on file system it’s going to specify the public file and private file system paths so you can see that in my case the private file systems in the sites test.codekarate.com private files directory.

So I’m going to go back and I’m going to create a back-up and I’ve already done one so I’ll just do another one here and I’ll back it up to the manual back-ups directory and this is going to take a little bit of time but while I’m at it I will go ahead and pull up the website here. So you see it was in private files back-up migrate and then manual for the back-ups directory.

You can see that currently there’s one in here that I did earlier and as soon as this one is done backing up there will be more files that will be dropped into this location, it takes a few seconds here so you’ll see now that this has been created, I should be able to refresh here and you can see now there are more files in here that were manually backed up to this manual back-up directory, you can see I now have a message here saying the default database is backed up successfully, it gives you the name of the file and it tells you the destination, it also allows you to download that, restore it or delete it.

So now if we come into Destinations you go into the manual back-up directory, we can go ahead and list the files and it lists those two files and allows you to download those files from the server or restore them or delete those back-ups. So it’s already extremely useful but there’s even more. You can set up specific profiles, so when you’re backing up and you’re doing an advance backup you can specify the file name, the time stamp format, what type of compression you want to use, you can specify if you want specific tables or data to be dropped from tables so in this case by default it drops all of the cash tables, it also drops the washdog table which is all you logging so it doesn’t store the data of that in the backup, you can also have it send an e-mail if there’s a backup successful or a backup error, it also take the site offline.

So all these different options that you can set during an advance backup. The Profile section allows you to take it a step further and save that information into a profile which you can then use either during your scheduled backups or during your manual backups. So if I wanted to say … let’s say I wanted to use the default but I wanted the watchdog directory to be included for some reason on the watchdog data and the watchdog table.

So I’m going to uncheck this, I held control there to make sure these other ones are still selected and let’s also say I want to be notified if there’s a back-up error so this have it send an e-mail. So I go ahead and save the profile, now there’s a logging profile in the default settings. So now if I go to a backup you can see I can use this logging profile instead of the default settings.

The last thing that we’re going to go aver quickly is scheduling. This Schedules tab allows you to add a schedule. So if I want to create a schedule called Daily Backups I can select either my default settings or my other profile or leave it leave it a default, you can say backup every one day, you can specify how many backup files to keep you can also specify what destinations.

In this case that creates a schedule backup directory so I’m just going to go there, let’s say you only want to keep 30 backup files so this will in theory keep 30 days worth of data and it will then start deleting those each time. So we can go ahead and save the schedule and now if we run cron that should go ahead and create that backup.

So I’m going to hop over to the command line and run cron here and hopefully if everything is working correctly it should just create this backup, I’m assuming it’s going to create on the first cron run of the day and then the next time after midnight the next day … the next time cron run it should create a backup again.
So this will probably take a little bit of time to run so as I mentioned before; go ahead and follow me on Twitter if you’re not already, check out Google + and hey if you’re bored go ahead and mention me on Twitter and ask me a question or something like that. I usually try to get to them as quickly as I can, sometimes it takes a couple of days, sometimes a week but I generally do get to it eventually and while we’re waiting we’ll go ahead and open this up, you can see that a scheduled directory was created, this wasn’t here before and you can see that there is an info file created, the backup file is still on process or being created so it’s still spinning through that cron run and as soon that this is done it should be good to go.

Okay it looks like it’s finish now so if I refresh you can see the backup file is now been dropped into this schedule directory and as long as you have cron setup on your website this backup is going to be running, it’s going to be dropping those into that folder I can of course specify different destination, have it e-mailed to me, have it dropped on Amazon S3 or through FTP.

The other thing that you might want to consider is using the one of the contributed modules listed off this page to actually encrypt the backup file so someone can’t take your backup file and take all the information off of it without being able to decrypt it. So those are all things you can take a look at and as I said; this is a very useful module especially if you dint have something setup for backups already, it makes it really easy to restore to a past time and I highly recommend you use it on your Drupal sites if you need it. Thanks for watching the Daily Dose of Drupal and we’ll be back again next time.

Tags: DrupalDrupal 7File ManagementServers

Drupal 7 Site Verification Module

Dec 28, 2012

Description:

Episode Number: 75

An important aspect of running a website is getting traffic from search engines such as Google and Bing. While not all websites receive traffic from search engines, a large majority depend on search engine traffic. One way to help make sure the search engines are adequately crawling and indexing your site is to verify your site on Google Webmaster tools and Bing Webmaster. The Drupal 7 Site Verification module makes verifying your Drupal 7 website on these search engines simple.

In this module you will learn:

Full Text: 

Hello everyone, hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 75. As always I’m Shane, you can follow me on Twitter @smthomas3, you could also go to codekarate.com and sign up for the newsletter if you haven’t already, you can find me on Google + as well.

Today we’re going to be going over the Site Verification Module. This module basically allows you to authenticate or verify your Drupal website with various search engines. The two ones that we’re going to go over today are Google Webmaster Tools and Bing Webmaster and the reason that you might want to do this is because by verifying with the various search engines they provide metrics, they provide notifications or reports, things like that, they can help you ensure that your site is adequately getting index and crawled by the search engine bots and basically this allows you to ensure that everything is going smoothly, people are going to be able to find your site and that your site is working the way it should at least in the search engines eyes.

It’s really easy … this module is extremely easy to get going with; I already have it downloaded and installed here on the test site. All I’m going to do is I’m going to the module’s page, just scroll down and I’ll show you that I do have the site verification module installed, I can go ahead and click on configure and there’s just one very simple to use interface. Basically you click the add verification button, you select the search engine, we’ll go with Google.

This is going to give you three options for verifying in this case. You can either create a meta-tag which is going to actually add a meta-tag HTML element to the homepage of your website and this one option for verifying with Google, you can upload the verification file that Google allows you to grab or you can just paste in the contents of the file and this module will create it for you.

So there’s three different options. And the way this works I have Webmaster Tools at my Google account opened up here and I created a new site that I am going to verify and obviously I don’t know on this domains so I’m just going to show you the steps, you will of course be able to actually get it to verify assuming your site is live. So after you add a site to Webmaster Tools it’s going to give you this page.

The recommended method is to download this verification file so you can go ahead and click that and as you can see if I opened it up it’s just a little bit of or a little snippet of text, just a simple HTML document so I can go ahead and download that and I could upload it using this right here, I can also take the contents that I saw on other page, paste it in here, grab the document name from here and paste that here and that would work as well or I can use an alternate method here of an HTML tag, you can also use your DNS or your Google Analytics account as well.

Basically if I want to use meta-tag I take this entire line, copy that and I go ahead and just paste it in here up top, go ahead and click Save and now that has now been added. Now in order to get this to work I simply leave this selected, click Verify, Google will do its sting and look at the site and confirm that it is showing up on the homepage. So that’s how simple it is to do or to setup the Google Webmaster Tools.

Bing is pretty much identical. Once you add the domain to your Bing Webmaster account it’s going to have you or give you the ability to play some XML file on your web server and this one is going to be called Bing Site Auth.XML. So instead of an HTML file Bing uses and XML file but it’s the same process.

You can also see that down below it gives you a meta-tag if you’d prefer to use the meta-tag version. I’m going to go ahead and use the XML version and we’ll just going to open that up here and you can see here’s the Bing Site Auth file so I’m going to copy this contents of this file and I will paste it in down here, I will then grab the site name or the filename that needs to be uploaded and I will add that here and then I’ll go ahead and click Save.

Now you can see that Bing has been added, has a verification for Bing Site Auth.XML and of course they will allow me to click on this and actually see it. Google is the same way except that it uses a meta-tag instead of a file and that’s all there is to it. I can come down here on Bing, just go down and click Verify and it will go ahead and go to the verification process.

It doesn’t get much simpler than that, it’s incredibly easy to get set-up. Like I said; this can be very helpful for ensuring that you can verify that the search engine are adequately indexing your site, it’s going to notify you if there’s any crawl areas for your site, it might help you find broken links.

There’s a whole bunch of different reasons you want this especially if you’re depending on search engine traffic. So go ahead and give it a try and let me know if you have any issues or if you have any other suggestions for future videos. Thanks for watching the Daily Dose of Drupal and see you next time.

Tags: DrupalDrupal 7SEO

Drupal 7 Mailchimp module

Dec 26, 2012

Description:

Episode Number: 74

Do you need to create an email newsletter or email subscription signup form on your Drupal website? If so, the Drupal 7 Mailchimp module along with an account on mailchimp.com is a great place to get started. In this episode I go over how to create a simple signup form using the third party email newsletter service, Mailchimp along with the Drupal module.

In this episode you will learn:

How to install and configure the Drupal 7 Mailchimp module Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 74. As always, I’m Shane, you can follow me on Twitter @smthomas3, you can also go to codekarate.com and sign up for the newsletter.
And speaking of newsletters that’s exactly what we’re going to be going over today. How do you create a newsletter list or an e-mail subscriber list on your Drupal website?

There are many options and the one I’m going to go over today is using the Drupal Mail Chimp module with integration into mailchimp.com which is an e-mail marketing and newsletter delivery service.

There are many other options such as constant contact, campaign monitor and many others for third party services, you can also use simple news which will create a newsletter subscription framework on your Drupal site without using any 3rd party services at all and I may go over that in a video in the future but today we’re going over Mail Chimp. So if you want to use Mail Chimp you have to sign up on mailchimp.com.

It is free I think up to 2,000 subscribers and so many e-mails, I’m not sure exactly I used the free version for codekarate.com and it’s big enough for me right now so it can get pretty big depending on what you need and for most people that will be free to use unless you get a very big list going.

So go ahead and sign up there and then download the Mail Chimp module. You’ll also need to download the Entity Module as well so make sure you get those two downloaded, we’ll hop over to test site here and I will look on the module’s page and you can see I already have the Entity API and Entity Tokens Modules downloaded and installed, I’ve also turned on the Mail Chimp Module and the Mail Chimp List Module. I’m not going to go over the campaigns module today, I’m just going to focus on the Mail Chimp and the Mail Chimp Lists.

After you sign up on mailchimp.com you’re going to go to your count section and you’re going to need to create an API key then you’re going to click this button and paste that API key on that page, so that’s the first step. Once you get that far you’re going to be able to start importing your lists.

So you click on the Configure for the Mail Chimp List Module and we’re going to add a list. Basically; you have to map the list from Mail Chimp to your lists you want to pull down onto your website. So on mailchimp.com you’re going to go in and actually create a list so we’ll go ahead and say this is a test list. As I mentioned before you’re going to have to create one on mailchimp.com first.
Since I want anonymous users to be able to sign up I need to select free form, you can also make users double opt in so that means they’ll get an e-mail and they must also confirm that. As far as Roles, I want anonymous and authenticated roles and then I have to select the list that I want.

So as I’ve said here if the field is empty you’ll need to create a list first. If you create a list on Mail Chimp that is not showing up just go ahead and clear the cache and then it should pop in, I’m going to select my test list, you then need to select different merge fields.

So here it’s going to allow you to select different fields so you could create a field on your user account for first name and then you would be able to map this field and then you can create a field on your user account for last name and map that field as well and basically that will map the first name and the last name fields to the first and the last name fields on your user account, we’re going to go ahead and just leave those at the defaults though.

And now I have a test list, you can of course refresh list that’s going to do the same thing and pull down any new list that you have instead of clearing the cache which also works. Now this should allow us to begin creating a block … a subscription block that we can add to our site.

So let’s go ahead and check that that is available now. Now you see that the Mail Chimp subscription form and it is using the test list so let’s go ahead and put this on the first side bar and we’ll put this up just below the search form and we’ll save that and then check it out. As you can see there’s a Subscribe to Test List and this is just pulled from our description.

Now if you come to the site as an anonymous user you’re going to be able to see the sign up form, you can of course sign up, now it’s going to say that I’m going to get an e-mail, I’m going to build the click that link and confirm and I am signed up for the list.

So it’s that simple to go ahead and get signed up or set with a newsletter subscription service like Mail Chimps using the Mail Chimp Module, you can also look at the campaigns if you want to actually pulling your campaign information, that can be definitely a handy tool to have on your Drupal site but as I’ve mentioned and as you just seen it’s very easy to get set up and going and now you can use Mail Chimp to send e-mails to all the people who sign up to your site and to keep in contact with them. Until next time, thanks, for watching the Daily Dose of Drupal, see you later.

Tags: DrupalDrupal 7Email

Book Review: Drupal Search Engine Optimization

Dec 23, 2012

Description:

If you are building a Drupal website, you almost certainly want people to find your Drupal site. This is where Search Engine Optimization (SEO) comes into play. The Drupal Search Engine Optimization book from Packt Publishing aims to help Drupal website developers craft and implement a Search Engine Optimization strategy while looking at specific Drupal 7 modules that can help throughout the process.

The relatively short book contains just five chapters covering the following topics.

Type: TextTags: DrupalDrupal 7Drupal Planet

Drupal 7 Fivestar Module

Dec 22, 2012

Description:

Episode Number: 73

The Drupal 7 Fivestar module can be used to easily rate various types of content on a Drupal 7 website. These ratings can be used on the content itself or even from the comments of that piece of content.

In this episode you will learn:

How to install and configure the Drupal 7 Fivestar module How to create a simple Fivestar rating system on an article content type Full Text: 

Hello there everyone and welcome to another Daily Dose of Drupal! Today we’re on Episode Number 73, as always I’m Shane, you can follow me on Twitter @smthomas3, you can also go to codekarate.com and check out the other Daily Dose of Drupal videos, enter to win the book contest if it’s still available and sign up for the newsletter.

Today we’re going to be going over module that I’ve used quite frequently on both Drupal 6 and Drupal 7 sites and that is the Five Star Module. What this module is going to allow us to do is set it up to rate content. Let’s say you have an article or you have a product and you want the ability to rate it based on a star system, maybe it’s five star or four stars, whatever number of stars you want, you can set up the module to work with you and to rate that content.

This module also requires the voting API so you’ll need to make sure you’ll get that installed as well and it has views integration which can be useful if you need to display of the highest rated items.

So that’s probably something you’re going to need something you’re going to want to look at. We’re not going to go over the Views Integration today; we’re going to go through two scenarios.

The first; you have an article that you want someone to just be able to read and rate without having to leave a comment. The second one is actually forcing the user to lea comment when they leave a rating and not allowing them to rate without leaving a comment.

So the first one is useful for articles as I mentioned before if you want someone to just quickly vote on something, the other one can be useful if you want them to leave a product review and leave a rating on a specific product.

So let’s go ahead and get started; we have a pretty much brand new test site here that I’m logged in to as the admin and I’ve already downloaded the modules for Five Star and Voting API and I’m just going to go ahead and turn those both on. I’m then going to come in and set the permissions for the Five Star module and you’ll notice that we’re going to give the ability to rate content to authenticated users and I’m going to save that.

And because I’m going to need a test user I’m going to go ahead and create a new user and give them a simple user account so I can test it and you can see I have two articles; the first thing we’re going to do is come to the configuration page on the Five Star Module and that’s going to allow us just to look at one quick thing; we don’t really need to worry about it too much but it basically allows you to set multiple voting tags.

You really need to use this if you’re going to have multiple ratings on one node or one piece of content, we only want one rating so we’re just going to leave the default vote, you could of course add multiple, just separate it with a comma. The next step is going to be adding the field to our content type.

This is a little different than the Drupal 6 version so if you use the Drupal 6 version in the past and haven’t use the Drupal 7 version, it has change a little bit, we’re going to go to Manage Fields on the article content type and we’re going to add a Five Star Rating field. We’re going to call this Article Rating and we’re going to set the stars rated while viewing.

So when they’re actually are viewing the node and not creating the node they can set the rating, we’ll save this, we’ll leave everything else at its default, I’m going to move this up so as a little .. I guess it doesn’t need to … it doesn’t matter but just a preference I guess I’m going to then go to Manage Display and here I’m also going to move this up above the body field and the format is going to be as stars, you could of course show it so it’s only going to give a numeric rating or a percentage rating, I’ll leave it a default but you want to click on this little settings I can over here.

Now we can set what type of stars we want, there’s a whole bunch of different options that you can look through, I’m going to go ahead and leave that at the default and then there’s options to choose what value to display. So in this case we’re going to use the average vote and that’s the text to display under the stars as well and we’ll start with just that.

So I’m going to save it and come back to the first test article and you can see I can now rate this article so I go ahead and rate it, it says that the average vote is 3, I can hop over here and login as my test user and you could do this with anonymous user as well, I’ just using authenticated but it is possible to make this work with anonymous and go to test article 1 and you can see the average, I can change my vote but it still just displays the average so even if I change it to 5 now let’s just show mine but it will save the averages for it.

You can change how that display ends up showing up by going back into the content type and you can show it so it will display both the users and the average vote if we wanted and that you can also have it show other things as well but we’ll go through this one quickly, if I hop back over here and refresh the page you can see it shows the average and your rating.

So we’re going to change that back up quick so just to show average. And now the next step is to make it so it forces you to leave a comment in order to rate the item. The first thing we need to do is in this Manage Display come back into the settings and uncheck this expose this filter field for voting.

This will make it so you will not be able to actually vote on the field. So if I come back here it should display looks like showing the average is not exposed for voting because that’s updating and let’s make sure we save it. There we go, you’ll notice I’m no longer able to vote on this through here.

So now we need to add this stars field or this ratings field to the comment form and then you need to link it up so the comment form actually affects the actual average rating of the entire piece of contents.

So we’ll come back to the comment field and this is important if you want to add an existing field so you want to find the 5 star rating field, in this case the Article Rating field that we created and this time for the widget you want to have stars rated while editing because you are seeing the comment edit form so you want to be able to actually change it while you’re editing the comment or creating the comment.

So we’ll go ahead and click Save, you can select the star display options which will leave this at the default, you probably want to make sure they matched up, especially make sure the number of stars matches up between the content type and the comment, the voting target you want to select the parent node, that way each comment as it’s voted will filter out to the node level and you will affect the average that way.

So I’m going to move the rating field around a little bit and you then want to come into Comment Display so we’re going to change the display to show the rating above the comment, we’re going to keep the format as stars, we’re going to then change this to show the users vote instead of the average vote.

So we’ll save this and we’re now going to give this a quick go. One thing you want to make sure is make sure that in the Permissions, authenticated users have the ability to view and post comments, by default they should but you want to make sure of that. We’ll first create one using the admin account so we’ll come to test article 2, you’ll notice I can’t change the rating here but I can leave a rating on the comment form so I’ll go ahead and save it and you’ll notice here’s my rating is 4, it’s my comment and it also changes the average comment of the article.

Now I come in as the other user, I come to the test article 2, you can see the average is 4, I can see the comment and this person rated it 4 and then I can put in my rating. Now you can see there’s two different ratings, you can see the average is now accurately displayed.

So that’s really all there is to the 5 Star Module, you can do a whole bunch more with it of course but what it allows you to do is quickly and easily setup a rating system to rate various types of content on your Drupal website. So that’s it for today on the Daily Dose of Drupal, as always follow me on Twitter and Google +, I’ll see you next time.

Tags: DrupalCommentsDrupal 7

Drupal 7 Context module

Dec 20, 2012

Description:

Episode Number: 72

The Drupal 7 Context module allows you to easily organize your site into manageable sections (a.k.a "contexts"). These contexts can be used to change the layout of the page depending on where you are on the site. For instance, you may need certain blocks to show up in the sidebar on the homepage, and then change that to show up differently on blog pages.

Note: You will need to install the Drupal 7 Chaos tools (ctools) module in order to use the Drupal 7 context module.

In this episode you will learn:

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, we’re on Episode Number 72 today. I’m Shane, you can follow me on Twitter @smthomas3, also sign up for the newsletter at codekarate.com and follow me on Google + as well.
Today we’re going to be going over a module that I’ve used on a few Drupal sites, it’s called the context module and this module … it basically extends and allows you to … I would say modify the architecture of your Drupal website and instead of just having the basic blocks, it actually extends traditional block system a little bit to allow you to be more flexible in your layouts.

So it allows you to organize your sites into what I would consider to be sections or logical pieces that you can then change the display on. So let’s say for instance you wanted it to be display a certain block and with top of the test site here.
A certain block on the left side bar on the homepage but you want it to reuse that same block up in the header section on another page. With a traditional Drupal Block system you can’t do that but you can reuse the same block in multiple regions. However; with Context that becomes possible.

It could do a lot of other cool stuff as well. There’s other modules you can use besides Context such as maybe they make panels work for this and a few other things but we’ll go over context module I would recommend trying out yourself and seeing if you like it or not. Some people have different opinions on the module.

I happen to like it but only in certain situations if you can have a really clean architecture for your site and break it down into organized sections. So we’ll go ahead and get started; hop over to the modules page in the Context section there is Context and Context UI, there’s also Context Layouts which allows you to use theme layer to with different regions but I’m not going to go over that, I’m just going to go over the Context and the Context UI module, you can of course set permissions, you can also configure it, it’s right under here under Structure Context. Here it basically allows you to organize into different sections.

So in this example I’m going to set it up so on the homepage I’ll display the navigation on the left side bar but on article pages I’ll put it in a different position, maybe the right sidebar, maybe the up here in the header, we’ll see what happens. Okay so let’s go ahead and click Add, we’ll call this the homepage and we’re going to add a position and I believe we can go ahead and select Path and for the Path we’ll use Front which is the front page, we’re only going to have one condition here and the reaction is going to be … we’re going to change the blocks, you can of course change the Breadcrumb, change different menus, there’s a whole bunch of different things so it’s not just for blocks but that’s one of the most common uses of it.

So on the homepage; for Sidebar; first we’re going to go ahead and find this navigation menu and we’re going to add it to the first sidebar, we’ll also use a powered by Drupal and put that in the first sidebar as well. So you can see you can organize it just like you can on the block’s interface and we’ll go ahead and save this but before we do that we’ll just walk you through on how to do this.
So it’s the homepage, it’s going to run through these checks of this condition. It’s going to go ahead and see that we … if we run the front page then this is what’s going to happen; we’re going to display these blocks in whichever regions we have then displayed in. So let’s save this, only lower case letters, go ahead and save it. Okay so let’s go ahead and take a look.

So this should be working, you can see the powered by Drupal navigation is there, let’s go back into it one more time and just to confirm it is working we’re going to add one more block just to show you that it works, we’ll add something to the featured section, we’ll go ahead and show recent content in the featured section on the homepage. You’ll notice now it’s quite a bit different, you have a homepage with recent content in the featured section navigation and the powered by Drupal.

This isn’t I think you can do with blocks of course but let’s say when we go to an article page maybe we want the navigation to be on the right, maybe we want the powered by Drupal link to be in the footer on other pages. So we’ll go ahead and create a new context for that.

And like I said before; it’s really good to really think about how you want to organize your site, if you have a homepage that might be a separate context you may have a blog portion of your site that’s going to be managed differently than other static pages for instance so really think about how you want to be doing this but you’d really don’t want to be adding a context for every single page at the site that kind of defeats the purpose so you kind of want to be able to group pages together so we’ll call this articles and we’ll say in this case node type is going to be article and if you want this contents or if you want this context to be apply on node forms, we’re going to say no and in this case we’re going to change the blocks so the navigation is going to be moved to … let’s go ahead and put the navigation in sidebar second, of course these are all arbitrary, I don’t know how this is going to look and let’s say we also want recent content … if I can find that, that’s more recent content in this second sidebar and then we’ll put the powered by Drupal into the footer so we’ll save this, now we have articles in the homepage and as we look at this you’ll notice it’s all based on this condition of the node types.

So if you’re on the node page of article it’s going to use this specific context. As you can see it adds this navigation over here in this recent content, there’s the Powered by Drupal in the footer, let’s go ahead and hop back in here and take a look at it one more time. So it’s really basic on how it works.

One of the things you’ll notice is it of course doesn’t remove the previous blocks. So if you wanted to control it completely with context you can go ahead just hide your other blocks so they are not showing up, we’ll save that, come back, you’ll notice now it’s not using the original block system anymore.

The homepage is a different structure; if you go to onto an article page you have completely different structure all together. So it’s an extremely useful module but we’re just really scratching the surface of what it can actually do but all in all you just have to remember it’s really not that confusing, you may be intimidated if you haven’t look at it before but it’s really just a set of when something … when you’re in a certain page or once you’re in a certain section of the site that’s what the conditions are for then you want to do something specific whether it displaying blocks, changes in the menus, breadcrumbs and so you can really play around with it, dig in and find ways that you can use it on your next Drupal project. Thanks again for watching the Daily Dose of Drupal and we will see you next time.

Tags: DrupalDrupal 7

Drupal 7 Pathauto Module

Dec 20, 2012

Description:

Episode Number: 71

The Drupal 7 Pathauto module allows you to easily create patterns for the URL alias of any content you create on your Drupal 7 site. This is a module that I install on almost all my Drupal sites.

In this episode you will learn:

How the Drupal 7 Pathauto module can automatically create URL aliases on your Drupal site based on a pattern How to bulk update or delete URL aliases Full Text: 

Hello there everyone and welcome to another Daily Dose of Drupal, this is Episode Number 71 today, as always I’m Shane, go ahead and follow me on Twitter if you haven’t already @smthomas3 and sign up for the codekarate.com newsletter and find me on Google +.

Today we’re going to be keeping it short and simple, the Path Auto Module. You most likely if you’ve around Drupal for very long you already know this module so you can probably skip this episode in all honesty but if you haven’t heard of this module it is one that you should probably be installing on most of your sites.
By default I pretty much installed this on every Drupal website I’ve built and it’s especially important if you have users who are going to be generating content like blog post or articles and they don’t necessarily know the ends of now with Search Engine Optimization and what it allows you to do is it allows you to automatically use a pattern to generate the URL Alias for a specific piece of content and it is extremely easy to configure so we’re going to hop right in and get started and be out of here in no time. I’ll go to the module’s page and show you that I do have it installed, I have this 7.x-1-2 version which is the current version and I’m going to go ahead and you can of course set the permissions, I’m just going to go to the configuration page.

The first tab you can open up here list all the aliases on the site. So as you can see they’re all defaulted to content/ something which is the default for any type of content. You can of course edit this if you wanted to change the alias so if you wanted to do something like that, change it from a really long URL to just a longer FAQ answer which was related to the FAQ Module a few days ago.
But what this allows you to is of course fine tune it and make changes, you can filter here, you can add an alias but we’re going to go to the Pattern. So this is where it gets a little more interesting.

This requires a token modules so you’re going to need to make sure that installed as well but it allows you setup this pattern using tokens. So for instance we’re going to look on the Content Path, that’s the important one, I do have … there would be one listed here for each different type of content on the site.

So I have Article Content Type, Basic Page Content Type, FAQ Content Type and so on and so forth. It all defaults back to this; the Default Pattern. So if there is something listed here when you create a piece of content it’s going to default to this. Let’s go ahead and change this; let’s change this to be Articles/ and you can of course come down here for the Replacement Patterns, you can use the current date for instance, let’s go ahead and say we want it to be … we could go ahead … we won’t use a in this instance, we’ll go ahead and use something else, you can have Node Author for instance so it could be articles/author/ and then we’ll go into node title.

So now instead of just contents/ the node title is going to be articles/author/node title. This could be useful if you have many different authors that are posting blog post and you want to separate it out a little bit or give you URL’s some structure and you can of course do this for all this different content types so you could have this faq/node title or anything else in here.

Whenever you want from the token list in this section and a lot of these breakdown and have a couple of different options within then so you can really look and see what’s available, you can easily just select it, click on the token down here and as you can see it drops it in. So that’s how that works, we’re going to go ahead and give it a try.

You can do this for taxonomy, paths, user paths and the FAQ Module has it so modules can build in their own sections in here but the content path is going to be the one you’re definitely going to look at and of course taxonomy might be important for you and users depending on your site.

So now that I save this I’m going to go ahead and create a piece of content; I’ll create an article, let’s give this s little bit of text and we’ll just go ahead and save it. The first thing to notice is now it’s … the URL up here is test4.codekarate.com/articles/shane which is the current user name and I’m logged in as test-path-article. So that’s all working great, it just sets what we would hope and then basically what it allows someone to do is even if they go in and they’re creating an article and they do not have access to this URL Path settings it’ll automatically generate that article.

One thing you’ll notice is this is an old article; it still has the old URL alias. I can click this checkbox to generate it automatic URL alias and save it and then we’ll go ahead and update it but what we really wanted to be able to do is we really want to be able to these in bulk.

So first we’ll check out the settings; I generally don’t ever change the settings here, they come with much pretty sensible defaults but you can have a look; here you change a separator, change the different alias links, it removes strings, common strings from the title if you’re using like a node title or something else, it’ll remove it from the path but you can also do this Bulk Update. So we can go ahead in Bulk Update any of these different types; content, taxonomy, user paths but before we do that we’re going to go ahead and go to Delete Aliases.

We’ll just go ahead and delete all the content aliases because most of these are articles and we’ll now do a bulk update on the content path. You can see it generate 15 URL aliases and now you’d notice I come back to content/testarticle-1 and it’s gone. That is important to note, you might want to be careful doing these Bulk Updates if you have a live site and a lot of content because the search engine will have a hard time finding those and you might have broken links so you may need to use other modules like the Redirect Module and you can look at some of these recommended modules here; with the redirection path, redirect modules depending on D6 or D7 but we’ll come back to the homepage you can see the articles of course are still there, if I hover over it and look down here at the URL at the bottom you can see that that one becomes article/chains/test-article1/article/chain/test-path-article.

So really easy, really basic, go ahead and give it a try if you’re not already using this. Like I said before it’s something that I use in almost every Drupal site I build especially if I’m going to have other people creating content that’s going to be … or that I want to be index on the search engines having a nice clean URL path definitely helps with not only allowing the user to see a little bit about what the page may be about but also helps the search engines better index your site. So go ahead and give a try and I will talk to you next time on the next episode of the Daily Dose of Drupal. Thanks for watching.

Tags: DrupalDrupal 7SEO

Drupal 7 Captcha module

Dec 19, 2012

Description:

Episode Number: 70

The Drupal 7 Captcha module is one of the many possible Drupal modules to help catch bots from submitting forms on your Drupal site.

In this episode you will learn:

How to configure the Drupal 7 Captcha module to use math based questions How to configure the Drupal 7 Captcha module to use an text based image How to change the distortion and noise settings of text based image captchas Full Text: 

Hello everyone, hello everyone and welcome to another Daily Dose of Drupal, we’re on Episode Number 70 today, as always I’m Shane, go ahead and follow me on Twitter @smthomas3, head over to codekarate.com and sign up for the newsletter, if the book contest is still going on go ahead and leave a comment on the book contest page for a chance to win.

Today we’re going to be going over the Drupal 7 Captcha Module and this is just one example of the many different types of Captcha Modules that are available; we’re going over one today, I’m sure I’ll go over other ones in the future. I haven’t used this one on a lot of sites but on the few that I have it seems to work fairly well, I’d also recommend the Mollom Module as well, it’s one that I’ve used often and I will probably go over that in the future episode but today we’re discussing the Captcha Module.

What’s great about this one is there’s no 3rd party service, you install it and it’s very configurable, just works right out of the box. So I have a test site here and as you can see I have the Captcha Module and the Image Captcha Module turned on.
So go ahead and click on Configure and the default challenge type is just a math challenge so we’ll go over that one first, you can go ahead and select Performs here that you want the Captcha to display on so let’s go ahead and use the Math Captcha on the registration form, we’ll go ahead and use an Image Captcha on the User Log-in block and User Log-in.

So we can see the different types of Captcha that are available and you can have a description, change the description text, there you can change if it’s case sensitive or not and a couple of other small settings here, go ahead and save this. You can also log the wrong responses which can sometimes be helpful if you feel like you’re getting hit by a lot of spam or a lot of things that are getting caught.

So I’ll go ahead and flip to another browser here where I’m not logged in, if I refresh this page you can see the Image Captcha comes up, it’s a little bit outside the boundary but that’s not too big of a deal, if I go to create new account you can see there’s a math question. So as you can tell, I need to solve this math question in order to create a new account. So I’ll go ahead and create an e-mail, solve the math question and I’ll be on my way.

And as you can see that worked, I’ll go ahead and go back to creating a new account and I will try one with any math question that doesn’t work. So we can see the message that comes up so if I put in the right answer it’s going to of course tell me the answer you entered with the Captcha if it was not correct.

So that’s pretty simple, let’s go ahead and try the log-in page; you can see this is an Image Captcha; in this case it’s relatively easy, DBC9M, you could enter that in and go ahead and login to an account that way. However; one thing cool about this module is there are a variety of different settings for you to use as far as the Image Captcha is concerned.

So if you got to configuration page for the Image Captcha you can see an example, you can select which characters you want to use, the code length, it’s lets you changes to 6 for instance, we’ll use the same font, we can change this font size down a little, change the character spacing, background colors, different file formats and this is one of the cool parts as well; you can change the distortion so we can add a medium amount of distortion and there’s a bunch of different options so we’ll save this and if we refresh the page here you can see that it starts to get a little bit more difficult, there’s 6 now and that gets to be a little more difficult to read and obviously the more difficult you make it to read the more difficult it is for bots to be able to determine from the image what it needs to be.
So we’ll turn it down just a little bit and see if it gets a little bit better and you can of course fine tune it to the needs of your site. As you can see that’s a little bit more difficult to read but easier than what’s before so that’s probably an acceptable amount for what I would want to go for but of course it’s your own opinion, you can go ahead and tweak it as you see it fit.

There’s also some other cool things here; you can add some noise to it and we’ll change the noise down a little bit and save it. As you can see it gets a little bit of dots that come through the image which make it a little more difficult, you can refresh here and see it in action, it makes it much more difficult to read.

So it’s very configurable, you can make it as easy or as difficult as you want, it’s definitely something I would recommend having especially if you’re launching the site to the public and there’s going to be a lot of forms you just don’t want to get hit too much by bots or spam on your site.

So go ahead and give it a try and let me know what you think. If you have any other episodes that you want me to do or any other modules just go ahead and let me know on codekarate.com and thanks again for watching the Daily Dose of Drupal. See you next time.

Tags: DrupalDrupal 7Spam Prevention

Drupal 7 Printer, Email, and PDF Versions Module

Dec 18, 2012

Description:

Episode Number: 69

The Drupal 7 Printer, Email, and PDF Versions module allows you to easily create a printable copy, PDF copy, or email-able copy of a Drupal page.

In this episode you will learn:

How to use the Printer, Email and PDF Versions module to create a printable copy of a Drupal page How to use the Printer, Email, and PDF Versions module to email a copy of a Drupal page How to configure the Printer, Email, and PDF Versions Drupal 7 module Full Text: 

Hello there everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 69, as always I’m Shane, you can go ahead and follow me on Twitter @smthomas3 or hop back onto the Code Karate website and sign up for the newsletter if you haven’t already.

Today we’re going to be going over a module that I’ve used quite frequently and it is the Printer E-mail and PDF Versions Module, it’s that drupal.org/project.print. This is a great module if you want users of your website to be able to either print out the web page in a nicely formatted fashion or if you want them to be able to e-mail the webpage to a friend or themselves or also if you want them to be able to download it a PDF version of the web page.

I’m only going to go over the Printer and E-mail versions today; the PDF Version requires you to install a 3rd party PDF generation tools or one of the PDF generation tools. The one that I have at the most success with and I would recommend is the WK HTML to PDF I guess it’s what it is called and I will probably be putting a blog post together on codekarate.com in the next week or so with details of how to get that installed because there have been a few questions that I’ve noticed and that I ran into when I was getting it installed for the first time but today we’re only going over the Printer and E-mail portion of this module.

So I went ahead and I have my test site here and you can see that I already have the modules downloaded, I do not have the PDF version one enabled but I have a printer friendly pages and the send it by e-mail modules enabled from this Print Module on drupal.org so I’ll go ahead and click on Configure and I’ll start with the settings.

This allows you to set up a custom style sheet so if you want to use a different styles on your either the e-mail that get sent or the print version more likely, you can go ahead and use that, use a custom style sheet here so you can change it to look the way you want to, you can also have it keep the current scheme CSS and there’s a whole bunch of little options here and options for the logo so you can have it Hide the Logo or show a different logo, different footer options which your default is using the site’s footer and if you just wanted to just play the source URL, bunch of different things, you can also change it, change the text so it allows you to change the text strings that are displayed.

So when you want to view a printable copy of the webpage there’s a webpage options here, it allows you to specify where you want this link to show up, by default it will show in the links area of any content type, it also can be in the help area or in a custom block and I’ll show you that as well, it gives you specific classes and you can specify a specific link feasibility and just … you can have it open in a new window, there’s a whole bunch of different configuration options, both of these; the Webpage, E-mail and the PDF Version if you use that have a lot of configuration options.

The e-mail looks very similar, a lot of same type of things so I’ll go ahead and show you how it works. Right after I installed it I simply go to a test article here, just this is an article content type if you scroll down you’ll see that there’s a printer friendly version and send by e-mail.

If you did have the PDF version module it would show up right next to it. By clicking the Printer Friendly version it goes ahead and brings me to a new page, it’s /print/ the node ID and it just has the text of the site as the footer of the website, it also gives me the source URL, it shows the logo up here, pretty straight forward an as you can all of course use the settings to change this up a little bit or use the custom style sheet.

The Send by E-mail will actually allow you to specify an e-mail address to send it to, subject; it links it to whichever page you’re going to send and then you can send a message and this will actually shoot an e-mail over to any e-mail address listed in this Send it To field.

So the basics are all there, if you want to customized the content types you can come in to … I’ll say article and there’s a printer e-mail on PDF version option here so you can say for example if you want to not show the Send By E-mail link, you can save that and this is only for the article content type, of course you can reset this for any content type. If I come back to the home page going to test article you could still see the Printer Friendly version but the Send By E-Mail link is no longer available.

There’s also a printer e-mail and PDF versions block which we’ll go ahead and put in the side bar here just to show how that works, you can save that. So there’s a printer friendly version of the page, if I go back to the content type and I turn on this Send by E-Mail option, save it and come back you’ll notice I have the Send by E-Mail link showing up in this block as well.

So it’s a really easy module to get going especially if you want to allow user to either send an e-mail with that page to either themselves or to a friend and to also allow users to more easily print out a version of the page.

So if you have content that you know users are going to need to print or maybe saved as a PDF or Send as an E-Mail this module is the first place I would start, it’s very configurable, it allows you to add your own custom style sheets, whatever you might need in order to make the module look and work correctly, it also is very flexible as far as building out template files so for instance you can build out specific print template files for either it’s HTML, Send an E-Mail or PDF version and for a specific node types so it makes it extremely flexible for building out anything you might need to print or save as a PDF.

So that’s it for this time on the Daily Dose of Drupal, as always follow me on Twitter and I’ll be back again next time with another episode, thanks for watching.

Tags: DrupalDrupal 7

Drupal 7 Frequently Asked Questions (FAQ) module

Dec 15, 2012

Description:

Episode Number: 68

Do you have a question? Well if so I have the answer, well actually the Drupal 7 Frequently Asked Questions Module might help you find the answer. If you need to find a simple way to display questions and answers on a Drupal 7 website, this episode along with the Drupal FAQ module, will help.

Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal, as always I’m Shane, go ahead and follow me on Twitter @smthomas3 and also go to codekarate.com and sign up for the newsletter over and if the book offer is still available go ahead and sign up for a chance for a free book.

Today we’re going to be on episode number 68 and we’re going over a simple module that can be helpful for many different purposes when you’re building Drupal website. The module that we’re going over today is the Frequently Asked Questions Module, the FAQ Module for short.

If you look at the preview it allows you to have questions and allow clickable questions that take you to the answer so if you have a list of Frequently Asked Questions from clients if you’re building a business website or some kind of an online service this module can definitely help you out or let’s say you’re an e-commerce shop and you also have customers who call in with questions or complaints or inquiries in general I guess this works very well so let’s go ahead and get started.

I have a test site here; I’ve already installed the Frequently Asked Questions Module and I have populated it with a few questions as you can see the Frequently Asked Questions Module has been enabled and you can also click on permissions and find there are some frequently asked questions permissions so you may want to make sure anonymous users can I think few pages for instance and as far as administer the module and the order, you probably want to keep that for administrative use only so now anonymous users would be able to see this page but I’ve went ahead and added some questions.

So you can get to the page by going to faq-page and you can see I already have a list of Frequently Asked Questions in this or on this page. Before we get too far I’m going to go ahead and go to the main menu and add a menu link to this page and we’ll go ahead and just add some weight to that and save it just so we have a menu item here and as you can see there’s a whole menu item up here so go ahead and click on that, it brings you the Frequently Asked Questions page.

You can see if I click on one of these questions we’ll say we’ll click on the last one it brings me down to this question. So I only have four questions here and each one has back to top link which will bring it back up to the actual questions. Each time you click questions it brings me to the answer, pretty simple. If I click on the title of one of the questions it brings me to the more full node page.

So if you wanted to be able to comment on specific questions or whatever you could keep that in place. In most cases or at least in my case when I’ve used this before I don’t actually want them to go to a separate page, I just want everything listed in one area. Luckily; it’s relatively easy to configure this and there are a lot of configuration options.

So you can go ahead and take a look by … if you have the administration menu module and there’s some configuration content authoring section, the Frequently Asked Questions.

You can change the title of the Frequently Asked Questions so I could change this to say about Code Karate for instance and you can add a description, I added one here, there’s also this Create Custom Breadcrumbs for the FAQ so that … I’ll show you what that does; so we’ll save this, we’ll go back, as you can see now the title changed, my description is here, if I click on one of these you see this Breadcrumb here, that brings me back to the Frequently Asked Questions page.
That’s what that one option, that bottom checkbox will actually allow me to do.

So we’ll keep going as far as the administration of this is concerned. There’s a questions tab up here so this is a general settings, up here is the question settings, there’s a lot of options here. So you’ll see … I’m not going to go over them all but you should be able to at least get the idea and play around with yourself.

So you can change the page layout so the questions are inline or you can have it right now or it’s clicking on the questions, takes us to the answer further down the page. So I’m going to say clicking on the question opens or hides the answer under the question, you can have it in unordered list, looks like that’s the only options I have right now, you can change the labels of the questions answers and you can do a couple of other things.

Looks like some cases … some of these are disabled but depending on what you selected above there, I’m guessing the changes is what you could select down here. One thing is I want to disable the question links to nodes because I don’t want it to bring it to a node page at all, I wanted just to make sure that I see the questions answered, I don’t really care that the node pages exist, I just want them to be able to easily get the answers that I’m looking for.

So I’m going to go ahead and save this and come back to the page and I can see that I only have four questions, I click on it it goes ahead and just expands it out. So as you can see that makes it a little nicer as far as my perspective, you might like something else so go ahead and try to configure it the way you want it and it is pretty flexible, there’s the order button here, you can change the order of these items manually, there is also a default ordering as well which default I think to show the newest first but as you can see I change the order, now this one shows up in the middle also there’s some fun trivia on the Daily Dose of Drupal in here so you can read that.

Also let’s go back to the administration and look at the Category section, this will allow you to actually apply categories to the Frequently Asked Questions so you can categorize it as a content based on textonomy if you have the textonomy enabled. I’m not going to go over this but just be aware that it’s here, you can install the textonomy module if you haven’t already, categorize questions and you can put questions in specific categories so if you have a large amount of frequently asked questions and you have let’s say you’re an e-commerce store and you have a bunch of questions on shipping policies you could have a category with a term for shipping, you can have question on customer returns, things like that where I wouldn’t normally use this unless you do have a larger lists of questions that needs further categorization but it here as options and you can go ahead and try this out.

It’s similar to the other questions page as far as options are concerned and shouldn’t be too hard to figure it out if you already gotten this far. So that’s it for today on the Daily Dose of Drupal, go ahead and follow me on Twitter and Google + as well, I didn’t mention that earlier and we’ll be back again next time with another episode so thanks again for watching. Bye!

Tags: DrupalDrupal 7

Drupal 7 Views Slideshow

Dec 14, 2012

Description:

Episode Number: 67

Note: In this video I do not mention that you need the jQuery Cycle plugin installed to get this working. I already had it installed in my video. You can see information on how to do that in steps 3 through 7 on http://drupal.org/node/903244

The Drupal 7 Views Slideshow module makes it easy to add a slideshow to display rotating content on any Drupal 7 website.

In this episode you will learn:

How to create a simple Drupal content type with an image field to use for the Views Slideshow Full Text: 

Hello there everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 67 and as always I’m Shane, you can follow me on Twitter @smthomas3, you can go to Google + and find me there, also go to codekarate.com and click on this link here to see the other Daily Dose of Drupal videos if you haven’t watched them already and if the contents is still active when you watch this video you can sign up to or for a chance to win a free Drupal book, also sign up for the newsletter if you haven’t already but let’s go ahead and get started.

We’re going over the Views Slideshow Module today and this is the slideshow that I used probably 95% of the time that I need, any type of slideshow on in any Drupal site I built, it just works well, it’s easy, relatively easy to configure and you can have it not only just slide between different images but you can have various types of contents within a slide between different nodes.

So we’ll go ahead and get started with showing how we can use this; if you haven’t used this before I would highly recommend trying this one before trying any of the other slideshows out there just because in my experience it’s been the easiest to use. There are other ones that have or maybe a few more features but some of those it can be a headache to get set up and it require other types of J Query libraries and things like that. So I’m going to head over to the modules page and I have downloaded this module but I do not have it installed yet.

So as you can see I already have Views installed which you’ll need, so Views and Views UI are installed. When you download the Views Slideshow it’s going to have Views Slideshow and Views Slideshow Cycle.

So we’re going to go ahead and just go with Views Slideshow for now and we’ll come back to the other one here a little bit. So go ahead and save that and we’re now going to create a quick content type and we’re going to call this just Slideshow just to keep it simple, keep everything else the same and we’re going to manage the fields here, we’re going to add an image field and we’ll leave that as public files, go ahead and save it and we’ll go ahead and we can change this if we needed to change any of the settings but I’m going to leave them at the default just to keep it simple and slide is up here and we’re now going to add just a few pieces of content.

So we’re going to go ahead and add some slideshow images, just grab a couple of images here and save that, also go ahead and add another one, save that one as well. If we come back to the homepage you can see that this two are showing up here but we’re going to create just a Views Slideshow block that’s going to sit on the top here in this section.

So let’s go ahead and start by creating a View; we’re going to add a new View, we’re going to just go ahead and leave contents of types slideshow, we can call this Slideshow for now and we could create a page, we don’t want to do that, we want to create a block, the format is going to be slideshow and we’ll go ahead and say Fields, we’ll go ahead and continue and edit from there.

So you can see it change the format here to slideshow so you normally wouldn’t have this be grand or a table and this added a new format, the Views Slideshow Module so we can select that and you can change the settings here, you can add a specific row class, you can set list type, different styles and just change the way that it displayed here, I’ll go ahead and just apply that.

Now we get to select our fields; we’re going to select our Slideshow Image Field and Formatter; we’re going to leave it as Image … let’s use medium style image and it kind of link to we’ll say the content, we don’t want to label it in this case, let’s go ahead and apply that.

Now we can go ahead and save this, it’s not going to be much to show yet but we’ll go ahead and open up the blocks page and I’m going to go down and find this block here, you can see its Views Slideshow, I’m going to drag it up to the Featured section, I’ll save this, after coming to the homepage it says No Mainframe Module is enabled for the Views Slideshow.

So that of course means we need to come back to the modules page and enable … so you can go ahead and search for this to make it a little easier, we need to enable the module that’s actually going to display it which is this Views Slideshow Cycle, let’s save this, you also need to enable the libraries module so you have to make sure you have that installed as well and make sure if you have any troubles with installing this you come to the Views Slideshow page on drupal.org and you can read the various documentation on how to get this thing installed and working.

So now that we have this installed, I can see it’s been installed so we go back to our View and refresh this to make sure everything is up to date, so make sure that as you can see now I refreshed the block and it shows at least one image and it flips between two images. You’ll notice that text actually changes with the image. So it’s working but it’s still not nearly what we want it to be.

So now that we have that Rotator Module or the Cycle Module I guess turned on as well we can come back into settings and you can that there’s some additional cycle options here; you can select the different effect, it can select if you wanted to pause on hover … so it just gives you a few different options as far as how you want that to work and I also thought there was … yeah there’s some additional options if you look at some these advance options here as well.

So as you can see there’s a lot of configuration you can look at but the main goal is just to get it up and working. So let’s go ahead and change this image style to Large and apply that, that’ll make it a little bit better there, I’m also going to add the body field and I’m not need a label for this and I’m going to rearrange this a little bit. So as you can see down here in the example I have the title and the text.
What you can then do with this is let’s say that you for instance wanted to pull this text to the side or you wanted to pull this text up. An example of this would be my company’s website here, just a View Slideshow, as you can see this is text setting over here on the right where this is an image.

It’s all created with Views but it switches as the slide’s filter through. So we’ll go ahead and we’re going to do something that’s really simple here; you’re going to have to know a little bit of CSS for this, I’m not going to go through how to actually apply the CSS but if you have a theme and you are competent with CSS you should be able to figure this piece out but Views actually can allow you to rewrite the output of certain fields. So let’s say for instance you want to have a Div Structure that wraps this title and this body so you can float it to the right.

A couple of different ways you can do that; you can go in here into the Body and just click rewrite results, click you want to rewrite the output of this field then in the replacement patterns you’ll see you can use the title and the body. So what we can do here; you can do Div class = slideshow text wrapper or whatever you wanted your class to be, you can put the title field and then the body field and then that would allow you to add some CSS to flow at this on the right side of the image or pull it up so it’s over laying on top of the image, whatever you wanted to do, let’s go ahead and save that then we’ll come back into this title and we’ll click exclude this from display so it doesn’t show up twice, you can also add a blank field in there and do the same thing but I just add ... route the output of just this body field, if we come back here things should be looking a little bit different, you can notice that it should flip here in a second as it does and you can change this the format of this image, you just have to come in and change the image style but I’m not going to go over that, I went over that in the previous post but you can change this to be formatted in a specific image size so you don’t have to upload consistent size images so that’s kind of nice, just go into your image styles and you can create a new style and you can use that in the view or you can edit one of the existing styles, in this case we’re using the large image style. Important thing to take note of though is if we hover over this you’ll see we have our slideshow text wrapper here that’s wrapping this content.

So as you can see that we could then float this to the right and we can also or we might actually have to do a couple of other things but we actually have to float this piece I guess to the right and float this left and it would probably work, it’s starting to move but you can get the idea that you could overlay this on top.

But you get the idea; if you had some CSS you can move this text around and as you can see every time I flipped it resets that because it goes to the next slide but you can pull this up so you can overlay it on top and you could set it over here, you can change that mark-up structure and you may need to do in here, just go ahead and add a … if you go in under global you can add a custom text and you can build out some HTML mark-up for that way as well.

So you may actually have to wrap the slideshow image in one Div and then wraps this title in body and other Div. It really depends on how you want to do it but that can get you started and as you can see it’s realty easy to get the basics of the slideshow going, this doesn’t look pretty by any means but it is working and you can then take that and add some styles to it and make a great looking slideshow.
As you can see the links worked, it brings you right to the post so it just makes it nice and easy. That’s all for this time on the Daily Dose of Drupal, went a little long but hopefully it will help you if you need to build a slideshow, just go ahead and follow me on Twitter and I’ll be back again next time. Thanks for watching.

Tags: DrupalContribViewsDrupal Planet

Drupal 6 Bulk Update Node Body Input Format

Dec 13, 2012

Description:

I ran into a situation in which I created a new Input Format in Drupal 6 on a site that had a lot of content. This input format was similar to the default Filtered HTML input format, however I wanted it to have a few different options.

Type: TextTags: Database AdministrationMySQLDrupalDrupal 6Drupal Planet

Drupal 7 Nice Menus Module

Dec 13, 2012

Description:

Episode Number: 66

Do you need to add Drop downs to your Drupal 7 website? If so, the Drupal 7 Nice Menus module is a good solution. The Nice Menus module allows you to create menu blocks that can drop down, to the right, or to the left. The Nice Menus module also gives you easy to use theme functions to create and use dropdown menus within your Drupal 7 theme template files (like your page.tpl.php).

In this episode you will learn:

How to create a drop down main menu within a Nice Menus block Full Text: 

Welcome to another Daily Dose of Drupal, this is Episode Number 66 today as always I’m Shane, go ahead and follow me on Twitter @smthomas3 or sign up for the Code Karate newsletter. Today we’re going to be going over how to implement and add dropdowns to Drupal 7 website.

There are a bunch of different dropdown modules that you can use to get started but one were going to look at today is the Nice Menus Module. It’s a pretty simple module that’s used in a lot of sites and it gives you the basic structures for the dropdowns and then allows you to go ahead and CSS or Add Style to the dropdowns as you see it fit. So it kind of gives you the basic template of the working dropdown and lets you run with it and make your own design.

So I already have it installed on our test site here because I’m going to come to the modules page and show you that it is installed and we can go ahead and start configuring it. As you can see it’s installed, we’re going to click Configure and ask a few number of blocks that you want, Nice Menus is generally built using blocks so you can drop in a block wherever you want the dropdown menu to show up and it will work and you want to have this check if you want it to fall back to Java Script, works for older versions of Internet Explorer otherwise it tries to use CSS for the dropdowns, it adds a delay and animation speed if you decide to use dropdowns or to use Java Script to use dropdowns so you can change the animation speed to whatever you want, change the mouse delay, you can go ahead and save that.

The next step is then to … well first let’s look at the Menus Structure, I just simply want to show you how it works but it obviously can be expanded out. I have three parent menu links and I have two sub-links in here so what we want is essentially to be able to hover over the home link and have two items show up below it.

So I’m going to show you one option; first option is to use Blocks which is the easiest way to get started. We come down here and you look for this Nice Menus 1 or Nice Menu 2 Block and remember we define that how many blocks we wanted in the configurations. I’m going to go ahead and add this to the header and save it, then I’m going to click on Configure, you select which menu you want to show and in this case I want to show the main menu, you can get a block title, I went ahead and set this as none, Menu Depth; you can show certain number of levels, negative 1 will show all the levels and what kind of style; do you want them dropdowns to pop out from the left, from the right or you want them to dropdown, we’ll go ahead and select down, so I will save this and I will come back to the homepage.

You’ll notice I do have two Menu Items now so … or two Main Menus on my Theme so I could hide this other one by going into Appearance Settings and clicking on or unchecking the main menu, saving it and now I’m down to just one main menu. So then it stops using the main menu from theme, it actually uses this block as the main menu. As you can see the dropdowns work exactly as you could expect, very simple. If you had multiple levels it would drop down and then it would also be able to drop out.

As a quick example; let’s go ahead and show that and see if it does indeed work, you can see it goes ahead and you could have multiple levels, as many menu items that you really would need. Let me go ahead and change that back for now, menu there and I’ll save this but what happens if you want to use the main menus or the primary menu from the theme? Let’s say you didn’t want to for some reason use this block.

I mean in most cases using a block works just fine but if for some reason you want to use the primary links or the main menu from the theme there is a way to do that, I’m going to go ahead and turn this one back on, I am then going to get rid of this block over here, just hide that and now we need to get into the page.tpl.php file, that’s one of the easiest ways to go ahead and get started with it.
So I have a sub theme here so I’m not using the base Drupal Bartik Theme, I actually have a sub theme going so you want to first know which theme you’re using and you’ll have to find the page.tpl.php file in your theme. In my case; I already have this opened here and it’s in my sub theme so this is the page.tpl file, I’m going to find the main menu section.

You can see where it says if main menu I’m going to go ahead and strip out this code here … this php code and I’m going to replace it with a little snippet of a nice menus code that’s going to do what we needed to do to print out the primary menu or the main menu at the dropdown.

So I open it inside the Nice Menus Module there’s a readme.txt file, I would go ahead and take a look at that and it tells you some ideas of how to style or how to use CSS and that’s one thing that is a little tricky if you don’t know how the Menu structure works. So make sure you take a look at that and it’s going to give you some helpful hints, it tells you right in here the basic menu structure but if you scroll down it tells you you can do some advance scheming.

So it allows you to use certain functions or overrides certain functions to theme your menus. So there’s a theme function called Nice Menus Main Menu and we’re going to make use of that. So if you come in to the Nice Menus Module inside Hook Theme you can see there’s a Nice Menus Main Menu and if you’re not a module developer and you’re just trying to get the basic dropdowns, don’t worry about all this, I’ll give you the code and you can drop it in and it should work.

So basically this functions is going to need to take an array of variables of the direction so if you want it down, left or right and the depth, that’s that depth dropdown which negative 1 will show all otherwise you can specify a specific depth if you only want to show two levels for instance or only show one level of dropdowns.

So the first thing I’m going to do is I’m going to declare a variable and as I said before; if you’re not a module developer and you still want to figure this out you can go ahead and copy this code line by line and it should work, you just have to find the If Main Menu section of your page.tpl.php file inside your theme.

So direction; we’re going to set that to Down and Depth we’re going to set that to negative 1, you can change that to Left or Right here, you can change this number to however you want to set your depth as and we’re now going to call a theme function and we’re going to ahead and just grab this here; Nice Menus Main Menu because we are printing the main menu. If you’re using the secondary menu you can grab that one as well and then we have to passed in our variables array, we also need to print this out, so if I save this it should replace this with the Nice Menus Menu, I’ll go ahead and save that and now you can see I have the Nice Menus Menu working, the dropdowns worked just as it did before, its’ sitting in the right place right on the top of this line that goes across and it just works right out of the box.

You will have to of course theme this, it looks a little different but just adding some CSS you can fix that right up and make it look however you want. So that’s it for this time on the Daily Dose of Drupal, I will be back again next time with another episode. As I said before; go ahead and follow me on Twitter if you’re not, alright thank you for watching. Bye!

Tags: DrupalMenu SystemDrupal 7

Drupal 7 Increase Max File Upload Size

Dec 12, 2012

Description:

Have you ever ran into a problem where you needed to upload relatively large files and still want to be able to manage these from the Drupal 7 administrative interface? If so, you may run into a situation like the one below:

You will notice the 12 MB text stating that we can only upload files that are 12 MB and under. In this case I needed this number to be a little bigger.

Type: TextTags: Drupal 7Drupal PlanetSystem AdministrationServersTips and Tricks

Drupal 7 SexyBookmarks Module

Dec 12, 2012

Description:

Episode Number: 65

If you need Facebook, Twitter, Google, LinkedIn or other social sharing links on your Drupal 7 website, the Drupal 7 SexyBookmarks module will get you up and running in no time. On top of that, it introduces a unique design to the social sharing links.

In this episode you will learn:

How the Drupal 7 SexyBookmarks module can be used to integrate social sharing links from Facebook, Twitter, Google, LinkedIn, etc How to create a custom SexyBookmarks profile on your Drupal website and apply it to a specific content type Full Text: 

Welcome to another episode of the Daily Dose of Drupal, this Episode Number 65 today and today we’re going to be talking about The Sexy Bookmarks Drupal 7 Module but first before we get started, as always I’m Shane, you can follow me on Twitter @smthomas3 also go to codekarate.com if you haven’t already and please sign up for the newsletter.

Okay let’s get started; The Sexy Bookmarks Module; this site has a provocative name, it actually has a pretty good purpose especially if you’re building a blog or a site that is going to contain a lot of potential social sharing or you want to generate social traffic to your website and basically as you can see it’s a port of the Wordpress plug-in by the same name and it provides you with some social sharing links that can be dropped in to the bottom of your posts.

So installations is pretty easy if you’re using a Drupal 7 version, just go ahead and download it, make sure you also have the Chaos Tools Suite or C Tools downloaded and installed as well, I’ve already dropped it in on our test site and I believe I have it enabled so I’ll come back to the homepage here and you can see right out in the box it works.

That’s one of the things that there’s a lot of other social sharing tools out there and I’ll probably go over some of the other ones in the future but this is one that’s pretty nice because you just turn it on and it works, there’s no extra configuration that has to happen or just to get the base working, you have to have codes from third party services or accounts on any other websites so it’s kind of nice in that regard.

So go ahead and take a look at a couple of configuration options because as you can see it’s already set up and working and we could go ahead and juts hand it here but there is the ability to configure it so I’m going to go ahead and find it in our modules list and I’m going to click on configure, you can of course set permissions for it, there’s a default profile that it starts with but if you edit that you will see that it contains a list of active and inactive services.

So we could modify this and change the settings here but we’re actually going to go ahead and create a new profile; go ahead and call this one Code Karate and we’ll go ahead and select which service we want, we’ll say we don’t want that one or this one, we’re going to keep in nice and simple, we’re going to get rid of all this, maybe we want to add Google back in over here and maybe you want to go ahead and Add or Edit.

So there we go we have our services, we can rearrange them if we want, just click and drag and now we go down to the Functionalities Settings, we can include a Facebook Like buttons so we’ll of course include that and we’ll say we want this to be at the bottom left, you can show the share counters which is recommended and you can use a tool tips, add a no follow links which you can do there, we want to not to shareaholic link for instance in this example, you can select specific URL’s in there, you can also configure the Tweet Template so if we want to change the Tweet Template to say something depending on what you want so I can plug my own Twitter handle in there so we can configure the Tweet to use that and there’s also Aesthetic Settings that you can configure, we’re going to leave those at the default.

So after we save that we have our own profile here, I’ll come back to the homepage and you’ll notice that it hasn’t changed. So what we need to do is we need to go into this specific content type, in this case it’s the Article Content Type and we’re going to configure the profile here; you just select whichever Sexy Bookmarks profile you want to use, in this case we’re going to select Code Karate and we’re going to click Save.

Now if we come back to the homepage you can see the Like button is a little messed up but it is working, if we go to the page it works right out of the box. We probably should move that Like button maybe up above instead of below, it look a little bit nicer but as you can see it works, you can play around with it, you can configure it, you can go ahead and click on it, it’s going to start by asking you to connect with Twitter, you can go ahead and say okay and I can sign in and let it work that way and then it should allow me to go ahead and post your Twitter, you can do the same through Facebook, LinkedIn, all those various options.

And there you go, I can go ahead and right now tweet this article out and I would never have to actually leave the website which is kind of nice and as you can see it integrates with a bunch of different services, you’re not limited to just twitter of course.

So that’s it for this time, really short and simple, the Sexy Bookmarks Module for Drupal 7, it’s one of the many bookmarking services modules that you can use but it can be very effective especially if you have a lot of content that you want to share across various social networks. So thanks again for watching the Daily Dose of Drupal and we will be back again next time.

Tags: DrupalDrupal 7Social Tools

Drupal 7 Search 404 Module

Dec 11, 2012

Description:

Episode Number: 64

The Drupal 7 Search 404 module is a handy module to use on Drupal websites with a lot of content or the possibility of broken links. It simply redirects any page not found requests to the search page and performs a search for those terms. It is an easy way to redirect traffic within your site if the site contains links to pages that no longer exist.

In this module you will learn:

How to use the Drupal 7 Search404 module Full Text: 

Hello there everyone, welcome to another Daily Dose of Drupal, we’re on Episode Number 64 today, as always I’m Shane, go ahead and follow me on Twitter @smthomas3 also go to codekarate.com and sign up for the newsletter if you haven’t already and find me on Google +.

Today we’re going over a very simple Drupal Module that can be extremely helpful especially on larger websites that has or if you have a lot of website and its Drupal based and it has a lot of content, this module could definitely come in handy.

The module is the Search 404 Module and what it does is it replaces the standard 404 page with a search for those terms. So as I said before; this is a simple module and you’ll basically turn it on and install it and it works out of the box.
So I already went ahead and download it and installed it, we’re going to go to the modules page and show you that it’s there and you can see the Search 404 Module, you cannot actually have been messing with the configurations so I reset back to the defaults here and as you can see there’s a whole bunch of options but before we look at the options let’s see what it does.

Let’s say I went ahead and I had a path that was Test/Article and maybe there was a link somewhere that was broken and Google index to that link or I sent that link out through Twitter or somehow there’s bad link got clicked on by a couple of people or someone somehow navigated to the site or this page or this URL that doesn’t exists.

So if I went ahead and try to go to this you can see it gives me a Page Not Found, it also lets me know that a search was performed for test article and as you can see I have two results for this so maybe I could click on this one and then I found what I was looking for.

So it helps with typos and URL’s or anything like that, it also make sure that instead of someone just seeing a Page Not Found and leaving to your site maybe they’ll found a Page Not Found to find something that they’re looking for or something else that interest them and it will keep that user from leaving your website.

It allows you to do a couple of other cool things in the configurations so go ahead and take a look at that, go ahead and open up the configuration again and you can have it so it jumps directly to the search result when there’s only one result so that’s kind of a neat little feature and you can read through this and it will use a couple of other or allow you to use a couple of other modules like the Search By Page Module or the Google CSE … CSE Search Modules, you can also do a search with a custom path if you have a view that would … if you have a path parameter you can use the results and push it right into a view, you can use a 301 or redirect it instead of a 302, if it’s a very large site you can disable the auto search and just have it populate the text field with the text so they can go ahead and hit the search button but it does actually perform this search and you can also disable the error message.

So let’s go ahead and save this and give it a try. There’s also a whole bunch of more advance options, it’s pretty self-explanatory on what it does, you can change the page title, add a page text and just change a whole bunch of settings for how the module reacts when you’re actually doing a search.

So let’s go ahead and do this again; as you can see it says please try a search, that’s the text, I got to change the page title, let’s go ahead and try where I will only get one result. You can see it’s redirected from test/article/2 to this actual test article page so it changed the URL and it does redirect to this article page because there was only one result in the listing, if I wouldn’t change it to just to test article again I get both results, I had the two and notice there’s only one result there.
So in this case 301 redirect me directly to the article. So as you can see it’s a really simple module, it can be useful especially if you have a lot of content on your site and you have links that maybe have become broken for whatever reason or you have someone linking to your site and a link that doesn’t or no longer work or maybe it never work.

So go ahead and give it a try, see what you think and let me know if you have any other modules or module development, theme development ideas for future Daily Dose of Drupal videos. Thanks again for watching.

Tags: DrupalDrupal 7SEO

Drupal 7 String Overrides Module

Dec 7, 2012

Description:

Episode Number: 63

The Drupal 7 String Overrides module allows you to easily replace small bits of text across your Drupal 7 website.

In this episode you will learn:

How the Drupal 7 String Override module can be used to replace text in various menu items on a Drupal 7 website What content can not be overridden with the Drupal 7 String Overrides module Full Text: 

Hello everyone and welcome to another Daily Dose of Drupal. Today we’re on Episode Number 63. As always I’m Shane, you can follow me on Twitter @smthomas3, also go to codekarate.com if you haven’t already, sign up for the newsletter, also Google +. This episode we’re talking about the String Overrides Module.

This is another one of those simple easy modules that you can drop in and start using. It basically allows you to replace little bits of text throughout your sites. So rather than having to write a custom module to replace the text of a button maybe or replace the text of the link, you can use this little module to just replace that text and go from there. It’s pretty much a drop-in and go module so go ahead and get started.

I already have this module drop-in and installed on my test Drupal site here so you can see we will go ahead and find that. As you can see this String Overrides Module it also comes with this of String Overrides Migrate but I’m not going to worry about that as that’s more from migration purposes.

So we’ll go ahead and click on Configure, you can of course set the permissions but we’re going to look at the Configuration options. So it basically allows you to type in the original text; in this case you can see up here it’s kind of faded, there’s a log-out link, we’re going to change that to Sign-out instead of Logout. And I’ll change that to say sign-out this context box right here, you can go ahead and ignore that.

It sounds like that’s going to be something that will be useful in the future but as of right now it doesn’t have a lot of uses so in most cases I don’t think there’s anything you can really do there or that you really need to work about it at this point. In Drupal 8 and maybe back ported to Drupal 7 it will be used but it’s not used currently.

Okay so I went ahead and save that, I’m going to close this out and you can see the text changed from log-out to sign-out. So as you can see it’s extremely simple, easy to use but we’re going to go ahead and show or go over what it can and what it can’t do. As you saw it I could of course change this my account link, I can probably change some of these links over here but if I wanted to change let’s say some text in the body, you’re going to notice it’s not going to work, go ahead and drop this in and save that.

Now if I go back to the homepage you’ll notice this text actually wasn’t changed. Base on the way that it works is and if you’ve watched some of the previous episodes of the Daily Dose of Drupal where we’ve done more of the Module Development or Theme Development I’ve discussed using the Drupal T function and it mentions it here I believed, that it easily replaces everything that’s passed through the Drupal T function.

So that includes all your menu links, your buttons most likely, any text that generally any modules that are written that output text will generally be output through the Drupal T function. However that also brings up a point if you’re a module developer make sure you’re using the Drupal T function. So another developer or site builder can use a String Overrides Module to potentially change that text if they need to without having to modify or override code from your module.

It also should be using anyways for translation purposes but that’s really all there is to it, we’re going to go ahead and show one more example here; I’m going to change something up here in this menu, let’s try to say change the word Dashboard to something else just to show one more example of it working and we’ll end on an easy module for the week, also going to go ahead and get rid of this one since we know that it’s not working, you can see in this case for the menu links up here it’s not actually working, go ahead and clear the cache and then it works.

Some of these menu links especially in this case I’m using Admin Menu, the links are cache in the menu s go ahead and clear that and it should work just fine. And that’s all that there is to it today, we just went over the String Overrides Module, just walked you through the very basics of getting it up and running, go ahead and use it to replace small bits of text.

If you need to replace a whole bunch of text and a whole bunch of different areas you may need to look at and running custom module or using some theme functions for some of that just because it can get a little difficult to manage if you have a very long list but for a little small changes like changing log-out to sign-out or changing my account to my profile, things like that. Go ahead and give it a try and see what you think and that’s it for today on the Daily Dose of Drupal. Thanks for watching.

Tags: DrupalDrupal 7

Drupal 7 Administration Menu Module

Dec 7, 2012

Description:

Episode Number: 62

The Drupal 7 Administration menu makes administering your website easier by providing helpful drop-down menus for handling your everyday Drupal administration tasks.

In this episode you will learn:

How to install and use the Drupal 7 Admin menu module How to turn off or disable the core Drupal 7 Admin toolbar How to make the Drupal 7 Admin menu look like the Drupal 7 core toolbar Full Text: 

Welcome to another Daily Dose of Drupal, I’m Shane. As always you can follow me on Twitter @smthomas3, also go to codekarate.com and sign up for the newsletter, you can also find me on Google + if you’re on Google + as well.
Today we’re on Episode Number 62 and we’re going to be going over a module that a lot of you have probably heard of but if not it’s a module that you may want to have heard of.

So after today you’ll of course know how to use it, it’s a very simple module, it’s called Administration Menu and what this allows you to do is it replaces the standard Drupal 7 admin menu that sits on the top or the Toolbar with a slightly more helpful menu that has dropdowns and allows you to get to things much easier.

So if you’re coming from other CMS Systems like Wordpress of Joomla you’re just trying out … and especially Wordpress and you’re just trying out Drupal this may be a little more familiar and maybe more helpful when you’re trying to tackle the Drupal learning curve.

So I’m going to get started; I’ve already downloaded the module but we’re going to go ahead and enable it. I’m going to enable just the administration menu portion and click Save and you’ll notice you might not see a change, there it goes and you may have to clear the cache occasionally, if it doesn’t show up you just click cache and it will be there.

But you’ll notice its showing up on top of the other toolbar so we need that to go away. In order to get that to go away you just come into Modules, find the toolbar module which is in Core and you can just go ahead and uncheck it and save it.
So now that that is uninstalled, so make sure that it did in fact get installed and we’re going to clear the cache. That’s one nice thing about the admin menu or the Administration Menu is you can clear the cache right from this top left corner icon, just flush all the caches.

Now you can see the toolbar … the standard Drupal 7 toolbar is gone. So now you have a so much smaller menu but you can see you have dropdowns so you can add content just by going over the contents, you can easily get to the structure and see what’s in there, you could basically do everything from without having to click and wait for the overlay.

If the overlay still works which is nice but you can of course get to a deeper level without having to click multiple times. So it can be very helpful and as I said before over here flushing the caches, running Cron, getting to the updates as the thing in here is disable the developer modules in drupal.org there’s links to get to the issue queue on modules that you have installed so for instance I have installed the Views Bulk Operations I can go to the Views Bulk Operations issue queue quickly.

So if you feel like you’re having issues you can easily get there. So it’s a very helpful module, very simple but it just works. Turn it on and it works out of the box, you may have to clear the cache but everything else should be good after that.

But if you do like the original Drupal Admin toolbar, you like that design a little bit better than this, there is an administration menu toolbar style here that comes with Admin Menu you can go ahead and install that and as you can see now you have the much more is much similar to the same style that a regular Drupal 7 toolbar that comes with.

So there is it, that’s it for today, extremely effective module for more easily navigating your site especially if you like the idea of not having to click multiple times to get to things. So go ahead and try it out if you haven’t already and go ahead and follow me on Twitter as well. That’s it for today, thanks for watching the Daily Dose of Drupal.

Tags: DrupalMenu SystemDrupal 7UI/Design

Adding Color module integration to your Drupal 7 Sub theme

Dec 6, 2012

Description:

Episode Number: 61

Adding Color module integration to your Drupal 7 Sub theme can make changing colors easy via the admin interface.

Note: Make sure you have the color module enabled.

In this episode you will learn:

How to add color module integration to your Drupal 7 Sub theme How to add an additional color scheme to your Drupal 7 Sub theme Full Text: 

Welcome to another Daily Dose of Drupal, this is Episode Number 61. As always I’m Shane, you can follow me on Twitter @smthomas3 if you haven’t already, you can also go to codekarate.com and sign up for the newsletter over here on the left. Yesterday we went over how to create a Drupal 7 sub-theme.

Today we’re going to be extending that a little bit more and I’m just going to show you how to use or how to use the Color Module or integrate the Color Module into your Drupal 7 Sub-Theme. As you remember yesterday we made a quick sub-theme based on the Bartik Module which comes with Drupal 7.
So I’ll go ahead and show you how that looks and we’ll get started. So we have our themes directory of our site we have Code Karate Bartik which was the sub theme we created yesterday, it has some CSS, it has a template file, a logo screenshot and a couple of other things here.

So what we want to do is we want to add a color module support so I’m going to flip over to the Bartik Theme real quick and show you what that looks like, as you can see if I come back to the homepage now here’s the standard Bartik Theme, it has color module support meaning you can use these preset colors or set your own if you want and if you save it and of course changes the colors and a little bit of … I guess just the colors and just out of the site, look at field so it has a little bit of different look to it.

We’re going to make that work in our sub-theme that we created. So we’re going to go ahead and set this back as a default, our sub-theme we created yesterday, as you can tell the styles are a little off.

So the first thing that I’m going to do is I’m going to go into our Info file and I’m going to get rid of this style that CSS File, so I’m going ;to save that, I’m going to delete that and this will make sure that it’s not using the CSS from our sub-theme anymore and it will in fact use the CSS from the Paste Theme, I believe we’re going to have to clear the cache, let’s give that a go, refresh the page and it should look just like the standard Bartik Theme which it does.

But you’ll notice when you come to the Settings on our sub-theme there’s no color settings. So a couple of things that we have to do; it’s not really complicated but there are quite a few steps. So we’re going to come in here into the Bartik Theme and there’s a Color Directory, we’re going to start by copying that over to our sub-theme, the next thing id if you notice in the Info File there’s a Style Sheet for colors that’s CSS.

I’m going to copy that over into our sub-theme and save that, I’m going to hop back into the Based Theme again and I’m just going to start by copying these colors to that CSS file and put it in the CSS folder of our sub-theme. Now that we have that we’re going open the template.php file in our sub-theme and I go ahead carry to that and I’m going to also open the template.php file from the Bartik Theme.

There’s two pre-process that we need to add in here; the first one is Bartik Pre-Process or Bartik Process HTML so I guess they’re not actual process functions, they’re not pre-process functions, we’ll copy this, I’m going to paste those in we’re going to remove everything but the color module portion, we also need to change the name because our theme name is now different.

So now we have these two pre-process functions in our sub-themes templates.php file, save that, we’re also going to open up that color directory. I’m going to show you what these files look like just so you can see them; we’re not going to be modifying one of them I believed.

As we open all those files up; the first one is color.inc, this one defines the different fields here and this one defines the different schemes. So here you can change your own themes if you would wish.

So Blue Lagoon is the default you can of course change the default colors for each of these sections, it has all of those color options, it also references the CSS file, the Logo file. I’m going to go ahead and change this to Code Karate Bartik, I believe that needs to be done, CSS file is relatively straight forward, there’s nothing you should have to touch in here, the Preview is just a preview and I don’t believe you have to touch anything in the Java Script file either.

So really all you needed to do was make a small change in this color.inc file and we’re going to clear the cache and give it a go and see if it works, clear the cache, hop up to back to our parents page, click on Settings and now you can see we have color integration, we’re going to give it a test to make sure that it actually works, try slate, you can see the preview is working, we’ll save it and it works, perfect.

So that’s really all there is to it and then you can of course come into this color.inc file and change this different schemes and also you may want to open up and take a look at this color.css file. This is where … this file needs to be in place in order to for this entire thing to work. So take a look at those and start creating your own color schemes and just add them in on the bottom, for instance we can just … just a quick example, we’ll call this codekarate and we’ll make just to keep it relatively simple, let’s change one value in there so it’s a little bit different than the slate.

Now if we come back and clear the cache and hopefully it’ll show up, for reason it’s not, let’s figure out why, we’ll change the title and see if that was doing it, everything else looks good, we’ll try it one more time and hope for the best, there it is, you can see it’s a little bit darker on top than the slate was, everything else looks pretty close to the same, save it and then we should be good to go and that’s all for it today.

Thanks again for watching the Daily Dose of Drupal, go ahead and follow me on Twitter if you haven’t already and let me know if there’s anything you want me to cover in a future episode. Thanks again!

Tags: DrupalDrupal 7Theme Development

Hiding Drupal 7 Page Titles using theme_preprocess_page

Dec 5, 2012

Description:

I wrote a post on Hiding page titles for specific node types in Drupal 6, this is just an updated post for Drupal 7.

The code is essentially the same, but requires just a minor change. If you want to hide the page title on only the front page of your Drupal 7 website, add the following code to your themes template.php file (replacing THEMENAME with the name of your theme):

function THEMENAME_preprocess_page(&$vars) { if ($vars['is_front']) { $vars['title'] = ''; } } Type: TextTags: DrupalDrupal 7Drupal PlanetTips and Tricks

Creating A Drupal 7 Sub Theme

Dec 5, 2012

Description:

Episode Number: 60

Update: If you are looking for a written article, check out Master your Drupal Sub Theme.

Drupal has a very flexible theme system that allows a developer to easily create a sub theme that is based off of another theme. This episode goes over creating a sub-theme in Drupal 7.

In this episode you will learn:

Full Text: 

Welcome to the Daily Dose of Drupal, this is Episode Number 60. As always; I’m Shane and you can follow me on Twitter @smthomas3, you can also go to codekarate.com and sign up for the newsletter here on the left if you haven’t already.

Today we’re going to be talking about Theming and more specifically how to create a simple sub-theme. So we’re going to just breeze over the basics of Sub-Theming and how you can use it to start building a sub-theme for your Drupal website. There’s an article on drupal.org called Creating a Sub-Theme which is very helpful.

If you haven’t read it or if you’re looking to learn how to create a sub-theme go ahead and take a look at that and it’ll give you a lot of information that we’re going to cover today but it’ll also go to a lot of details that we’re not going to have time to go over.

So what is a Sub-Theme? Well if your familiar with Drupal, all you’ll know that you can change the theme of your Drupal website, so if I go into the Appearance section on Drupal 7 you can switch from a Bartik theme to this 7 theme, these are both core themes in Drupal, you can see that it of course changes the appearance of the entire website.

What a sub-theme allows you to do is it allows you to extend one of these themes so you don’t have to write every piece of code, you can use Implement and reuse the functionality that you need to build your own theme. So this can be useful for a lot of reasons, you know, saving time from having to rewrite the wheel every time.
So even though you may not be comfortable creating a theme from scratch, creating may actually need the best starting spot for you if you’re learning theme development. There are lots of based themes that are very popular on drupal.org such Zen which is one that I’ve used frequently, Omega and there’s a bunch of other ones you could find. If you look at the popular theme, the top five or ten are mostly self or a lot of them at least are themes that are used mainly as based themes.

What we’re going to do today is we’re just going to take the Drupal 7 Bartik Theme which comes with core Drupal 7 and created very simple sub-theme and just go over what some of the things you can do with some theming in Drupal 7.
So we’re going to get started; the first step is to create as you can see I have my Drupal right here, I’m going to go into the themes directory, this is the Bartik Theme. I’ll be using some information from here but I’m going to go into my sites directories and I’m using a multi-site but this will often be sites all themes and I’m going to create a folder, I’m going to call this Code Karate Bartik.

Inside here I’m going to go ahead and create a file called codekarate_bartik.info and as you can see I already opened up the bartik.info file, I’m also going to ahead and open up this new file I just created. What I’m going to do is I’m going to take most of this, I’m just going to copy this over and we’re not going to use all of it, we’ll be getting rid all of the chunk of it but just as a good starting point I’m going to name it codekarate_bartik subtheme, don’t worry about the package or the version, we’re going to get rid of all the style sheets here and what that will do is it’ll make sure I’m using the style sheets from the core Bartik theme, I’m going to go ahead and keep all these regions, I’m going to get rid of this shortcut link but what the regions do is you’re generally going to want to keep all the regions from the base theme, you can then add your own or modify them if necessary but since all the template file has use this regions it’s best to start with all the regions from the base theme and then you save it and that’s it.

We now have a working sub-theme, I’m going to go ahead and cleat the cache, it’s good for a little fun to do if you add in new themes or changing anything in your themes .info file, I’m going to come in to the appearance and you’ll notice I now have codekarate Bartik, there’s no screenshot so I’m going to … I could add my own but I’m going to just copy the one from Bartik, the logo and the screenshot, copy it over, paste it in, it be looking a little bit better now.

I’m going to go ahead enable this Code Karate Bartik and set it to default. But before we do;