Drupal Planet

Syndicate content
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 11 hours 55 min ago

Microserve: Coding in the Cloud

Mon, 08/04/2014 - 4:39am
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=http://www.microserveltd.co.uk/sites/default/files/styles/large/public/field/image/codio_0.jpg?itok=IhPAnYLTimg typeof=foaf:Image src=http://www.microserveltd.co.uk/sites/default/files/styles/large/public/field/image/codio_0.jpg?itok=IhPAnYLT width=420 height=240 alt=Codio: a cloud IDE //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:encoded pAn old timer like myself couldn't help but be filled with trepidation when it was revealed I'd be acting as the company guinea pig to give cloud based development a viability road test on my latest project./p pNo matter how cool I played it, the momentary panic at the thought of working without the tried and tested 'REAL' software apps installed on my macbook, must have been visible on my face./p h2You'll have to pry my favourite text editor out of my cold dead hands!/h2 pI've been used to the same comfy workflow for the last few years./p pA local environment comprising of the same trusty text editor/IDE, a LAMP stack running on MAMP and code versioning using GIT. There was just something about 'cloud based coding' that didn't seem to ring true./p h2Pause For Thought/h2 pThen when i really thought about it, I began to examine just how much of my professional and personal life had already drifted into the cloud and in most cases for the better./p pThanks to Google, Dropbox and Apple amongst others, my email, calendars, notepads, files, photos, videos and documents have for the most part been in the cloud for ages. Do I miss opening up MS Word to write a letter? No./p pThen I thought about how much easier life as a Drupal developer had become since adopting tools like Drush, Git and more recently, the Pantheon platform. (in essence 'cloud' based tools themselves.) So, thinking about it, cutting the last few remaining ties to local, machine specific workflow seemed less of an imposition and more like the next natural step in the evolution of web development./p h2Where to start?/h2 pAfter a bit of googling 'cloud based IDE', you'll see there's already quite a few choices. Most seem to follow a similar basic subscription paradigm (one or a number of free public projects and a paid for plan for private/production projects.)/p pIn most cases they provide a fully functioning text/code editor with text highlighting support, basic options for uploading, renaming and deleting files, a cloud based LAMP stack, some kind of terminal or command line and a selection of optional 'plugin' tools./p h2Roadtest/h2 pI've been testing Codio: a href=https://codio.com/https://codio.com//a/p pThe site I've been working on is a Drupal 7 site that arrived with us, half built./p pCodio handled the import of the existing database and files without much hassle and pulled in the code base via Git./p pI was able to install drush as a Codio ‘part' (plugin) and was installing essential modules via Codio's command line terminal in no time./p pThere's a nice file tree in the left pane and the editor itself is a real pleasure to use./p pI was impressed to find text highlighting support for SASS/LESS out of the box and it had decent poke at autocomplete of attributes./p pThere's a handy tab in the main menu which opens your project 'box' in a new tab or window and on a decent sized screen, it's pretty easy to get a nice comfortable layout with your code in one window and the running site in another./p pOne of the best things about Codio is that all changes to code are instant, with no saving or incremental Git commits needed. You only need to refresh your site to see it update./p pOnce you've done a tranche of work you're happy with, you can commit as you normally would, either using the in-built terminal or the GUI menus./p h2Conclusion/h2 pBy the end of day one I had been totally sold. The feeling of freedom was, well.. liberating. The next day I had to set up a new mac to use at work, and usually this process eats up half a day of downloading latest versions of software, configuring, chasing licences etc. In this case I literally just turned on the new laptop, installed my browser of choice, logged into Codio and I was away!/p pOf course, with everything, there are some niggles. The most obvious downside to cloud based development is, that when your connection is spotty or you suffer an outage, you're immediately incapacitated. A few days in and the Codio servers themselves had a few hours of intermediate drop outs. You can imagine how frustrating this might be if you were riding up close to a deadline./p pBut on the whole the good far outweighed the bad and I'm sure that service and reliability is only going to improve as web based coding becomes the norm... Which i'm now convinced it will before too long./p h2Pros and Cons of Web Based Development/h2 h3Pros/h3 ulliCode anywhere that has a connection/li liCollaborate more easily with other developers/li liNo local apps needed other than a browser/li liPlatform agnostic (Makes things like Chromebooks slightly more viable as a stripped down development machine)/li liLess chance of incompatible files being shared between collaborators/li liFewer problems for code team Sysadmins./li /ulh3Cons/h3 ulliReliant on reliable internet connection and host server/li liBasic file, folder housekeeping can be a bit laborious./li /ulp*I should point out that my experiences are with Codio IDE, but there are many other alternatives available. Cloud 9 seems to be proving very popular for instance.br /You can find a rundown of some of the most popular here:br /a href=http://www.hongkiat.com/blog/cloud-ide-developers/http://www.hongkiat.com/blog/cloud-ide-developers//a/p /div/div/div
Categories: Drupal Feeds

Drupal core announcements: Fixing double-escape bugs

Sun, 08/03/2014 - 2:18am
pSince Twig autoescape is on, there are a href=https://www.drupal.org/node/2289999double escape bugs/a. If you can fix them by refactoring code into Twig templates, that's great. If not then wait for a href=https://www.drupal.org/node/2289999an easy way to create HTML on the fly without having to create a theme function / template/a. It's already RTBC, it's a matter of days to find its way in. Regarding codeSafeMarkup::set/code calls, there is an issue to a href=https://www.drupal.org/node/2297703refactor and remove/a the ones we needed to add to get tests pass and so adding more is not acceptable (the reason for writing this announcement are the quick fix issues I need to whack trying to fix double escape by adding more of these)./p
Categories: Drupal Feeds

Károly Négyesi: OOP developer experience: snap to grid

Sun, 08/03/2014 - 12:47am
pAfter writing my first Drupal 8 a href=http://drupal4hu.com/node/400contrib module/a I have a new appreciation. Let me try to explain. It is certainly possible to write a letter on an empty sheet of paper but achieving tidy results is quite a lot easier if it's a lined sheet. In Drupal 7, the code flow in general is calling a function, getting an array, manipulating the array and passing it to another function. Pretty much anything goes. In Drupal 8, you are handed an object and the object has methods. Instead of trying to figure out which possible function are you continuing with, it is one of the methods. When passing on data, the receiving method (hopefully) has a helpful type hint which tells you what to pass in. Often even the argument name will be helpful too./p pIt's exactly like having a lined paper: you still need to know how to produce legible handwriting but at least you have a guide. Another apt metaphor is lining up shapes in a drawing program. Yes, it's possible by hand and there's more freedom doing it but for most it's easier to just use the snap to grid feature./p pThis blog post was inspired by codeConfigDevelAutoImportSubscriber/code having a code$this-gt;configManager/code object. That I need a config manager I have copied from a core file doing similar things. So, I wanted to create an entity -- I already know doing that requires calling the codecreate/code method of the relevant storage controller. But how do you get one? Well, codeConfigManagerInterface/code only has 10 methods and only 1 looks even remotely relevant: codegetEntityManager/code. So now I have a codeEntityManagerInterface/code object. Look, a codegetStorage/code method./p pdiv class=codeblockcodespan style=color: #000000span style=color: #0000BBlt;?phpbr /$entity_type_id /spanspan style=color: #007700= /spanspan style=color: #0000BB$this/spanspan style=color: #007700-gt;/spanspan style=color: #0000BBconfigManager/spanspan style=color: #007700-gt;/spanspan style=color: #0000BBgetEntityTypeIdByName/spanspan style=color: #007700(/spanspan style=color: #0000BB$config_name/spanspan style=color: #007700);br //spanspan style=color: #0000BB$entity_storage /spanspan style=color: #007700= /spanspan style=color: #0000BB$this/spanspan style=color: #007700-gt;/spanspan style=color: #0000BBconfigManager/spanspan style=color: #007700-gt;/spanspan style=color: #0000BBgetEntityManager/spanspan style=color: #007700()-gt;/spanspan style=color: #0000BBgetStorage/spanspan style=color: #007700(/spanspan style=color: #0000BB$entity_type_id/spanspan style=color: #007700);br //spanspan style=color: #0000BB$entity /spanspan style=color: #007700= /spanspan style=color: #0000BB$entity_storage/spanspan style=color: #007700-gt;/spanspan style=color: #0000BBcreate/spanspan style=color: #007700(/spanspan style=color: #0000BB$data/spanspan style=color: #007700);br //spanspan style=color: #0000BB?gt;/span/span/code/div/p pWe could call this autocomplete driven development cos the autocomplete in your IDE pretty much drives you forward. Oh yeah: trying to develope D8 without an IDE is not something I'd recommend./p
Categories: Drupal Feeds

cs_shadow: Entity Embed module demo

