Planet Drupal

Syndicate content - aggregated feeds in category Planet Drupal
Updated: 20 min 21 sec ago

Open Source Training: Schedule Publish and Unpublish Dates for Drupal Content

Tue, 05/13/2014 - 17:27
pimg style=float: right; src= alt=Drupal Scheduler Class /One feature that is common with other software but missing with Drupal is the ability to schedule content.nbsp;/p pThe Scheduler module fills in this gap by allowing you to create content and have it published and unpublished on any day and time you choose./p pThese three videos will give you a great introduction to using Scheduler./p pThese videos are part of a href= complete class on Scheduler/a./pimg src= height=1 width=1/

Mediacurrent: Webinar: You Stay Classy Panels Module

Tue, 05/13/2014 - 17:24
img src= alt= title= class=imagecache imagecache-thumb_blog_spotlight imagecache-default imagecache-thumb_blog_spotlight_default width=200 height=152 / div class=field field-name-body field-type-text-with-summary field-label-hidden div class=field-items div class=field-item even div class=field field-name-body field-type-text-with-summary field-label-hidden div class=field-items div class=field-item even pOn Tuesday, May 20th, Mediacurrent's own Design and Theming Manager, Kendall Totten and Drupal Developer, Derek DeRaps will be leading a webinar with our partners at Acquia on Classy Pannels. This is a session you won't want to miss. For more information,nbsp;a href= target=_blankregister today/a!/p pAbout the webinar:/p /div/div/div/div/div/div AngularJS on top of Drupal

Tue, 05/13/2014 - 16:55
!-- google_ad_section_start --div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpAngularJS can be used along with, or more precisely on top of, Drupal fairly painlessly.img class=image-medium style=float: right; src=/sites/default/files/styles/medium/public/angulardruplicon.jpg?itok=FkxBXDmX alt=/p pI've had a few occasions recently that called for a good deal of javascript to process and display data, and angular really is a great fit for that. Not only is angular a great fit, but since it's pretty painless to build up various content types in Drupal, and then query against those and prepare data to feed to an angular application, pairing Drupal with Angular has been productive, fun, and interesting./p p/div/div/div!-- google_ad_section_end --

Drupalize.Me: We Want to Know: Got Plans for Learning Drupal 8?

Tue, 05/13/2014 - 15:00
div class=field field-name-body field-type-text-with-summary field-label-hidden text-content text-secondarydiv class=field-itemsdiv class=field-item evenHey Drupal community! Drupal 8 is on the horizon, and Drupalize.Me is gearing up to produce hundreds of new videos. Before getting started, we want to know what training you need. Please tell us by completing the following survey. For your time, we'll give you $20 toward a Drupalize.Me membership. Thanks! /div/div/div

Blair Wadman: Recreate a Drupal Feature

Tue, 05/13/2014 - 14:09
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpIn the first part of this a href=/drupal/features-firstDrupal Features guide/a, you learned why Features is a vital tool for Drupal site builders and developers. We then created a new Feature, which contained a Todo list content type. In this part, you will create a View to display the todo list in a block and add the View to the Feature by recreating it. Views are not the only thing you might add to a feature module. You can add a whole range of components, such as image presets, context and strongarm (for variables) to an existing feature./p /div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-abovediv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item even rel=dc:subjecta href=/drupal/features typeof=skos:Concept property=rdfs:label skos:prefLabelFeatures/a/divdiv class=field-item odd rel=dc:subjecta href=/drupal/site-building typeof=skos:Concept property=rdfs:label skos:prefLabelDrupal Site building/a/divdiv class=field-item even rel=dc:subjecta href=/drupal/planet typeof=skos:Concept property=rdfs:label skos:prefLabelPlanet Drupal/a/div/div/div

Ryan Szrama: Beware InnoDB's auto_increment reset on reboot