Sat, 08/02/2014 - 3:49pm
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpMidterm evaluations for GSoC are over and I've released a short demo for the entity embed module: a href=https://www.youtube.com/watch?v=T26oz9H-VBYIntroducing Entity Embed module for Drupal 8/a. This screencast explains the basic idea behind the module and its usage.br / It's also time for the status update of what I've been doing for past couple of weeks. Apart from making the demo, a significant amount of work has been done since my last blog post. Some important issues that were solved over past couple of weeks include a much better test coverage, adding a preview of entity in CKEditor, adding support for alignment of embeds, and some code cleanup. Also, travis-ci is now enabled for the github repo so it has become far much easier to run tests on new pull requests and commits.br / Check out the video and if you have any issues, feel free to open a ticket on the a href=https://www.drupal.org/project/issues/search/entity_embedentity embed issue queue on d.o/a or a href=http://chandansingh.net/contactcontact me directly/a./p /div/div/divdiv class=sharethis-buttonsdiv class=sharethis-wrapperspan st_url=http://chandansingh.net/blog/entity-embed-module-demo st_title=Entity Embed module demo class=st_twitter_hcount displayText=twitter/span span st_url=http://chandansingh.net/blog/entity-embed-module-demo st_title=Entity Embed module demo class=st_facebook_hcount displayText=facebook/span span st_url=http://chandansingh.net/blog/entity-embed-module-demo st_title=Entity Embed module demo class=st_linkedin_hcount displayText=linkedin/span span st_url=http://chandansingh.net/blog/entity-embed-module-demo st_title=Entity Embed module demo class=st_googleplus_hcount displayText=googleplus/span /div/div div class=field field-name-field-tags field-type-taxonomy-term-reference field-label-inline clearfixdiv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item even rel=dc:subjecta href=/tags/drupal-planet typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Drupal Planet/a/divdiv class=field-item odd rel=dc:subjecta href=/tags/google-summer-code typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Google Summer of Code/a/div/div/div
Categories: Drupal Feeds

Cruiskeen Consulting: The Joys of Configuration!

Sat, 08/02/2014 - 1:25pm
div class=field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss view-mode-rssdiv class=field-itemsdiv class=field-item evenpAt the moment we're working on a fairly BIG Drupal 6-Drupal 7 migration for the a title=Twin Cities Daily Planet href=http://tcdailyplanet.net target=_blankTwin Cities Daily Planet. /a/p pAs part of that I am attempting to get the rather unwieldy site completely under code and configuration management.  The code part is well understood (well, at least by others) and semi working for us, so I'm not going to talk about the issues of getting sites under control of git - lots of others have written about that.  I am going to talk about the configuration management part./p pI have always been more than a little disheartened by the use of Features to control all those icky parts of the site that are held in the database rather than code.  For one thing, that's not really what Features was intended to do - it was intended to pile up a single hunk of site functionality and turn it into a feature.  This I can dig, but from a general site administration viewpoint it is a pretty awkward tool.   So I was really excited to realize that this whole configuration issue is being seriously worked on in Drupal 8, and that all of those messy things in the database will now get written out into flat config files that can actually be code managed.  I was even MORE excited to see a few  months back that there is now a a title=Configuration module on d.o. href=https://drupal.org/project/configuration target=_blankconfiguration module/a for Drupal 7. This looked to me like it was strongexactly/strong what the Doctor. ordered.   But as often happens, the drug seems to have some side effects./p p/div/div/divdiv class=field field-name-taxonomy-vocabulary-8 field-type-taxonomy-term-reference field-label-hidden view-mode-rss view-mode-rssul class=field-itemsli class=field-item evena href=/taxonomy/term/75Drupal/a/lili class=field-item odda href=/taxonomy/term/189Planet Drupal/a/li/ul/div
Categories: Drupal Feeds

Drupal core announcements: Drupal core security release window on Wednesday, August 6 (NOTE: Change from normal schedule)

Fri, 08/01/2014 - 4:32pm
div class=field field-type-datestamp field-field-start7 div class=field-items div class=field-item odd div class=field-label-inline-first Start:nbsp;/div span class=date-display-single2014-08-06 (All day) America/New_York/span /div /div /div div class=field field-type-text field-field-event-type div class=field-items div class=field-item odd Sprint /div /div /div div class=field field-type-userreference field-field-organizers div class=field-labelOrganizers:nbsp;/div div class=field-items div class=field-item odd a href=/user/14705 title=View user profile.David_Rothstein/a /div /div /div pThe monthly security release window for Drupal 6 and Drupal 7 core will take place on Wednesday, August 6./p pstrongTake note of the change in schedule!/strong The security release window is normally the third Wednesday of the month, but we are moving it up for this month only to better coordinate various schedules. Apologies for any inconvenience this change might cause./p pThis does not mean that a Drupal core security release will necessarily take place on that date for either the Drupal 6 or Drupal 7 branches, only that you should prepare to look out for one (and be ready to update your Drupal sites in the event that the Drupal security team decides to make a release)./p pDue to the change in schedule and the fact that the a href=https://www.drupal.org/drupal-7.30Drupal 7.30/a bug fix release was just a week ago, there will be no bug fix release in August; the next window for a Drupal core bug fix release is Wednesday, September 3./p pFor more information on Drupal core release windows, see the documentation on a href=http://drupal.org/documentation/version-info#whenrelease timing/a and a href=http://drupal.org/node/1173280security releases/a, and the a href=http://groups.drupal.org/node/260803discussion/a that led to this policy being implemented./p
Categories: Drupal Feeds

Greater Los Angeles Drupal (GLAD): Pantheon Development and Drupal upgrades

Fri, 08/01/2014 - 1:31pm
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpI have been developing migrations for a new site on Pantheon. The work flow is pretty easy. You clone the environment, make your changes on your local machine then push to the dev site. This allows you to install modules, change the configurations and then push this to Pantheon just using Git./p pThere are a few gotchas like installing and enabling modules. When you install a module it does this in code so just adding the folder into the git repository will install the module on Pantheon, but enabling the module is in the database. Unless you do something like have a feature for installing modules you can end up with something different on Pantheon. No big issue it is easy to enable a module and all is right with the world again. This also means you learn quickly the value of the features module, if there is something in the database you want to synchronize you need to create a feature. Things like content types, views etc. /p pAnother big gotcha hit me last week. Pantheon warns you all over their the place not to upgrade Drupal with Drush. I did not update the Pantheon site with Drush but I headed the warnings on my local environment and updated my local environment with Drush. Then later when Pantheon was on the same version I merged and pushed this back to Pantheon. Admittedly I took some steps to merge that I did not understand, but after I did this push I pushed it to the test environment as well. Trouble is when I went to the dev or test site all I saw was a screen waiting to install Drupal, and there was a warning stating that I had upgraded incorrectly and had to fix this. Unfortunately the steps they gave did not resolve the situation (probably due to my ignorance). Now I have a broken Pantheon site, and my backup was 30 days old./p pTurns out the fix was pretty easy, but sounded complex. I restored the dev environment from backup. Now it worked but was out of date. I pulled to my local environment, this worked, and status stated that I was 70 commits ahead of head. I looked through the log and found the last commit before I broke things. I committed this and pushed. My dev environment was working on Pantheon with my latest code. Pushed this to the test environment and it was now working./p pAfter a great deal of worrying and hand wringing the solution was easy. GIT is great! /p pLessons learned:/p ulliWhen working in a Pantheon environment do not use drush to update Drupal, even on your local environment. /li liMake backups often, you never know when you can use it. /li /ul/div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-inline clearfixdiv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/tags/planet-drupal typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Planet Drupal/a/div/div/div
Categories: Drupal Feeds

tsvenson: I am a Follower Thinker