Tue, 05/13/2014 - 05:00
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpEarlier this year I helped my friend Samuel bring his a href=, a used cell phone reseller.used cell phone resell/a business online using Drupal Commerce. The site is still in maintenance mode while we finish the self-service features, but his staff currently uses it logged in from their various locations as their point of sale system. Knowing the ins and outs of Commerce, I didn't have any problems tailor making an eCommerce application for his business, but I did have one hiccup during deployment that I'd never seen before./p pWe built on a href=http://getpantheon.comPantheon/a, a Drupal Platform as a Service, using a free developer site until it was ready for use in stores. Pantheon really helped us collaborate on the site build, with me doing the coding and configuring while he filled the product catalog. We did everything on the site's dev environment, including letting his partners take a look around to find things worth fixing, until we were ready to go live./p pOne of the last things I did to prepare for the launch was update the auto_increment value of the commerce_order table to account for the number of orders they processed in the previous year and a half. However, we weren't really migrating old eCommerce data, so I just expected the first order on the new site to start where we wanted and we'd watch them grow from there. A quick test showed it working as expected, so I deleted the dummy orders and sent him a link to upgrade the account to a paid plan to take it live./p pUnfortunately, when I went back to the site the next day, I saw that orders were being created with IDs starting back at 1. I knew there was nothing in Commerce that would effect such a change, so I hit up Pantheon support and got a quick confirmation that nothing they do would intentionally reset auto_increment values either./p pSidebar: I really should emphasize emquick/em. Any time I've ever contacted Pantheon support, they've responded right away. Groovy, said Josh Koenig in this particular instance when we nailed down what was happening. Groovy, I say to Pantheon's customer service. img src= alt=Cool //p pIt turns out what I experienced was a result of a href='s treatment of auto_increment values/a. The auto_increment counter is only stored in memory, not on disk, and it is recalculated on server startup. InnoDB simply looks for the highest used ID and sets the counter to the next value, explaining why my order IDs shrunk back down to 1 after I cleared out all of our dummy orders./p pIn our case, it was the upgrade from a free account to a paid account that restarted the database server, triggering the reset of the counter. However, with cloud based Platforms as a Service, I imagine there are other scenarios where an expected alteration to an auto_increment value is apparently lost on migration between environments or builds. This is probably mostly an eCommerce issue with respect to Drupal sites, as merchants often want or need order IDs to account for historical sales, but perhaps the tip can save someone else a bit of head scratching./p pTo get around my issue, I simply reset the auto_increment to where I wanted it to be, created a cart order for myself, and waited for a real order to be created before deleting my dummy order./p pProblem solved, it's been fun to watch the order count grow from there./p pspan class=captionPhoto credit: a href= Barnes/a/span/p /div/div/div

Midwestern Mac, LLC: Drupal and Node.js at STLJS Meetup - Thursday, May 15!

Tue, 05/13/2014 - 04:18
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpa href= src=/sites/ width=180 height=180 alt=STL.JS Meetup Logo style=float: right; margin-left: 1em; margin-bottom: 1em; //aI'll be presenting a href= and Drupal — Working Together/a at the STL.JS meetup this Thursday, May 15, at a href= Able Few/a in St. Louis./p pIn the presentation, I'll basically be covering how a href= uses Drupal and Node.js to deliver a simple, fast, and stable server monitoring service. During the course of the presentation, I'll touch on why and how Server was built, how Ansible is used to maintain the infrastructure, and the effectiveness of lightweight marketing, blogging, and 'low end box' servers./p/div/div/div

2bits: Configuring Apache Solr 4.x for Drupal, with password authentication

Mon, 05/12/2014 - 21:34
Most of high traffic or complex Drupal sites use Apache Solr as the search engine. It is much faster and more scaleable than Drupal#039;s search module. In this article, we describe one way of many for having a working Apache Solr installation for use with Drupal 7.x, on Ubunutu Server 12.04 LTS. Objectives For this article, we focus on having an installation of Apache Solr with the following objectives: Use the latest stable version of Apache Solr pa href= target=_blankread more/a/p

AGLOBALWAY: Drupal CKEDITOR configuration to work with bootstrap theme