Fri, 08/01/2014 - 11:21am
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpLets start with a question - How often do you ask yourself:/p ul liHow on earth did they think there/then?/li /ul pnbsp;/p p...then set off spending quite a bit of time trying to reverse engineer it somehow!/p pI still do it all the time, more than once a day usually. Particularly when stumbling on new things, such as when hearing news about how bad state our world is in, or when watching a lecture or talk about an interesting topic./p pTo simplify, the big question for me ended something like this:/p ul liDo I want to feel needed just because I can follow someone else's instructions, no matter how stupid they sounded - Or because I can process information, think and use the new knowledge to make something better with?/li /ul pnbsp;/p pFor me it was, in the end, a simple choice!/p h2Followers amp; Leaders/h2 pIn society we are often told there are either followers or leaders. To a large degree that have worked really well. Just look at the technology progress made since electricity was invented. However, leaders are often also rulers. While there are good leaders, there is sadly also too many who are not so good. Those who demand us to follow their instructions without asking questions./p pA leader also need a dominion to rule over. Traditionally that has been an area, most often in the form of a guarder piece of our planet with borders we have to pass through./p pToday things are different, we have a global network called the Internet which we use to communicate with each others in various ways. This has, in my book, turned everything upside down. No longer do we need to wait for filtered information (the state and media) to select and tailor-make the information we are allowed to see./p ul liNever before in history have we as citizens been able to check things for ourselves. Contact nearly anybody almost anywhere in the world and just ask!/li /ul pnbsp;/p pIt doesn't stop there. Today we have gone bye by just asking questions and hoping for an answer. Today we collaborate freely over the internet, we do things together no traditional borders can ever stop us from again./p pStill, the old leaders don't want to give up their power. They have tried to regain their powers through the backdoor with schemes such as SOPA, PIPA and ACTA. Then, thanks to the courage of Edward Snowden we have learned how the NSA is trespassing on our human rights to privacy and trust. They claim they do it to fight terrorism, but has thus far failed badly proving even the slighted success! Instead we have learned that the government, the US government, who has given them the means, in reality have little clue to the extent they have taken it./p pOr does it know?/p h2The Open Source movement shows a new way forward/h2 pFor the last six years I have had the pleasure of being part of the Drupal community. I know now that I have not been the nicest player there, but during the last half year it has really sinked in for me./p pIn open source there are few traditional leaders. Instead it is filled with passionate individuals who come together to solve problems together. Sure, debates are often heated and sometimes unsolvable. But hey, that's just life and Open Source has actually a fine working solution for that to./p ul liIf you are not happy with the direction, then just fork the project and go on in your own direction!/li /ul pnbsp;/p pNo one can stop you and few will. Sure, there will be discussions but they are usually done in the open and everyone has the opportunity to give their own arguments about it. This is, actually, also an effective way to keep traditional leaders at bay as the open source leaders gets their powers from the way they lead, the way they inspire others to want to be part of something good!/p pIn my experience, few open source leaders have needs that match traditional ones. They just want to get on with it, build something better that everyone have access to use./p pIn fact, most of the internet is built on Open Source. Especially 20+ years ago when few saw it's potential. That is something we should be very grateful for today. Just imagine how bad it would have been if they back then had been as eager to protect their ideas as the smartphone manufactures are today. Ideas that they themselves in many cases got the inspiration to from others./p pOn thing is sure, it would have looked nothing like the internet we have today - An internet worth fighting for!/p h2Only way is up!/h2 pI'm currently living on welfare in Sweden. It is the only thing that separates me from being homeless. My path down has been quite an slippery slope. There where times I thought I had cracked it and life was better. At least for a while until it began to go, even further, south again. It was always the same thing:/p ul liI never managed to fit in with society, or even smaller groups, and in the end it got me running somewhere else!/li /ul pnbsp;/p pBasically after a while I gradually felt more trapped, that life began to go in repeated circles and there where less and less things around to get inspired and/or motivated about./p pThat has finally changed and for the first time ever I am actually looking forward with a feeling I have something to share. The growing feeling of being needed is making me jump out of bed, ready to take on whatever will happens with excitement./p pSomehow the majority of everything I have been through survived - At least it seems it got locked down somewhere in the back of my mind. But it isn't until now, at the age of 46, I have found a way to process it all, understand its meaning and finally feel I am really starting contributing back to the world in a meaningful way./p h2Followers amp; Thinkers/h2 pMy proposal:/p ul liFollow what, including people, inspires emyour/em curiosity./li liListen to what they have to say, how they say it and the passion you can feel from how they express it./li liThen also think about how that fits with your emown reality/em, how it help explain things./li /ul pnbsp;/p pThat's pretty much what I do now, plus trying to figure out how to do it better together with others!/p pHere are a one inspiring person in my life: Elon Musk/p piframe src=//www.youtube.com/embed/vDwzmJpI4io?list=PLzTAO9z9xIrdT8IRRpO2I81DEQh66CrNo frameborder=0 width=560 height=315/iframe/p pI watched this recording of a conversation Elon had with Khan Academy. I had admired him for quite some time for what he has acomplished especially with Tesla Motors and the pure *madness* with SpaceX. I had no idea what I was about to experience, but I am glad I did./p pFor me, this became a guided tour of Elon's brain and the way he thinks - His thought process. Never before had I come to understand the world, the universe like that before. For the first time I begun to understand the concept of time and space!/p pemI was hooked!/em/p pSince that day, February 4th, the world around me has at an accelerating pace started to change. The roller-coaster between *heaven* and *hell* I once was having has changed! Today the world is a beautiful thing, something presious we all share./p pBut the best thing I have learned is this:/p ul liWe are slowly beginning to understand!/li /ul pnbsp;/p p#PowertoCreate made it all come together for me. Therefore I can't think of anything better than let Matthew Taylor, Chief executive of the RSA tell you in his own words./p piframe src=//www.youtube.com/embed/WSD9ojQbt4M?list=PLzTAO9z9xIrdT8IRRpO2I81DEQh66CrNo frameborder=0 width=560 height=315/iframe/p/div/div/div
Categories: Drupal Feeds

drunken monkey: Updating the Search API to D8 – Part 4: Creating plugin types