Mon, 05/12/2014 - 20:55
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encoded p class=leadDrupal and Bootstrap theme are awesome, but when it comes to use ckeditor you can loose some nice framework styles and it can break your responsive website by adding a simple image or table. One of the ways of fixing it is using a simple configuration to extend and adjust ckeditor./p h4Adding Boostrap Components to your ckeditor styles and adding extra configuration to ckeditor.config.js/h4 pBefore we start copy the emsites/all/modules/ckeditor/ckeditor.styles.js/em and emsites/all/modules/ckeditor/ckeditor.config.js/em file into your theme directory (emthemes/bootstrap//em), and enable them in your ckeditor profile (emin CSS tab Predefined styles chose “Define path to ckeditor.styles.js” and change Predefined styles path to “%t/ckeditor.styles.js” and in ADVANCED OPTIONS tab check Load ckeditor.config.js from the theme path to yes/em). You will need to also enable “styles” menu in your ckeditor toolbar and you may want to use your theme styles to preview ckeditor styles before saving your content./p olliOpen your ckeditor.styles.js, and comment or remove all useless styles.div class=highlight pre code class=bash if(typeof(CKEDITOR) !== 'undefined') { CKEDITOR.addStylesSet( 'drupal', [ ]); } /code/pre /divpemYou should have something like this/em/p/lili2. Copy new bootstrap styles in your ckeditor.styles.js. And save the filediv class=highlight pre code class=bash /* Bootstrap Styles */ /* Typography */ { name : 'span.H1' , element : 'span', attributes: { 'class': 'h1' } }, { name : 'span.H2' , element : 'span', attributes: { 'class': 'h2' } }, { name : 'span.H3' , element : 'span', attributes: { 'class': 'h3' } }, { name : 'span.H4' , element : 'span', attributes: { 'class': 'h4' } }, { name : 'span.H5' , element : 'span', attributes: { 'class': 'h5' } }, { name : 'span.H6' , element : 'span', attributes: { 'class': 'h6' } }, { name : 'Paragraph Lead' , element : 'p', attributes: { 'class': 'lead' } }, { name : 'Unstyled List', element : 'ul', attributes : { 'class' : 'list-unstyled' } }, { name : 'List inline', element : 'ul', attributes : { 'class' : 'list-inline' } }, { name : 'Table', element : 'table', attributes : { 'class' : 'table' } }, { name : 'Table Striped rows', element : 'table', attributes : { 'class' : 'table table-striped' } }, { name : 'Table Bordered', element : 'table', attributes : { 'class' : 'table table-bordered' } }, { name : 'Table Hover rows', element : 'table', attributes : { 'class' : 'table table-hover' } }, { name : 'Table Condensed', element : 'table', attributes : { 'class' : 'table table-condensed' } }, { name : 'Image shap rounded', element : 'table', attributes : { 'class' : 'img-rounded' } }, { name : 'Image shap circle', element : 'table', attributes : { 'class' : 'img-circle' } }, { name : 'Image shap thumbnail', element : 'table', attributes : { 'class' : 'img-thumbnail' } }, { name : 'Image float left', element : 'table', attributes : { 'class' : 'pull-left' } }, { name : 'Image float right', element : 'table', attributes : { 'class' : 'pull-right' } }, /code/pre /div/liliOpen your ckeditor.config.js, search for “config.justifyClasses” and replace it with this line:div class=highlight pre code class=bash config.justifyClasses = [ 'text-left', 'text-center', 'text-right', 'text-justify' ]; /code/pre /divpemThis will change default text alignment classes to new bootstrap classes/em/p/liliAt very bottom of ckeditor.config.js, copy and paste this lines.div class=highlight pre code class=bash CKEDITOR.on('dialogDefinition', function( ev ) { var dialogName =; var dialogDefinition =; if(dialogName === 'table' || dialogName == 'tableProperties' ) { var infoTab = dialogDefinition.getContents('info'); //remove fields var cellSpacing = infoTab.remove('txtCellSpace'); var cellPadding = infoTab.remove('txtCellPad'); var border = infoTab.remove('txtBorder'); var width = infoTab.remove('txtWidth'); var height = infoTab.remove('txtHeight'); var align = infoTab.remove('cmbAlign'); } if(dialogName === 'image') { var infoTab = dialogDefinition.getContents('info'); dialogDefinition.removeContents( 'Link' ); dialogDefinition.removeContents( 'advanced' ); infoTab.remove('txtWidth'); infoTab.remove('txtHeight'); infoTab.remove('txtBorder'); infoTab.remove('txtHSpace'); infoTab.remove('txtVSpace'); infoTab.remove('ratioLock'); infoTab.remove('cmbAlign'); } }); /code/pre /divpemThis will remove default inline styles like a width and height from image/table configuration popup./em/p/li/ol pReference:br /a href= /div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-abovediv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item even rel=dc:subjecta href=/tags/drupal typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=drupal/a/divdiv class=field-item odd rel=dc:subjecta href=/tags/drupal-planet typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=drupal planet/a/div/div/div

Get Pantheon Blog: Moving MySQL tables from MyISAM to InnoDB

Mon, 05/12/2014 - 19:00
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpa href= target=_NEWimg alt=MySQL logo height=115 width=170 style=float: left; padding: 10px class=media-element file-default src= title= //aOne of the greatest things ever to happen to a href= target=_NEWMySQL/a was the a href= target=_NEW InnoDB/a engine. Before InnoDB, indexes would get corrupted, updates meant table locks, not just row locks, and we had no support for transactions. Since the advent of InnoDB however, we've come a long way. These days, most serious DBAs using MySQL build exclusively on the InnoDB engine./pp!--break--/ppSadly though, many sites are still using the MyISAM engine. Some are hosted on shared hosting servers and some just don't have a proper DBA to look after their databases. For whatever the reason, these sites are missing out on the performance and stability gains that the rest of us take for granted. At Pantheon, we know there are a lot of these sites out there because we see them when they migrate their sites onto our platform. As part of our a href= target=_NEWLaunch Check/a, we check the engine type on every table. If we find a table using the MyISAM engine, we notify the user so they can fix it./p pFixing this problem is simple to any developer who understands a little SQL. However, for non-developers, this can be a daunting task. So I have put together a little PHP script to help you convert your MyISAM tables to InnoDB./p p style=background-color: black; color: white; border: 1px black solid; padding: 10px;NOTE: This is an unofficial script. It is not supported by Pantheon. Customer Support will not help you run it, nor will they hold your hand while fixing things if this script screws up your database. strongUse THIS SCRIPT AT YOUR OWN RISK./strong I strongly suggest you make a backup of your database before running this script.nbsp;/p h2The Easy Way/h2 pStill with me? Cool! Let's dive right in.nbsp;/ppThere are 2 versions of this script. One is meant to be called from a web browser. It is meant for Pantheon customers. If you are a Pantheon customer, save the code in a file with the extension .php and sftp it up to your site. Place it in the code directory of your website./p pNow, point a browser to your newly created script that should be in the root directory of your Dev environment./p p pThat is all there is to it. The script will do all the work. You don't need to change anything./p pHere is the browser version of the script:/p script src= h2The Developer Way/h2 pIf you are not a Pantheon customer, or you want to run the script from the command line, use the one below. To use this one however, you need to know two things before you begin./p olliYou have to have PHP installed on the computer you want to run this on. I run this on my laptop. I have PHP installed on my laptop. I know that because I can type php -v at the command line and I get a proper response. If you do not understand any of that, this script is not for you, use the one above./liliIf you are a Pantheon customer, you can get your database connection info from your site's dashboard. Make sure you get the information for your Dev environment. After you've run the script, and everything looks good, you can easily migrate it up the line to Test and then Live. If you are running this on your site and your site is not on Pantheon, you will have to find another way to get your MySQL connection info./li/olp/ppHere is the command line script:/p script src= pSee the line that says * DO NOT CHANGE ANYTHING BELOW THIS LINE? I'm serious about that. If it doesn't' work and you are not a programmer, don't mess with it. If you are a programmer, you realize exactly how dead-simple the script is./ppHere are the parameters you will need to configure before running the script./pullihost = This is the name of the machine your db is running on. If you are a Pantheon customer localhost is strongWRONG/strong. Get the correct host and paste it in there replacing localhost.nbsp;/liliport = This is the port that is running MySQL on your computer. Again, if you are a Pantheon customer, we give you this information. If you are not, 3306 is the standard port for MySQL.nbsp;/liliuser = This is the user name you use to connect to MySQL with.nbsp;/lilipassword = This is your MySQL password for the user you specified in the line above./lilidatabase = This is the name of the database that contains the tables. If you are a pantheon customer, this is pantheon. If you are not a Pantheon customer, you will need to get this from your host./li/ulpNow, save the file./ppThen from a command window execute the program. (How you get a command window varies by OS. If you don't know, ask your computer friend, younger sibling, or niece.)/ppThe script will tell you everything it is doing. It has safeties built in to keep it from changing anything by MyISAM tables. It will look at every table in your database and if the engine is MyISAM, it will change it to an InnoDB./ppOnce you have run it successfully, strongcheck everything!nbsp;/strong/ppThis is not a particularly dangerous script. The change is pretty simple. However, it's your data. So be careful.nbsp;/p/div/div/divdiv class=field field-name-field-blog-categories field-type-taxonomy-term-reference field-label-abovediv class=field-labelBlog Categories:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/blog/engineeringEngineering/a/div/div/divdiv class=easy_social_box clearfix horizontal easy_social_lang_und div class=easy_social-widget easy_social-widget-twitter firsta href= class=twitter-share-button data-url= data-count=horizontal data-lang = en data-via= data-related=:Check it out! data-text=Moving MySQL tables from MyISAM to InnoDBTweet/a/div div class=easy_social-widget easy_social-widget-facebookiframe src=//;href=https%3A//;send=falseamp;layout=button_countamp;width=88amp;show_faces=trueamp;action=likeamp;colorscheme=lightamp;font=amp;height=21amp;appId= scrolling=no frameborder=0 style=border:none; overflow:hidden; width:88px; height:21px; allowTransparency=true/iframe/div div class=easy_social-widget easy_social-widget-googleplusdiv class=g-plusone data-size=medium data-annotation=bubble data-href= div class=easy_social-widget easy_social-widget-linkedin lastscript type=in/share data-url= data-counter=right/script/div /div !-- /.easy_social_box --

drunomics: #d8rules - Supporting the Rules modules for Drupal 8

Mon, 05/12/2014 - 18:12
pToday, I've the pleasure to introduce the a href= initative, our combined effort to get the a href= module ported to Drupal 8 in time!/p pa href=http://d8rules.orgimg alt=#d8rules logo src= style=width: 580px; height: 138px; //a/p h3Drupal 8 is coming.../h3 pFortunately, the first beta of Drupal 8 is coming closer so it's time to make sure all the modules are ported and ready for Drupal 8. Unfortunately, the Rules module - my long term number one contributed module - is about to be left behind. I've worked a lot on Drupal 8 to get critical Entity API improvements like the new a href= Field API/a (called Entity Property API at the time of the introduction) as well as the new Typed data API done. Of course, the work on core is time intensive, not done yet and won't stop - so there is not a lot contribution time left for my contributed modules. ://p h3So where is Rules for Drupal 8 now?/h3 pIn short, it's not there yet. While quite a bit of work under the hood and planning has been done already, the main work - porting of the module itself - is still to be done. As Drupal 8 ships with quite a bunch of important improvements, this requires the rewrite of significant parts of the module. In Drupal 7, the Rules module had to solve a lot of hard problems like handling its configuration, configuration translation, dependency tracking, integrity checks and plugins, which all have solutions in Drupal 8 core now. That's strongawesome/strong, but it requires us to adapt the previous Drupal 7 solutions to work inline with Drupal 8 best practices. However, more than that - the foundational metadata Rules needs is already there as well!/p h3The foundation is (mostly) there/h3 pIn Drupal 7 the creation of the a href= API/a module, in particular its Entity Metadata wrappers and the backing Entity Property Information, was driven by the needs of the Rules module. While the Rules module makes it simple to work with data for site builders, the Entity module makes it simple for developers first. Subsequently, the Rules module can build upon the easy API and make it accessible via the rule model and its UI. For Drupal 8, the Entity Field API and its underlying Typed Data API are that easy API upon which the Rules module can build upon. That's great, as it means we have the foundation we can build upon in place - but again, it changed (improved) substantially and will require us to adapt a lot of what's there. However, having the Typed Data API and all the necessary metadata built-in means that the out of the box module and entity type support of Rules for Drupal 8 will be substantially better as well./p h3Actions and conditions in core/h3 pWe've got an Actions and Conditions API in core already, so one might think another huge part has been taken care off. Unfortunately, no - those APIs have been created/ported with other use cases in mind, so they do not cater for all the more advanced features Rules users are used to. While I tried to make sure they fit Rules needs as far as possible when they were introduced/updated, they do not fit our needs yet and it might be impossible to make them fit without breaking those APIs. For Rules 8.x we plan to work on improving those APIs (from contrib) as needed first, so we can ensure they fit Rules' requirements. Once we are sure everything works out we'll know what we have to adapt and whether improvements can be contributed to core. Depending on how that works out, we'll see whether we can build up on the core Action and Conditions API or there will be Rules' variants of those APIs (again :(). For more details please see the related issues:/p ullia href= 8.x Architecture/a /li lia href= 8.x Roadmap/a/li /ulh3We have a plan/h3 pWe've quite some work to do to get Rules ported to Drupal 8. a href= and me estimated the task to be additional 1050 hours work (from here). With us, working on it in our spare time besides our other contributions (Entity Field API, Rest module in core, ..) we figured the module won't be ready before sometime in 2015, not unlikely even 2016. That's obviously too late, so we'd love to invest more of our time and work on it during work hours as well, such that we can deliver a ported version in 2014. Our companys cannot afford taking that investment alone, but are up for supporting us and enable us to work on a community rate of € 45/h net cost for the project. You can find more details on the project plan and estimations on our a href= site/a./p h3Rules needs your help!/h3 pIf you think the Rules module is a valuable tool and helps you building sites faster, please consider supporting our iniatitive! There is a limited goodie for the 50 first supporters pledging gt;65$ - a href= it out/a. If you are going to Drupalcon Austin and you'd love to help, consider a href=;usp=drive_web#gid=0signing up/a for the #d8rules sprint! We'll get started porting either events, conditions or actions to the new API. Lastly, please help to spread the word! We've got supporter badges that you can embed on your site, and obviously our hash tag is stronga data-dnt=true data-related=d8rules data-size=large data-url= href= target=_blank#d8rules/a/strong!/p p class=rtecenter iframe allowfullscreen= class=media-youtube-player frameborder=0 height=330 src=//;rel=0amp;showinfo=0 title=#d8rules width=517Video of #d8rules/iframe/p p class=rtecentera href= alt= src= style=width: 400px; height: 230px; //a/p p class=rtecenter /p h3Resources/h3 pIniative website: a href=http://d8rules.org / campaign: a href= / Project page: a href=

Stanford Web Services Blog: Module of the Day: JS Injector

Mon, 05/12/2014 - 18:09
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedp class=summaryToday's a href= of the Day/a is a handy little module called strongJS Injector/strong that allows you to insert snippets of Javascript into your site./p pIn this post, I'll walk through how to enable and configure the module, use it to shout, Hello, World!, and then go into some more advanced configuration./p/div/div/div

Web Omelette: Sending HTML Emails with Webform in Drupal 7

Mon, 05/12/2014 - 09:12
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpHave you ever wondered how you can include HTML markup in the emails you send with Webform? Out of the box, you cannot. But I am going to show you a simple way to achieve this using the emMime Mail/em module and some simple theming. Additionally, I will show you how to control which webforms should send HTML emails and which should not./p pFirst though, make sure you install and enable the emMime Mail/em and emMail System/em modules (the latter is a dependency of the former). With Drush, all you have to do is use this command:/p precodedrush en mimemail -y /code/pre pIt will take care of all you need to do. If you commit the module to your repo, don't forget that the emMail System/em module also gets downloaded, so make sure you include it as well./p pNext, edit your theme's codetemplate.php/code file and paste this block of code (explained after):/p precodefunction your_theme_webform_mail_headers($variables) { $headers = array(); $headers = array( 'Content-Type' =gt; 'text/html; charset=UTF-8; format=flowed; delsp=yes', 'X-Mailer' =gt; 'Drupal Webform (PHP/'. phpversion() .')', ); return $headers; } /code/pre pMake sure you change codeyour_theme/code with the name of your theme. So what happens here? We override the a href=!webform!webform.module/function/theme_webform_mail_headers/7theme_webform_mail_headers()/a declared by the Webform module. We do this in order to add a codecontent type/code to the mail headers, and set it to HTML. And that's pretty much it./p pIf you now clear your caches and test a webform, you'll see that you can add anchor tags and other basic HTML tags./p ppOne problem you might run into though is that all your webforms are now sending emails in HTML format - a result only partially desired. You'll notice that the default email that you send no longer provides any spacing and all the text gets put on one line - as HTML in fact./p pSo what you can do is make a selection of webforms for which you'll want HTML emails. A handy way of doing this is by adding a field to your webform content type that will be used to swith HTML emails on/off for a given node. So to illustrate this, let's say we added a new field to the relevant content type called emHTML Emails/em (with the machine name: codefield_html_email/code). This field is a boolean type (a single checkbox basically) with the values of 1 for on and 0 for off./p pIt follows to adapt the theme override above and replace it with something like this:/p precodefunction your_theme_webform_mail_headers($variables) { $headers = array( 'X-Mailer' =gt; 'Drupal Webform (PHP/' . phpversion() . ')', ); // Get the HTML Email field $html_email_field = field_get_items('node', $variables['node'], 'field_html_email'); // Check if this webform node needs to send HTML emails if (!empty($html_email_field)) { $html = $html_email_field[0]['value'] == 1 ? TRUE : FALSE; } if ($html === TRUE) { $headers['Content-Type'] = 'text/html; charset=UTF-8; format=flowed; delsp=yes'; } return $headers; } /code/pre pIf you consult the documentation for this theme function, you'll know that the code$variables/code parameter contains also the node object which uses Webform to send the email. So we basically check for the value of our field and if it is 1, we add the HTML information to the mail headers. Otherwise, we return the code$headers/code array containing the value it does by default (essentially making no changes)./p pYou can now clear the caches and test it out. Edit a node of the respective content type and check the box. You'll see that it now sends HTML emails. However, if you uncheck the box, it will fallback to the default format that comes with the Webform module./p pHope this helps./p /div/div/divdiv class=field field-name-field-categories field-type-taxonomy-term-reference field-label-hiddenIn span class=field-itemsspan class=field-item evena href=/drupal-themingTheming/a/span | span class=field-item odda href=/drupalDrupal/a/span/span/divdiv class=sharethis-buttonsdiv class=sharethis-wrapperspan st_url= st_title=Sending HTML Emails with Webform in Drupal 7 class=st_facebook/span span st_url= st_title=Sending HTML Emails with Webform in Drupal 7 class=st_twitter st_via=drupalexp/span span st_url= st_title=Sending HTML Emails with Webform in Drupal 7 class=st_googleplus/span script type='text/javascript'var switchTo5x = true;/scriptscript type='text/javascript' src=''/scriptscript type='text/javascript'stLight.options({publisher:dr-8de6c3c4-3462-9715-caaf-ce2c161a50c});/script/div/div

Ryan Szrama: Beyond Wombats

Mon, 05/12/2014 - 04:35
div class=field field-name-field-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item even rel=og:image rdfs:seeAlso resource= href=/blog/05-11-2014/beyond-wombatsimg typeof=foaf:Image src= width=220 height=126 alt=To boldly go where no wombat has gone before... //a/div/div/divdiv class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpI accidentally started publishing open source software in 2006, the first integration of the QuickBooks Web Connector with anything. This was pre-Ubercart when I was just cutting my teeth on PHP / MySQL development at a href=http://primasupply.comPrima Supply/a, and I thought it would be fun to claim the code was written by wombats while I just published it online. I decided to own the silliness and start blogging on using Drupal 4.7 at the time - and immediately picked up a freelance contract doing QuickBooks integration work./p/div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-inline clearfixdiv class=field-labelTopics:nbsp;/divdiv class=field-itemsdiv class=field-item even rel=dc:subjecta href=/topics/drupal typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Drupal/a/divdiv class=field-item odd rel=dc:subjecta href=/topics/work typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Work/a/div/div/div