Fri, 08/01/2014 - 8:15am
div class=field field-name-field-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evenimg typeof=foaf:Image src=http://drunkenmonkey.at/sites/default/files/styles/medium/public/field_image/plugins.png?itok=bzW_UOnu width=96 height=96 alt= title=This time in the quot;Updating to Drupal 8quot; series: plugins. //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:encodedpThe new plugin system is another large and important change in Drupal 8. While you were pretty much on your own if you wanted to provide some kind of plugin system in Drupal 7 (which a lot of modules do – think Views, Rules, etc.) there is now a very sophisticated framework to easily implement plugins and to define your own plugin types in a clean, extensible and very flexible way. And the good news for everyone familiar (code-wise) with the Search API in Drupal 7: the system is very much in line with how Search API implemented plugins itself, so the switch is pretty easy for us./p h2What is a plugin?/h2 pThere have already been a lot of great blog posts about the plugin system in Drupal 8, so I won't go into much detail here. Generally speaking, a plugin is a self-contained unit providing a certain, well-defined functionality. A plugin type is defined by a single, central system (which is usually also the only place where the plugins are used), but other modules can then provide their own plugins with an individual implementation of that functionality./p pProbably not a very helpful explanation, it's not that easy to explain – but, to use an example, blocks are now plugins in Drupal 8. The Block module provides the Block plugin type, which defines how blocks can be displayed on a page and how they can be configured. The Block module also provides all the code utilizing those plugins, letting the user place blocks on the site, ensuring they are displayed when and where appropriate, etc. Other modules then provide implementations of that Block plugin type – i.e., individual plugins – that implement different kinds of blocks: the User module provides a block with the login form, the Language module the Language switcher block, the Book module a block displaying the current book's navigation, etc.br / But there are literally dozens of other types of plugins already included in Drupal core, and contrib is bound to add countless more – four (currently) by the Search API, for example. Entity types, the various Views handlers (fields, filters, sorts, …) and plugins (display, row, …), field types, WYSIWYG editors – all of those are now just different types of plugins, all using one new, large, unified framework to provide their functionality./p h2Ingredients for a new plugin type/h2 pSo, what do we need to add our own plugin type to that growing list? Well, basically just a plugin manager, which (as a href=/blog/search-api-d8-update-part-3explained last time/a) is a special type of service – that's it. Your new plugin type becomes available by just implementing a single method. Of course, to make your plugin type more useful and easier to use for others, you should add a few more things: an interface describing what plugins of that type should be able to do, an abstract base class for implementing that interface (unless it doesn't make sense in your case) and (optionally) a dedicated annotation for your plugin type./p pLet's go through those with the example of Search API processors./p h3The plugin manager/h3 pAs mentioned earlier, the plugin manager is simply a special kind of service. There is a base class (span title=\Drupal\Core\Plugin\DefaultPluginManagercodeDefaultPluginManager/code/span) which already takes care of 95% of what's needed, you literally only need to override the constructor. So, we save the following in a href=http://cgit.drupalcode.org/sandbox-daeron-2091893/tree/src/Processor/ProcessorPluginManager.phpcodesearch_api/src/Processor/ProcessorPluginManager.php/code/a:/p div class=codeblock precodespan style=color: #000000span style=color: #0000BBlt;?phpbr //spanspan style=color: #007700class /spanspan style=color: #0000BBProcessorPluginManager /spanspan style=color: #007700extends /spanspan style=color: #0000BBDefaultPluginManager /spanspan style=color: #007700{br /br /  public function /spanspan style=color: #0000BB__construct/spanspan style=color: #007700(\/spanspan style=color: #0000BBTraversable $namespaces/spanspan style=color: #007700, /spanspan style=color: #0000BBCacheBackendInterface $cache_backend/spanspan style=color: #007700, /spanspan style=color: #0000BBModuleHandlerInterface $module_handler/spanspan style=color: #007700) {br /    /spanspan style=color: #0000BBparent/spanspan style=color: #007700::/spanspan style=color: #0000BB__construct/spanspan style=color: #007700(/spanspan style=color: #DD0000'Plugin/search_api/processor'/spanspan style=color: #007700, /spanspan style=color: #0000BB$namespaces/spanspan style=color: #007700, /spanspan style=color: #0000BB$module_handler/spanspan style=color: #007700, /spanspan style=color: #DD0000'Drupal\search_api\Annotation\SearchApiProcessor'/spanspan style=color: #007700);br /    /spanspan style=color: #0000BB$this/spanspan style=color: #007700-gt;/spanspan style=color: #0000BBsetCacheBackend/spanspan style=color: #007700(/spanspan style=color: #0000BB$cache_backend/spanspan style=color: #007700, /spanspan style=color: #DD0000'search_api_processors'/spanspan style=color: #007700);br /    /spanspan style=color: #0000BB$this/spanspan style=color: #007700-gt;/spanspan style=color: #0000BBalterInfo/spanspan style=color: #007700(/spanspan style=color: #DD0000'search_api_processor_info'/spanspan style=color: #007700);br /  }br /br /}br //spanspan style=color: #0000BB?gt;/span/span/code/pre/div p(To save space, I skip the namespace, imports and comments for all examples.)br / This can be used as kind of a template, the base class will then take care of everything that's necessary to make the plugin system work. Here's what each of the lines do:/p ulliThe code__construct()/code method signature contains the service's dependencies, which will be injected when the plugin manager is constructed. code$namespaces/code basically contains all root folders for sub-namespaces – i.e., every module's codesrc//code and/or codelib//code directory, plus a few more. The others are the services that handle caching and module interaction (e.g., invoking hooks)./li liThe parent constructor sets the plugin manager up for this specific plugin type. The two variables are of course just passed on as-is, the other two parameters represent the following: ullicodePlugin/search_api/processor/code is the sub-dir (and therefore sub-namespace) in which plugins of this type have to be located for automatic detection. That means, e.g., if the Views module would want to provide a Search API processor, it would have to be in namespace code\Drupal\views\Plugin\search_api\processor/code, otherwise it wouldn't be found.br / The general standard for this parameter is either codePlugin/[module]/[component]/code (like here) or codePlugin/[ModuleComponent]/code (so, codePlugin/SearchApiProcessor/code in this case). I think the former is generally preferred if your module defines more than one plugin type, while the latter can be cleaner/more practical if your module only defines a single one – I'm not completely sure myself, though. They probably shouldn't be mixed in a single module, in any case.br / (As a side note, I cheated here a bit, we currently use the sub-dir codePlugin/SearchApi/Processor/code for processors. As I'm pretty sure that's wrong, though, a href=https://www.drupal.org/node/2252421we'll change that shortly/a.)/li licode\Drupal\search_api\Annotation\SearchApiProcessor/code is the fully qualified class name of the annotation that will be used for defining plugins of your type. (a href=https://www.drupal.org/node/1882526See here/a if you have no idea what I'm talking about.) You can just skip this parameter, in which case it will default to code\Drupal\Component\Annotation\Plugin/code – i.e., the generic code@Plugin/code annotation. Core's validation constraints, e.g., use this instead of an individual annotation. Don't ask me what the decision process is here, but I'm pretty sure it's generally encouraged to use a dedicated annotation for your plugin types./li /ul/li liThe second line just sets up caching for the plugin type, to avoid having to re-discover the available plugins each time they are required. codesearch_api_processors/code here is the cache key that will be used to store the cached entries. You can also pass an array of cache tags as an optional third parameter to codesetCacheBackend()/code, which can be useful in special scenarios (i.e., when the cached plugin data should always be cleared alongside other cached data) but usually shouldn't be done./li liThe last line just determines that modules can alter the available processor definitions using codehook_search_api_processor_info_alter(array amp;$definitions)/code. Make sure to also document that hook in your module's codeMODULE.api.php/code file!/li /ulpAnd that's already it for the class, all very straight-forward. Now, the only thing that's missing for the service is its entry in the a href=http://cgit.drupalcode.org/sandbox-daeron-2091893/tree/search_api.services.ymlcodesearch_api.services.yml/code/a file:/p div class=codeblockcodeservices:br /  plugin.manager.search_api.processor:br /    class: Drupal\search_api\Processor\ProcessorPluginManagerbr /    parent: default_plugin_manager/code/div pThe service ID here is generally codeplugin.manager.[module].[component]/code. Then we simply specify the class we just created and use the handy codeparent/code shortcut to copy over the same constructor dependencies that (usually) all plugin managers have. This is no higher magic but just references (and partly copies over) the following definition from a href=http://cgit.drupalcode.org/drupal/tree/core/core.services.yml?h=8.0.xcodecore.services.yml/code/a:/p div class=codeblockcodeservices:br /  default_plugin_manager:br /    abstract: truebr /    arguments: ['@container.namespaces', '@cache.discovery', '@module_handler']/code/div pYou'll recognize the arguments as exactly those we used in our plugin manager's constructor./p h3The code@SearchApiProcessor/code annotation/h3 pSince we wanted a dedicated annotation instead of the generic code@Plugin/code, we still have to create the span title=\Drupal\search_api\Annotation\SearchApiProcessorcodeSearchApiProcessor/code/span annotation class to get the plugin type basically working. This is also very easy, we just put the following into a href=http://cgit.drupalcode.org/sandbox-daeron-2091893/tree/src/Annotation/SearchApiProcessor.phpcodesearch_api/src/Annotation/SearchApiProcessor.php/code/a:/p div class=codeblock precodespan style=color: #000000span style=color: #0000BBlt;?phpbr //spanspan style=color: #007700class /spanspan style=color: #0000BBSearchApiProcessor /spanspan style=color: #007700extends /spanspan style=color: #0000BBPlugin /spanspan style=color: #007700{br /br /  public /spanspan style=color: #0000BB$id/spanspan style=color: #007700;br /br /  public /spanspan style=color: #0000BB$label/spanspan style=color: #007700;br /br /  public /spanspan style=color: #0000BB$description/spanspan style=color: #007700;br /br /}br //spanspan style=color: #0000BB?gt;/span/span/code/pre/div pThat's all – you just define your plugin annotation's properties and inherit from span title=\Drupal\Component\Annotation\PlugincodePlugin/code/span, that base class will take care of everything else. The properties aren't even necessary, they are just there to document for other developers what properties the plugin type expects in plugin definitions. (And, though not used in this case, to set defaults for optional properties.) The base class doesn't care about that, it will just save all the properties it encounters in the definition, regardless of whether they are defined or not. (Note, though, that the codeid/code property is magic – if you want to use that for anything other than the plugin ID (and have the plugin ID in a different property), then you'll have to override codegetId()/code in your annotation class.)br / The only thing you do have to take care of is that annotation autloading will only work if you put the annotation into the code\Drupal\[module]\Annotation/code namespace./p h3The plugin interface and base class/h3 pWith the above done, you already have a fully functional new plugin type: other modules can define their own Search API processors and we can easily get all defined processors with the following bit of code:/p div class=codeblock precodespan style=color: #000000span style=color: #0000BBlt;?phpbr /$processor_plugin_manager /spanspan style=color: #007700= \/spanspan style=color: #0000BBDrupal/spanspan style=color: #007700::/spanspan style=color: #0000BBservice/spanspan style=color: #007700(/spanspan style=color: #DD0000'plugin.manager.search_api.processor'/spanspan style=color: #007700);br //spanspan style=color: #0000BB$processor_definitions /spanspan style=color: #007700= /spanspan style=color: #0000BB$processor_plugin_manager/spanspan style=color: #007700-gt;/spanspan style=color: #0000BBgetDefinitions/spanspan style=color: #007700();br /foreach (/spanspan style=color: #0000BB$processor_definitions /spanspan style=color: #007700as /spanspan style=color: #0000BB$processor_id /spanspan style=color: #007700=gt; /spanspan style=color: #0000BB$processor_definition/spanspan style=color: #007700) {br /  /spanspan style=color: #0000BB$processors/spanspan style=color: #007700[/spanspan style=color: #0000BB$processor_id/spanspan style=color: #007700] = /spanspan style=color: #0000BB$processor_plugin_manager/spanspan style=color: #007700-gt;/spanspan style=color: #0000BBcreateInstance/spanspan style=color: #007700(/spanspan style=color: #0000BB$processor_id/spanspan style=color: #007700, /spanspan style=color: #0000BB$processor_settings/spanspan style=color: #007700[/spanspan style=color: #0000BB$processor_id/spanspan style=color: #007700]);br /}br //spanspan style=color: #0000BB?gt;/span/span/code/pre/div pHowever, while this is a complete working example as far as Drupal's plugin framework is concerned, it is of course not really practical since we don't specify anywhere what we expect from processor plugins, so modules that want to provide their own processors don't know which methods to provide and how they should behave (without combing the whole module code of the Search API for any calls to processor plugins). So, it is more or less required to also define an interface for plugins of your new type that implementing modules would have to use./p pThe specific methods in the interface of course differ from case to case, but there are a lot of interfaces (and corrsponding base classes or traits) provided in Drupal Core for functionality that is often required for plugins. E.g., span title=\Drupal\Component\Plugin\PluginInspectionInterfacecodePluginInspectionInterface/code/span lets you retrieve a plugin's ID and definition, span title=\Drupal\Component\Plugin\DerivativeInspectionInterfacecodeDerivativeInspectionInterface/code/span helps dealing with plugin derivatives (look out for an upcoming blog post about those) and span title=\Drupal\Core\Plugin\PluginBasecodePluginBase/code/span is a great base class for plugins which implements both of these interfaces and additionally provides a few other handy methods for child classes (first and foremost, a codet()/code method for doing dependency-injected translation). span title=\Drupal\Core\Plugin\PluginFormInterfacecodePluginFormInterface/code/span provides methods for plugins that should have a configuration form, usually used in conjunction with span title=\Drupal\Component\Plugin\ConfigurablePluginInterfacecodeConfigurablePluginInterface/code/span, which represents plugins with configuration. And span title=\Drupal\Core\Plugin\ContainerFactoryPluginInterfacecodeContainerFactoryPluginInterface/code/span, as the last one used in the Search API, provides a static codecreate()/code method for easily implementing proper dependency injection. There are more, though, so take a look through the code\Drupal\Component\Plugin/code and code\Drupal\Core\Plugin/code namespaces before adding custom methods to your plugin interface./p pThe whole interface then looks like this (conceptually):/p div class=codeblock precodespan style=color: #000000span style=color: #0000BBlt;?phpbr //spanspan style=color: #007700interface /spanspan style=color: #0000BBProcessorInterface /spanspan style=color: #007700extends /spanspan style=color: #0000BBPluginInspectionInterface/spanspan style=color: #007700, /spanspan style=color: #0000BBDerivativeInspectionInterface/spanspan style=color: #007700, /spanspan style=color: #0000BBDrupalConfigurablePluginInterface/spanspan style=color: #007700, /spanspan style=color: #0000BBPluginFormInterface/spanspan style=color: #007700, /spanspan style=color: #0000BBContainerFactoryPluginInterface /spanspan style=color: #007700{br /br /  /spanspan style=color: #FF8000// Put plugin type-specific methods here.br /br //spanspan style=color: #007700}br //spanspan style=color: #0000BB?gt;/span/span/code/pre/div pThis interface is usually put into the same directory (and, therefore, namespace) as the plugin manager (since there is nothing else that really links the plugin manager to the interface), as is a default base class for the plugin type that implements the interface and helps modules avoid boilerplate code when providing their own plugins:/p div class=codeblock precodespan style=color: #000000span style=color: #0000BBlt;?phpbr //spanspan style=color: #007700abstract class /spanspan style=color: #0000BBProcessorPluginBase /spanspan style=color: #007700extends /spanspan style=color: #0000BBPluginBase /spanspan style=color: #007700implements /spanspan style=color: #0000BBProcessorInterface /spanspan style=color: #007700{br /br /  /spanspan style=color: #FF8000// Here, provide default implementations for all methods of the interface (for which it makes sense).br /br //spanspan style=color: #007700}br //spanspan style=color: #0000BB?gt;/span/span/code/pre/div pAnd that's all, now you've completely defined a new plugin type for your module. Modules can now provide plugins of that type like this:/p div class=codeblock precodespan style=color: #000000span style=color: #0000BBlt;?phpbr //spanspan style=color: #FF8000/**br / * @SearchApiProcessor(br / *   id = example_some_processor,br / *   label = @Translation(Some processor),br / *   description = @Translation(Description of the processor.)br / * )br / */br //spanspan style=color: #007700class /spanspan style=color: #0000BBSomeProcessor /spanspan style=color: #007700extends /spanspan style=color: #0000BBProcessorPluginBase /spanspan style=color: #007700{br /br /  /spanspan style=color: #FF8000// Plugin code.br /br //spanspan style=color: #007700}br //spanspan style=color: #0000BB?gt;/span/span/code/pre/div psmallImage credit: a href=http://findicons.com/icon/175726/diagram_v2_10?id=270188findicons.com/a/small/p /div/div/div
Categories: Drupal Feeds

ThinkShout: Online Fundraising with RedHen Donation

Fri, 08/01/2014 - 8:00am
pI’ve spent many a late night in the office shouting at my computer screen - all in the name of philanthropy. Technology woes just go with the small nonprofit territory, and the organization I worked for before joining ThinkShout was no exception. Some of those woes, however, I just couldn’t tolerate. Not when they were getting in the way of our mission, and preventing us from raising funds to support our work./p pMy first foray into online fundraising happened while I was working in the development department of this small nonprofit. We focused primarily on assisting low-income families with safety net services and emergency housing. Over the last few years, we’d seen a huge increase in the percentage of online donations. Times were changing and we’d begun to rely heavily on that online donation page as we saw more and more donors taking the digital route - many of whom were donating to us for the first time. But as our needs evolved, we needed the donation form to evolve with us. We needed more options, more fields, new content as the campaigns changed. Unfortunately, we didn’t realize what a monumental task that would be, given the online donation solution we were using. The problems didn’t end there./p pThis set-in-stone donation solution probably wasn’t a big concern back when the development team was first evaluating CRMs. Perhaps they didn’t know what they were getting into. Perhaps they didn’t realize they’d be charged almost $200 every time they needed to edit an online donation form. Perhaps they didn’t think we’d use the form that much. The form itself wasn’t very nice to look at. It didn’t match our website’s theme. It got close, but something was always off. There was absolutely nothing convenient about dealing with it./p pThose days are a ways behind me, but they’re still on my mind. Since my transition to ThinkShout, I’ve had the opportunity to view these issues from a different perspective and I tend to hear the same complaints from the nonprofits we serve:/p ul liMulti-step checkout/li liClunky check-out systems/li liNo control over form content/li liNo support for multiple campaigns/li liForms are expensive to edit/li liCan’t fix issues without ticketing your CRM’s support team/li liForm theme doesn’t match your website/li liPayment methods are limited/li /ul pWow. Look at this awesomely long list of annoying things that plague such an integral part of nonprofit fundraising. My blood emstill/em boils when I think about how difficult a decision it was to simply submit a ticket to change a single line of text in our donation form - how much emeffort/em went into making a case for the cost. This had to change. There had to be emsomething/em better./p pWe began working on the a href=https://www.drupal.org/project/redhen_donationRedHen/aa href=https://www.drupal.org/project/redhen_donationDonation/a module with intent to create a better online donation solution. We wanted to create a donation tool that allowed nonprofits to keep everything under one roof. The end result accomplishes this. What we came up with is unique in the sense that it offers nonprofits several features that aren’t quite so commonplace. RedHen Donation is inside their website, connected to their CRM. It allows for both one-time and recurring donations, multiple donation pages, and easy-to-edit donation forms./p pI chatted with a href=http://thinkshout.com/team/brandon/Brandon Lee/a, the architect behind RedHen Donation, to get a better understanding of RedHen Donation’s capabilities. /p pstrongStephanie: So what’s the big deal with RedHen Donation?/strong/p pstrongBrandon/strong: It’s an integration between a href=http://redhencrm.com/RedHen CRM/a contacts and Drupal Commerce that allows for single page donations with both one time and recurring donations options. The recurring donations feature is a pretty big part of it, since that’s not an option you frequently see offered in other donation form tools./p pstrongStephanie: How does it work with RedHen CRM?/strong/p pstrongBrandon/strong: RedHen Donation allows you to create a single page donation form that can create or update RedHen contacts. It’s tightly-integrated with RedHen, so if you’re already using RedHen CRM, it will be very simple to get up and running./p pstrongStephanie: How does it compare to other donation form modules out there?/strong/p pstrongBrandon/strong: It’s a standalone module that’s used with the RedHen suite. CRM Core has a similar donation module, but it doesn’t allow for recurring donations. RedHen Donation does. The ability to give donors the option of setting up a recurring donation within the same form is something we’re thrilled to offer nonprofits./p pThe donation space, in a lot of ways, is what sets it apart from similar modules. If you’re dealing with Commerce specifically, it wants to lock you into the Commerce workflow. With RedHen Donation, you don’t have to go through three different steps to make one donation to an organization. You fill out one page and you’re done. It’s quick and user-friendly. No more filling out a form, then passing through a portal, then onto a confirmation page, then back to your site./p pimg src=/assets/images/blog/redhendonation1.png alt=redhendonation1.png/p pstrongStephanie: What if I want create a new form?/strong/p pstrongBrandon/strong: With the assumption that you already have RedHen set up, it’s relatively simple. You enable the module, then create a donation type, which is a Drupal entity, and during the configuration, you select what kind of product you’re working with - at least with one-time donations. This is a fieldable methodology that we’ve used with MailChimp and other projects in the past. If you understand Drupal concepts of entities, fields, and commerce, then it’s simple. You do need a working knowledge of those three things to build a form. But once it’s complete, it’s incredibly simple for donors to use. That’s the whole point of the single page donation form. You can offer multiple recurring options. Every month for forever, every month for a year, all of those options on the same page. /p pstrongStephanie: It sounds like you’ve got a lot of payment options to choose from as an end-user - and the recurring donation option is huge win for fundraisers - but how customizable is this form? And how difficult is it to make changes?/strong/p pstrongBrandon/strong: It allows for different payment gateways, like a href=http://home.iatspayments.com/iATS/a - basically, anything supported by Drupal Commerce. Create a contact, indicate which fields you want created, pick a payment gateway, and you’re set. It can be as simple as name, credit card number, and donation amount. It can be as complex as name, credit card, honoree, honoree address, honoree’s favorite color, etc. Payment options allow for text fields, a drop-down menu, or other. Recurring payments open up another myriad of options./p pstrongStephanie: So long as I know Drupal, I can make this form into whatever I need?/strong/p pstrongBrandon/strong: Exactly./p pstrongStephanie: Say I have multiple campaigns I’m running and I need a different form for each campaign. Can I do that?/strong/p pstrongBrandon/strong: Absolutely. Let’s say you have multiple different contact types in RedHen because of the campaign. And say I want to send out this particular form because I’m currently soliciting for one particular campaign. You can have as many donation forms as you have entities that are fieldable. You can create a different form on the same content type./p pimg src=/assets/images/blog/redhendonation2.png alt=redhendonation2.png/p pstrongStephanie: Anything else we should know about it?/strong/p pstrongBrandon/strong: The availability of RedHen Donation within RedHen CRM is a big deal. You don’t have to worry about third-party integration. You don’t have to send people off to another site to collect the donation. You don’t have to wait on a third-party to send that much-needed information back. With RedHen Donation, it just works. It’s all self-contained. If I’m a nonprofit site admin, this is a great option, and a great reason to consider using RedHen CRM because everything needed to collect donations is all in one place./p pstrongOur Conclusion:/strong/p pRedHen Donation is a fantastic asset for nonprofits looking for a flexible, customizable, and affordable online donation tool. Its single-page functionality and recurring donation options make it a must-have for organizations that need these features to work seamlessly with their Drupal website. For organizations currently shopping around for a CRM, RedHen Donation is a huge plus for RedHen CRM and a compelling reason to select it as your constituent database./p pWe’re incredibly excited about RedHen Donation and what it offers nonprofits. We do understand that seeing is often believing, so we highly recommend that you install the latest release of a href=https://www.drupal.org/node/2199903RedHen CRM/a, RedHen Donation, and see what we’re talking about. Not sure how to get started? Do you have more questions than what we covered? Leave us a comment - we’d love to talk RedHen with you./p
Categories: Drupal Feeds

KnackForge: How to add contextual link on a block

Fri, 08/01/2014 - 7:42am
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodeddivContextual link is a nice addition made into Drupal 7 to favor usability. It offers, quick links to pages performing administrative operations. By default it is available for core block and node teaser view. But designed to be made extendable for other items too - Views, panels, and so./div div /div diva href=https://www.drupal.org/project/cclCustom contextual link/a (aka ccl) module is the best choice for adding custom link items./div div /div/div/div/div
Categories: Drupal Feeds

Code Karate: Drupal 7 Entity View Modes Module

Fri, 08/01/2014 - 6:40am
div class=field field-name-field-episode-number field-type-number-integer field-label-abovediv class=field-labelEpisode Number:nbsp;/divdiv class=field-itemsdiv class=field-item even161/div/div/divdiv class=field field-name-field-ddod-video field-type-file field-label-hiddendiv class=field-itemsdiv class=field-item evenimg src=http://codekarate.com/sites/default/files/styles/large/public/media-youtube/wcskTtvR6Mo.jpg?itok=VMsKmUKK alt=Drupal 7 Entity View Modes Module //div/div/divdiv class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpThe Drupal 7 a href=https://www.drupal.org/project/entity_view_mode rel=nofollowEntity View Modes Module/a 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./p pIn this lesson you will learn:/p/div/div/divdiv class=field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-abovediv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/category/tags/drupalDrupal/a/divdiv class=field-item odda href=/category/tags/drupal/core-concepts/entitiesEntities/a/divdiv class=field-item evena href=/category/tags/drupal/drupal-7Drupal 7/a/divdiv class=field-item odda href=/category/tags/drupal/site-buildingSite Building/a/divdiv class=field-item evena href=/category/tags/drupal-planetDrupal Planet/a/div/div/div
Categories: Drupal Feeds

Acquia: Michael Schmid – Drupal 8 means better business

Thu, 07/31/2014 - 5:13pm
div class=field field-name-body field-type-text-with-summary field-label-hidden div class=field-items div property=content:encoded class=field-item evenpMichael Schmid, a href=http://www.amazeelabs.com/en/michael-schmidCTO of Amazee Labs/a, and I got the chance to talk in front of my camera during the Drupal Developer Days in Szeged, Hungary. As the technical lead of a successful and growing Drupal shop, I was keen to get his perspectives on how the technology of Drupal helps him do business and how Drupal 8 might help him and his clients even more than ever before./p /div /div /div span property=dc:title content=Michael Schmid – Drupal 8 means better business class=rdf-meta/span
Categories: Drupal Feeds

Chapter Three: Reviewing Code with PHPStorm

Thu, 07/31/2014 - 4:58pm
pOne of the main responsibilities of a Drupal core committer is doing a final review of patches before committing them. Since July 1, 2014, I’ve committed a href=http://cgit.drupalcode.org/drupal/stats/?period=mamp;ofs=10over 250 patches/a to Drupal 8. Thanks to Chapter Three for making that possible./pbr / br / pReviewing code is time consuming. Here are some things that make my job easier:/p
Categories: Drupal Feeds

Phase2: Introducing OpenPublic’s App Strategy – Re-imagining Content Management For Public Sector

Thu, 07/31/2014 - 2:39pm
p dir=ltrSince it was first developed, a href=http://openpublicapp.com/OpenPublic/a has redefined open source public sector content management. Packaging government-focused functionality into a secure Drupal distribution, once a radical notion, is a href=http://www.govtech.com/policy-management/Why-Big-Sites-Run-Drupal.htmlnow an established open source web solution/a. As the foundation of a href=http://phase2technology.com/our-work/many of Phase2’s public sector site builds/a,/p p dir=ltrOpenPublic has demonstrated the importance of solutions that are replicable, that can prevent duplication of services, and provide examples of repeatable best practices. OpenPublic serves as accelerator for building good government web sites and it contains best practices and features around mobility, security and accessibility./p p dir=ltrWith the release of OpenPublic candidate 1, we’re simplifying  content management in the enterprise public sector space by appifying all functionality and content types in OpenPublic. What was once a wilderness of modules and configuration will be encapsulated in a clean collection of Apps, making all OpenPublic’s out-of-the-box functionality simple to configure by non-technical site administrators. This new App strategy will make it easier and cheaper for governments to implement the web functionality they need./p h1 dir=ltrSo, what is an App?/h1 p dir=ltrIt can be confusing to pin down definitions for terms like: modules, features, distributions, and Apps. An App is simply a collection of code (modules, features or themes) that delivers a distinct piece of functionality upon installation. Like the “apps” on your smartphone or tablet, Drupal Apps provide functionality for a specific purpose #8211; quickly, easily, and independently./p p dir=ltrIn 2011, Jeff Walpole a href=http://www.phase2technology.com/blog/apps-for-distributions-ready-to-get-started/introduced the concept of Apps for Drupal distributions/a and the new a href=https://www.drupal.org/project/appsApps module/a. Apps improve usability for site administrators, particularly as compared to the traditional Drupal Configuration dashboard. From the beginning, Apps added extensibility and interoperability to Drupal. Now, instead of adding Apps for extensibility, we’re appifying all distribution functionality for OpenPublic 1.0, finally giving the content administrators full configuration control./p h1 dir=ltrAppification of OpenPublic For State and Local Government/h1 h2 dir=ltrOne Code Base, Many Departments/h2 p dir=ltrOpenPublic  Apps provide city, county, and state government agencies the ability to turn on and off independent pieces of functionality without affecting any other functionality on their platform. Many public sector agencies require a unified CMS spanning all departments and agencies. OpenPublic provides this through standard Apps developed for government needs, including directory management, stringent security, and editorial workflow. However, the flexibility of OpenPublic 1.0’s Apps also allows for specific functionality by department. This means that trying out new functionality is as easy as turning an App on or off, giving governments the opportunity to test innovative approaches without heavy risk or cost of implementation. a href=http://www.phase2technology.com/client/san-mateo-county/See how San Mateo County uses OpenPublic Apps./a/p p dir=ltr style=text-align: center;a href=http://www.phase2technology.com/wp-content/uploads/2014/07/0c93dd3238b447ada9f6da67664bea85.jpgimg class=wp-image-8228 aligncenter alt=0c93dd3238b447ada9f6da67664bea85 src=http://www.phase2technology.com/wp-content/uploads/2014/07/0c93dd3238b447ada9f6da67664bea85.jpg width=691 height=518 //a/p h2 dir=ltrSimplified Configuration/h2 p dir=ltrApps take Drupal development out of the equation, empowering site administrators to skip technical development when configuring individual department sites. Each App is self contained, so changing the configuration does not cause problems with other site features./p h2 Custom Functionality Made Easy/h2 p dir=ltrWith OpenPublic, users can develop Apps specific to their objectives. San Mateo County, Calif., for instance, used OpenPublic to develop an App which adds custom location mapping to any page on the web platform. Once created, the San mateo County team was able test their new App in one department, then enable it for other departments when it was deemed successful. The sky’s the limit with OpenPublic’s new App structure with unique and flexible functionality for public sector platforms./p p dir=ltrOpenPublic  is breaking new ground in web experience for public sector site administrators and visitors alike. With the Appification of all functionality in OpenPublic, we are knocking down traditional barriers to Drupal site maintenance and scalability with intuitive configuration. Stop by Experience Director a href=http://www.phase2technology.com/author/smole/Shawn Mole’s/a a href=http://2014.capitalcampandgovdays.com/Capital Camp/a session with a href=http://www.phase2technology.com/author/gwilson/Greg Wilson/a, Director of Public Sector Practice, to learn more about how a href=http://2014.capitalcampandgovdays.com/capital-camp-and-gov-days/sessions/openpublic-10-next-generation-open-source-government-sitesOpenPublic  is truly the next generation of open source government sites/a./p pnbsp;/p
Categories: Drupal Feeds

Mediacurrent: Securing your Data in Drupal

Thu, 07/31/2014 - 2:09pm
img typeof=foaf:Image src=http://www.mediacurrent.com/sites/default/files/styles/thumb_blog_spotlight/public/securityimage.gif?itok=csSn5Fq6 width=200 height=152 alt=Security in Drupal title=Security in Drupal / pAs data breaches are on the rise, protecting sensitive data is more important than ever - for you and your customers.  Recently, our partner a href=http://townsendsecurity.com/Townsend Security's/a Luke Probasco shared some best practices with our team for securing data in Drupal, meeting compliance regulations requiring encryption, and the importance of encryption key management./p
Categories: Drupal Feeds

Drupal core announcements: Migrate module automated test failures - policy change

Thu, 07/31/2014 - 10:23am
pThe Drupal 8 committers have slightly changed the policy regarding automated test failures as we move toward release of 8.0.0. The traditional policy is that any proposed core patch must pass all automated tests at commit time. We are amending that slightly such that patches which solve a href=https://www.drupal.org/node/45111#criticalCriticals/a, but fail tests in a non-essential component, are allowed to proceed. For now, the only non-essential component is the Migrate framework. As announced previously, the Migrate framework is not release blocking for 8.0.0 so it should not hold back these Critical patches./p pWhen we do have a patch which is Critical but cannot easily be adjusted to pass Migrate's unit tests, we will/p ol liFile a postponed Major followup issue tagged 'Failing Migrate test'. Describe the test that was disabled and the challenge in making it pass. The issue should link to this post so that folks understand why the test was disabled. /liliIn your patch for the Critical issue, change the name of the failing test method from testFooBar() to failingTestFooBar() and add a @todo to its docblock referencing your follow up issue. /liliIf we ever get a href=https://www.drupal.org/node/301005Add expected fail functionality to simpletest/a (help wanted!), we will use that to skip tests instead of changing the method name. /li/ol pBefore release, we will revisit all issues tagged with 'Failing Migrate test' and make a determination about Migrate's suitability for 8.0.0. If deemed unsuitable, Migrate (or a specific migration path) can be added back into 8.1.0 or later./p
Categories: Drupal Feeds

Drupal core announcements: Drupal 8.x is now 8.0.x - new branch

Thu, 07/31/2014 - 10:02am
pYou may have noticed that as of a few days ago that there is a new branch in the Git source code repository for Drupal Core: 8.0.x!/p pThis branch introduces Semantic Versioning for Drupal 8, which will allow us to have an 8.0.x release line, followed by an 8.1.x release line, and possibly more along the same lines. Unlike the drastic API and architecture changes that would accompany a 7.x -gt; 8.x or 8.x -gt; 9.x major release update, and correspondingly long timelines, the changes between 8.0.x and 8.1.x are expected to be more incremental (adding features and minor API refinements). Also, the time between 8.0.x and 8.1.x is expected to be correspondingly shorter. This change in philosophy will take some of the pressure off developers to make sure absolutely everything they want gets into the 8.0.x release, because new features can be added in the 8.1.x line./p pPractical implications:/p ul liAll of the existing 8.x issues in the Drupal Core issue queue have been moved to the 8.0.x branch./li liSome issues may be pushed off to 8.1.x or 9.x by the branch maintainers: 8.1.x for more incremental changes, and 9.x for more drastic changes; in both cases, for issues that will not make it into 8.0.0./li listrongDo not file any more 8.x branch issues./strong/li listrongSwitch your local git repositories to use the 8.0.x branch./strong/li liThe strong8.x branch will be emptied and deleted/strong sometime soon, probably after the next Alpha release, which is currently scheduled for August 6th (see a href=https://groups.drupal.org/node/435848 title=https://groups.drupal.org/node/435848https://groups.drupal.org/node/435848/a)/li liThere is also an 8.1.x branch and a 9.x branch. These exist only for purposes of marking issues as future material. Commits to Drupal 8 Core will be made on the 8.0.x branch only, at least for the time being. We'll make another announcement when it's time to actually start working on the 8.1.x branch./li /ul pFor background information, you can read all the discussion on this issue: a href=https://www.drupal.org/node/2135189 title=https://www.drupal.org/node/2135189https://www.drupal.org/node/2135189/a/p
Categories: Drupal Feeds

Phase2: Static Drupal – Taking the pain out of Drupal hosting

Thu, 07/31/2014 - 8:10am
divThink back with me to the days of static websites. Those were easy! You just threw some html up on a server and that was it. No performance issues, no security issues, no worries about redundant failover if something goes wrong. No getting woken up in the middle of the night because something did happen. It was simple, fast and hard to break./div pAll that changed with more Dynamic websites like Drupal. We get a lot for using Drupal. We get a first class CMS, huge ecosystem of modules and the ability to change content live on the server. But we also get a lot of headaches along with it. We have to design a server system that can handle the load, be constantly monitoring it for failures, apply security updates and be vigilant of security breaches and be ready to be woken up when something doesn’t work./p pWe recently were challenged to find a way to use the power of Drupal as a CMS but serve the site as generated static pages. It was an interesting idea and we decided to see if we could make it work. We started out by building a proof of concept module that would take a Drupal site and render it as plain HTML pages with all the associated assets such as JS, CSS and images. This turned out not to be too hard once we used a little apache rewrite rule to fix url paths. We decided to call this module the Static module. It is available on Drupal.org (a href=http://www.drupal.org/project/static target=_blankhttp://www.drupal.org/wbr /project/static/a)/p div/div divBy itself this module turns out to be really useful for two use cases./div div/div h2Static websites/h2 divThere is a class of website that is built in Drupal but is rarely if ever updated. There are no “community” bits to it like comments and webforms. For this type of website, you can use the static module to periodically export your entire Drupal site to static html that can be uploaded to a simple server without PHP, MySQL, memcache or anything other than a web server. If changes need to be made, they can be made on a laptop or staging server and then exported and uploaded again. This allows both viewing the full site for acceptance testing before it goes live and all of the performance and security gains of a static website./div div/div h2Archive websites/h2 divA similar type of website is an archival site such as the various DrupalCon and DrupalCamp websites. While they no longer need to be live Drupal sites or be updated, they should still be accessible to see the content that was there. In the same way as simple Static websites, archived websites can be generated, uploaded and then left alone./div div/div divStatic websites are great and all but we can actually take it one step further. Turns out this module is also even better for building Hybrid websites./div div/div h2Hybrid websites/h2 divA hybrid website is the primary reason we created the static module. We wanted a system where Drupal was installed behind a firewall and a static site was periodically generated and copied over to a public web server. This would allow content writers to create, update and delete content within Drupal which would track what is changing and within a short period of time it would be generated and transferred to the public facing site. Essentially it would have the power of content editing in Drupal but be hosted to the public as static HTML./div div/div divWe got this system working and I’m going to share more about it at my talk during a href=http://2014.capitalcampandgovdays.com/capital-camp-and-gov-days/sessions/static-drupal-sleep-night-cmsCapitalCamp/Drupal4Gov/a. Be sure to check it out if you are coming./div
Categories: Drupal Feeds

ThinkShout: Responsive Images in Drupal with the Picture Module

Thu, 07/31/2014 - 8:00am
pIn today’s web device climate, you never know if your site will be viewed on a laptop, a tablet, a phone, an 84-inch 4k monitor, a Blu-ray player, a gaming console, or a a href=http://www.samsung.com/us/appliances/refrigerators/RF4289HARS/XAA title=Seriously.refrigerator/a. Most of us have probably experienced the frustration of using a website that displayed poorly because of its inbuilt assumptions about what the user’s screen would look like. The ability for your web content to adjust to its context---in particular, screen resolution---is critical to making sure you deliver the best web experience possible to every user./p pThe tools and techniques to do so are known as responsive web design (RWD). One of the first high-profile sites to implement RWD was a href=http://www.bostonglobe.com/The Boston Globe/a, which is a great example to take a look at. RWD in general is beyond the scope of this blog post. Today, we’ll focus on a specific bit of RWD that is a little tricky to handle in Drupal: responsive images./p pIf you just did what I first did and typed a href=http://drupal.org/project/responsive_imagesdrupal.org/project/responsive_images/a into your browser to see what popped up, you’ll see a module that is no longer actively maintained. a href=https://www.drupal.org/project/adaptive_imageMany/a a href=https://www.drupal.org/project/cs_adaptive_imageresponsive/a a href=https://www.drupal.org/project/aisimage/a a href=https://www.drupal.org/project/resp_imgprojects/a have come and gone over the last few years, with varying approaches and degrees of success; it’s a crowded space./p pLuckily, Drupal 8 will feature a responsive image handling solution in core with the new a href=https://www.drupal.org/project/picturePicture/a module, and it has already been backported to Drupal 7. It’s a bit tricky to set up with configurations spread across several different GUI menus, but once you have it running, it’s a fast, smooth solution to an important challenge, and it plays well with its neighbors./p h2The Gist Of It/h2 pWe#39;ll be dealing with a handful of new objects to get responsive image behaviors going smoothly./p ul liBreakpoints ul liBreakpoints are ranges of screen sizes, described by conditional tests (i.e., minimum width = 640)/li /ul/li liBreakpoint Groups ul liEWISOTT (Exactly What It Says On The Tin)/li /ul/li liImage Styles ul liYou may already know these from the Media module; they let you bundle dimensions, scaling modes, etc. into styles that can be reused across your site./li /ul/li liPicture Mappings ul liPicture mappings pair up breakpoints with image styles/li /ul/li /ul pOnce an image is associated with a responsive style, the Picture module will check the page dimensions, look at the breakpoint group, find the emfirst/em breakpoint that applies to those dimensions (we#39;ll come back to this point...), look at the picture mapping to find the associated image style, and apply that style to the image. This happens in real time, so a user resizing their window should see the image rescale to fit their new window size instantaneously./p h2Installation/h2 pWe#39;ll use a href=http://drush.ws/Drush/a, a Drupal cli, to install the modules and their dependencies, and to enable them./p pPicture has two important dependencies:/p ul liThe a href=https://www.drupal.org/project/breakpointsBreakpoints/a module, which will keep its eye on the browser window size/li liThe a href=https://www.drupal.org/project/ctoolsChaos Tool Suite/a, which gives us lots of handy development tools and APIs/li /ul pDrush will handle the dependencies for you; just navigate to your site root and type:/p div class=highlightprecode class=language-bash data-lang=bashdrush en picture -y /code/pre/div pWe#39;ll also want the Media module:/p div class=highlightprecode class=language-bash data-lang=bashdrush en media -y /code/pre/div p(In the above commands, code-y/code just tells drush to assume quot;yesquot; for any requests for confirmation.)/p h2Setting Up Breakpoints/h2 pBreakpoints can be found under Configuration gt; Media gt; Breakpoints. Each breakpoint needs a name and a a href=http://css-tricks.com/resolution-specific-stylesheets/media query/a. Optionally, you can enable a href=http://www.sitepoint.com/support-retina-displays/Retina display/a handling for each breakpoint./p pimg src=/assets/images/blog/breakpoints-example-0.png alt=breakpoints-example-0.png title=Three breakpoints with basic media queries/p pNote that the smallest breakpoint is set to a code0px/code minimum. This ensures that arbitrarily small screen sizes will be accommodated./p h3Ordering/h3 pThe order in which the breakpoints appear is the order your breakpoint group will check their media queries. The example configuration uses minimums in decreasing order, which is preferable for responsive image design. If a breakpoint query fails (if the screen width is below the minimum), the next breakpoint down the line will be checked. Make sure you get this order right; once you pull these breakpoints into a group, their order cannot be edited; you#39;d need to delete the breakpoints and their group and start over./p h3Groups/h3 pClick #39;Add a new group#39; to define a Breakpoint Group. The ordering on this screen will match the order defined by weights in the previous step./p pimg src=/assets/images/blog/breakpoints-example-1.png alt=breakpoints-example-1.png title=A simple breakpoint group/p pNote that once a breakpoint has been added to a group, it emcannot/em be edited./p h2Responsive Styles/h2 pThis is an optional step provided by the Breakpoints module; it#39;s essentially a wizard which makes copies of a preexisting image style, one for each selected breakpoint. If you have some image style effects you want to apply everywhere (desaturate, perhaps?), this can be a handy time saver. For general use, it#39;s not really necessary./p h2Image Styles and Picture Mappings/h2 pSet up an image style for each breakpoint under Configuration gt; Media gt; Image Styles. For general use, these can be equal to or slightly less than the minimums of the associated breakpoints; for more complex layouts, id est columns, these might instead be set to match the behavior of the column widths./p pimg src=/assets/images/blog/image-styles-example-0.png alt=image-styles-example-0.png title=Three basic image styles /p pPicture Mappings are found under Configuration gt; Media gt; Picture Mappings. First, associate the new Picture Mapping with our Breakpoint Group./p pimg src=/assets/images/blog/picture-mappings-example-0.png alt=picture-mappings-example-0.png title=Setting the breakpoint group of a picture mapping/p pNow that the Picture Mapping has a Breakpoint Group, each breakpoint can be associated with an image style. Populate these with the image styles defined previously, and hit Finish./p pimg src=/assets/images/blog/picture-mappings-example-1.png alt=picture-mappings-example-1.png title=Picture mapping configuration/p h2File Type Display/h2 pUnder Configuration gt; Media gt; File Types, select Images -gt; Manage File Display. Enable the Picture display mode, and select the Example Group./p pimg src=/assets/images/blog/file-display-examples-0.png alt=file-display-examples-0.png title=File display settings/p h2Content Type/h2 pNow we#39;re ready to create a node type with a responsive image field./p pMake a content type and add a File field with the Media File Selector widget. Make sure that the field permits the image format file extensions you plan to use; by default it only allows code*.txt/code./p pimg src=/assets/images/blog/responsive-content-type-examples-0.png alt=responsive-content-type-examples-0.png title=Node content type /p pUnder Manage Display, make sure that the responsive image field is set to the Rendered File display formatter, which will connect the field to the file display mode we set earlier./p h2The End Product/h2 pWe#39;re done! Create a node with the example content type, add an image, and start dragging the corner of your window around. The image should resize as the window width passes between breakpoints./p pimg src=/assets/images/blog/responsive-image-example-0.png alt=responsive-image-examples-0.png title=Medium image /p pimg src=/assets/images/blog/responsive-image-example-1.png alt=responsive-image-examples-1.png title=Small image /p h2The Benefits/h2 pThere are several advantages to responsive web design, some of which are particular to image loading./p ul liControlled, consistent user experience across devices ul liWithout clear knowledge of how our sites will be viewed, we cannot effectively design them to meet user needs./li /ul/li liEase of navigation ul liNever let important elements render offscreen./li /ul/li liBandwidth conservation ul liDon#39;t send a 4k image to a QVGA-screen phone that doesn#39;t need it./li /ul/li liCode it once ul liNo need to build a secondary mobile site./li /ul/li liSEO optimization ul liEvery node has one canonical URL, so Google won#39;t split its results between mobile and desktop versions (which could easily drop your site to the dreaded second page of search results)!/li /ul/li liShareability ul liA bad example: a href=http://en.wikipedia.org/wiki/DrupalWikipedia/a. Take a look at how different its a href=http://en.m.wikipedia.org/wiki/Drupalmobile version/a looks. If a mobile user posts an interesting article to Twitter, for example, both desktop and mobile users following the link will be hit with the mobile version, regardless of their device. With a single-URL responsive design, this is a nonissue./li /ul/li /ul h2Resources/h2 ul lia href=https://www.drupal.org/project/picturePicture module project page/a/li lia href=https://www.drupal.org/project/breakpointsBreakpoints module project page/a/li lia href=http://picture7d.h011.attiks.com/node/1Live demo of Picture module on Drupal 7/a/li lia href=http://picture.responsiveimages.org/The Picture element proposal document/a/li /ul
Categories: Drupal Feeds