Planet Drupal

Syndicate content - aggregated feeds in category Planet Drupal
Updated: 5 min 40 sec ago

Metal Toad: Pond Life Ep.2

Wed, 04/09/2014 - 01:09
pHello Everyone!br / Welcome back to the pond! Last week we touched on the importance of mentoring juniors and Github best practices. In this week's episode, we'll be following up on the junior workflow from last week by discussing two tools you should definitely have and how to install them, exploring new ground by touching on some entry level SCSS techniques, sharing my span style=color:greenAHA!/span and span style=color:redFAIL/span moments of the week, and lastly, our weekly query for you good people out there to ponder. So lets jump right into it shall we?/pul class=links inlineli class=0 first lasta href= rel=tag title=Pond Life Ep.2Read more/a/li /ul

DrupalCon Austin News: Symfony Community: A Special Invitation to DrupalCon Austin

Tue, 04/08/2014 - 21:49
div class=field field--name-body field--type-text-with-summary field--label-hiddendiv class=field__itemsdiv class=field__item even property=content:encodedpimg src= /br / With the rapidly approaching release of Drupal 8, many Symfony developers may be considering going to Austin for DrupalCon in June. Our advice? Do it! /p/div/div/div

Drupal @ Penn State: Speed Reader module - Using Drupal to read EVERYTHING faster!

Tue, 04/08/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:encodedullia href= project page/a/li lia href= library on github/a/li lia href= site that nmillin setup/a/li/ul/div/div/div

Julian Granger-Bevan: Improving SEO using Drupal Similar by Terms

Tue, 04/08/2014 - 18:00
!-- google_ad_section_start --div class=field field-name-field-image2 field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evenimg typeof=foaf:Image src= width=150 height=199 //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 pstrongSearch Engine Optimisation (SEO) is the process of altering your website to maximise the exposure of your website via search engines such as a href=http://google.comGoogle/a and a href=http://bing.comBing/a./strong/p pThe aim is to bring more visitors to your website./p pIf your website is built using the a href=http://drupal.orgDrupal CMS/a, this article will give you an easy tip that will both improve the experience for your visitors when they are on your site and help boost your search engine rankings./p pThe method is made easy using the a href= by Terms module for Drupal/a, and exploits the need for visitors to be able to find other relevant content when they are on your website./p p!--break--/p h2Why use Similar by Terms?/h2 pstrongSearch engines such as Google are looking at a href= of factors/a when they decide which pages to display prominently in search engine results pages (SERPs)./strong/p pemThese factors include content, quality and context./em/p pYour site is more likely to be placed highly in SERPS (leading to more traffic) if Google identifies that it is authoritative on a particular subject. Links around between pages on your website will help Google recognise the topic that each page on your website covers, and means that it is more likely to rank highly for that searches on that topic./p pDo not get confused, this is not the same as link building from other websites (for which care needs to be taken as search engines will penalise you if these are unnatural)./p pSimilar by Terms provides an automated means of displaying related content links on your website. It does this by comparing the taxonomy terms that each node is tagged with, and creating a simple ranking based on the overlapping terms  from which it can draw the top few nodes to show to your visitors as links./p pspan style=line-height: 1.538em;Links to relevant content also improve the experience for your visitors, by giving them suggestions for what to read next. A visitor is much more likely to find links useful (and continue to browse your website) if the links are relevant to the page that they are already on./span/p h2How to install Similar by Terms/h2 pstrongTo install Similar by Terms, download the code from a href= and enable on your website by visiting the /admin/modules page./strong/p pYou will need to have also installed two dependencies: a href= Tools Suite/a and a href= pSimilar by Terms exposes a view to your website, and the next thing you will want to do is edit this to suit your needs. The view can be found at the page /admin/structure/views./p pimg alt= class=media-image height=98 width=620 typeof=foaf:Image src= //p pspan style=line-height: 1.538em;The default view is quite basic, and simply returns a list of the titles of the related nodes. You will likely want to edit this (perhaps to also show a teaser or image from the node). These edits can be made just like any other view./span/p pOne setting that is unique to Similar by Terms is the taxonomy vocabularies that are considered when ranking nodes for similarity. You can opt to include just one, or all of your vocabularies in the comparison./p pTo do this, click Advanced on the right hand side of the edit screen, then click on Similar By Terms: Nid in the contextual filters section./p pimg alt= class=media-image height=114 width=490 typeof=foaf:Image src= //p p style=clear:both;Now a dialog appears where you can choose which vocabularies to use./p pimg alt= class=media-image height=174 width=620 typeof=foaf:Image src= //p pYou can also create your own views utilising the functionality provided by Similar by Terms. Simply copy the relationships and sorting rules that exist in the default view that Similar by Terms provided./p h2One last hint/h2 pstrongThe default behaviour of Similar By Terms will only show nodes in the list that share one or more taxonomy terms with the node being viewed./strong/p pThis means, that you might only see one related node, or even none at all./p pFor the styling of your website you're likely to want to always show the same number of nodes in the list. Whilst there is a a href= request in the issues queue/a for this, there is a simple method that will solve this for you straight away./p pThe answer is to create a new taxonomy vocabulary called Included in Similar By Terms, with a single term called Included. Let that term default on all nodes on your website. This way, all nodes will have at least one taxonomy term in common, and the real similar nodes will rise to the top of the list above those that aren't really related./p /div/div/div!-- google_ad_section_end --div class=field field-name-field-category field-type-taxonomy-term-reference field-label-inline clearfixdiv class=field-labelCategory:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/blog/websites typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Websites/a/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/drupal typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Drupal/a/divdiv class=field-item odda href=/tags/similar-by-terms typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Similar by Terms/a/divdiv class=field-item evena href=/tags/drupal-planet typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Drupal Planet/a/divdiv class=field-item odda href=/tags/related-content typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=related content/a/divdiv class=field-item evena href=/tags/tutorial typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=tutorial/a/divdiv class=field-item odda href=/tags/how-to-0 typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=how to/a/div/div/div

Mediacurrent: Running Drupal on OpenShift from Red Hat

Tue, 04/08/2014 - 17:52
img src= alt= title= class=imagecache imagecache-thumb_blog_spotlight imagecache-default imagecache-thumb_blog_spotlight_default width=200 height=152 / pAn interesting platform I came across recently for developing and deploying cloud applications is a href= by a href=http://www.redhat.comRedHat/a. OpenShift is a next generation application hosting platform. The software running this service is open-sourced under the name a href Origin/a, and is available on a href=http://www.github.comGitHub/a. Developers use emGit/em to deploy web applications in different languages to the platform./p

Acquia: Using Composer Manager to get off the Island Now

Tue, 04/08/2014 - 17:28
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 evenpOn the eve of 2013, prolific Drupal contributor Larry Garfield put forth a challenge to a href= target=_blankget off the island/a, and judging by the adoption of non-Drupal projects in Drupal 8 core I would say the community has responded./p/div /div /div span property=dc:title content=Using Composer Manager to get off the Island Now class=rdf-meta/span

Phase2: Say Goodbye To menu_get_object() @NYC Camp

Tue, 04/08/2014 - 13:30
pDrupal 8 is bringing some great new features in addition to some fun DX changes. One of the ways I like to learn about these changes is to deconstruct the API./p pThe best way to deconstruct the API is to dive into code that has a certain purpose, like looking at the Breadcrumb API./p pSince we know we#8217;re focusing on Drupal 7 to Drupal 8 changes, we can also use the excellent documentation in a title=Drupal change records href= change records/a to help us./p pIn a title=30 Drupal 8 API Functions You Should Already Know href= upcoming a href=http://www.nyccamp.orgNYCCamp/a presentation/a, I#8217;ll review some of the common API functions we used in Drupal 7 and how they#8217;ve changed in Drupal 8./p h2What Node Am I On?/h2 pA lot of custom blocks that show related content, connected taxonomy, or any other relationship to currently viewed page typically depend on a title=menu_get_object() href= I#8217;m sad to say that our old friend is gone./p pIn Drupal 8, the way to get details about nodes are through the attributes of the request object in the global code\Drupal/code namespace./p pWhile a href= DX of this implementation is currently being discussed/a, as of this writing, to get details about the current node:/p p/ppre class=crayon-plain-taglt;?php $node = \Drupal::request()-gt;attributes-gt;get('node'); ?gt;/prep/p h2drupal_render() is EVERYTHING!/h2 pConsistency is a big theme (no pun intended) in Drupal 8. Render arrays are the main driver to staging content to be passed to the theme layer./p pAs such, the theme() function is now gone./p pInstead, a new #theme array key is passed to build a piece of content programmatically. /p pFor old core theme functions, like theme_table() or theme_link(), you can pass in the #8216;table#8217; or #8216;link#8217; keyword, respectively, to the #type array key./p pAs noted a href= the change record/a, to create a table of data with a pager, set the various keys, then pass it to drupal_render():/ppre class=crayon-plain-taglt;?php // Theme is available as an element type (may have additional processing in rendering). $table = array( '#type' =gt; 'table', '#header' =gt; $header, '#rows' =gt; $rows, '#attributes' =gt; array( 'id' =gt; 'my-module-table', ), ); $markup = drupal_render($table); // Pager is not an element type, use #theme directly. $pager = array('#theme' =gt; 'pager'); $markup = drupal_render($pager); ?gt;/prep/p h2Want More?/h2 pIf you can#8217;t make it out to NYC, definitely look for me at either the upcoming a href= Meetup/a or a href= Austin/a!/p pI hope to you see in you in NYC this weekend!/p

Marek Sotak: Inline Manual 1.0 Drupal module released, show your clients how to use their site

Tue, 04/08/2014 - 12:03
div class=field-body pAfter few betas, Inline Manual Drupal module has reached stable 1.0 version. Throw screenshots, screencasts and word documents away! Be interactive and agile. :)br /img src= align=right /br / Inline Manual is a service to create interactive, reusable and easy to maintain step-by-step documentation for end-users of a website or application. Be it a tutorial How to add a new user within a CMS you've just built or a tutorial showing how to manage specific content./p pThe Drupal module allows you to:/p /div

KnackForge: How we managed to send 75k emails per hour

Tue, 04/08/2014 - 10:42
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpArdent team at KnackForge always loves to get hands dirty with challenging projects. In this connection we recently took an interesting newsletter sending project from one of our potential clients who is doing relatively big in Internet marketing./p pIn brief, we were asked for a custom system for sending out newsletter emails, based on Drupal. Tentatively 600k emails to be sent per month. A newsletter list shall have up to 80k users and limited to a couple of lists to begin with./p/div/div/div

Pronovix: Drupal Developer Days 2014 Szeged - behind the scenes

Tue, 04/08/2014 - 10:20
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpDrupal Dev Days Szeged was a great opportunity for me to realize and take part in one of Kristof’s crazy ideas (well, almost as crazy as Drupalcon 2008 was ;) with some great people from the community. While the event turned out to be a success, I’ve learnt a lot that I would like to share with all future organizers through this blog post and other channels. /p pa href= src=/sites/default/files/styles/full_width_w_sidebar/public/blogpost/image/DDD_group.jpg width=620 height=213 alt= class=image-full_width_w_sidebar //a/p/div/div/div Themer Survey 2014

Mon, 04/07/2014 - 18:25
!--content-field.tpl-- div class=fieldgroup group-image div class=content !--content-field.tpl-- /div /div pDear Themer we the a href=http://drupaltwig.orgDrupaltwig group/a need some answers amp; advice from all of our fellow Drupalistas - We want to make sure that we are creating a theme system that lives up to the wishes of all Drupal8 users - but especially us themers ;)/p pa href= target=_blankread more/a/p

Stanford Web Services Blog: Overriding Open Framework Styles: Block styles, Sidebar Menus, and Regions

Mon, 04/07/2014 - 18:06
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=summaryIn this post, I continue my a href= on how to override Open Framework's default styles to get a more custom look-and-feel on your site. a href= time/a we looked at how to override our typography styles. Today, we'll look at a grab bag of other things, including block styles, sidebar menus, and region styles./p/div/div/div

Fred Parke | The Web Developer: Create your own tokens in Drupal 7

Mon, 04/07/2014 - 17:58
div class=field field--name-body field--type-text-with-summary field--label-hiddendiv class=field__itemsdiv class=field__item evenpTokens are a pretty powerful weapon to have in your arsenal, and they actually come in useful a lot if you remember that they're there./p pIf you haven't used them before, tokens are essentially text placeholders - they can be static text, variables, field values, whatever you want really./p pThe Token API is now part of Drupal 7 core and as it turns out, using it to create your own tokens is super easy - you just need a couple of hooks./p pThe first hook, span class=codehook_token_info()/span, is used to declare any custom tokens./p/div/div/div

Appnovation Technologies: Accessibility in the Real World: Top 6 Automation Misses

Mon, 04/07/2014 - 17:25
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encoded Making your work accessible shouldn’t be a optional deliverable; we have a duty of care to the real world of users to build this in as part of our work. No matter how good automated test tools are, they won't cover everything. Here are 6 points of consideration for accessibility. /div/div/divdiv class=field field-name-field-blog-header-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evena href=/blog/accessibility-real-world-top-6-automation-missesimg typeof=foaf:Image src= width=680 height=200 alt= //a/div/div/divdiv class=sharethis-buttonsdiv class=sharethis-wrapperspan st_url= st_title=Accessibility in the Real World: Top 6 Automation Misses class=st_facebook/span span st_url= st_title=Accessibility in the Real World: Top 6 Automation Misses class=st_twitter/span span st_url= st_title=Accessibility in the Real World: Top 6 Automation Misses class=st_sharethis/span script type='text/javascript'var switchTo5x = false;/scriptscript type='text/javascript' src=''/scriptscript type='text/javascript'stLight.options({publisher:dr-75626d0b-d9b4-2fdb-6d29-1a20f61d683});/script/div/div

Bryan Braun: Making Targeted Drupal Cache Clears using Drush

Mon, 04/07/2014 - 16:21
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpThe standard Drush command for clearing Drupal's cache looks like this:/p pre drush cache-clear all/prep(You can also use the shortened alias codecc/code like this: codedrush cc all/code)/p pThese commands give you the same result as when you click that cache clear button in the UI span style=color: rgb(84, 84, 84); font-family: arial, sans-serif; font-size: small; line-height: 18.200000762939453px;—/span it clears all of Drupal's internal caches./p pBut clearing all of Drupal's caches at once can be overkill. You usually don't need to clear everything, and doing so can put heavy load on your servers (especially if your site is large or gets a lot of traffic). Beneath the surface, Drupal's caching is actually pretty granular, and tools like Drush give us the ability to target and clear caches on the subsystem level./p pUsing Drush, you can see your caching options with:/p pre # Using the shortened alias from this point on. drush cc/prepWhich returns something like this:/p pre [0] : cancel [1] : all [2] : drush [3] : theme registry [4] : menu [5] : css+js [6] : block [7] : module list [8] : theme list [9] : registry .../prepLet's look at what each of these does (as a quick note, I'm specifically looking at Drush 6, which is the major version at this time):/p pcodedrush cc all/codebr / Remember how I said that this does the same thing as the cache clear button in the UI? Well, that's technically false. Yes, codedrush cc all/code will clear all your Drupal caches (as long as it can bootstrap Drupal), but it will also clear its own internal Drush cache. That's why when Drush cannot bootstrap Drupal, you will still see a success command saying code'drush' cache was cleared/code./p pcodedrush cc drush/codebr / This only clears Drush's internal cache (the same one I just mentioned). You don't need a Drupal site available to clear this cache./p pcodedrush cc theme registry/codebr / This command simply calls codedrupal_theme_rebuild()/code to rebuild the theming system. This is needed whenever new .tpl.php files or theme hooks are added to the system. This specific cache clear only applies for Drupal 7 and up./p pcodedrush cc menu/codebr / This runs a menu rebuild, which refreshes the database tables used by various menu functions. For example, any new router items (like those defined in codehook_menu/code) are added to the codemenu_links/code table, and stale ones are removed. This also clears the page and block caches, to prevent the display of stale menu links./p pcodedrush cc css+js/codebr / If you have CSS or JS aggregation enabled, this will rebuild the aggregated files. It also increments the query string on CSS amp; JS links, forcing clients that have cached an old copy to download a fresh one./p pcodedrush cc block/codebr / Block caching exists so Drupal doesn't have to look up the locations and visibility of blocks with each page load. This command refreshes that cache./p pcodedrush cc module list/codebr / This re-scans the module directories in your codebase and refreshes Drupal's internal list of which modules are available./p pcodedrush cc theme list/codebr / This re-scans the theme directories in your codebase and refreshes Drupal's internal list of which themes are available./p pcodedrush cc registry/codebr / Drupal maintains an internal registry of all functions or classes in the system, allowing it to lazy-load code files as needed (reducing the amount of code that must be parsed on each request). The list of these files is known as the code registry and it is stored in the codesystem/code table in your Drupal database. This cache clear will look at this list of files and update the contents of any files that have been changed. Note: it will not rebuild the registry from scratch. For more information, see codea href= pcodedrush cc ?????/codebr / You may see other options in this list, because contributed modules (like views and advanced aggregation) can add their own kinds of cache clears. In each case, you'll see a file in the contrib module named something like that contains the code which defines what the cache clear does./p p /p pIf you want to see what each of these options does on a code level, you can download Drush and inspect the file found at codeDrush/commands/core/ /div/div/div

Wunderkraut blog: Drupal 8 and the slow death of IE8

Mon, 04/07/2014 - 14:02
p class=field-ns-blog-post-lead IE8 is resisting to die. Internet Explorer 8 world-wide usage is more popular than IE9 and even IE10 /p div class=field-ns-blog-post-body clearfix div class=field-item even h2First, a small story./h2divOnce upon a time, in 2012, when Drupal 8 was going to support IE8, we a href= HTML5Shiv to Drupal core/a to support HTML5 elements in IE8 and old browsers./divdiv /divdivBut during 2013 things happened. jQuery decided to split their library into: /divullijQuery 1.x (IE8, IE7, IE6 support)/lilijQuery 2.x (IE9 support and newer)/li/uldivBoth branches have the same jQuery API./divdiv /divdivThis situation, clearly pushed the Drupal core maintainers into a big decision: a href= Drupal 8 core ship with jQuery 1.x or 2.x ?/a. Nat Catchpole (catch) a href= this dilemma very well:/divdiv /divdivimg alt=catch.png class=media-image height=167 title=catch.png width=480 src= //divdiv /divdivAnd the community and Dries, decided almost at the same time to embrace a href= 5, jQuery 2 and drop IE8 support/a. The a href= record/a was modified (to include IE8 as not supported). And we all rejoiced, specially front-end developers. Yay!/divdiv /divdivTo end this small story, I will link it to the beginning: there is a task pending about a href= HTML5Shiv from Drupal core/a. All the IE8 issues are spread in, so it's nice that nod_ created a a href= issue: Drop IE8 support/a./divh2Present. 2014/h2divLooking back, it looks like dropping IE8 support was a good decision. This allowed core developers to write more efficient CSS3 and ECMAScript 5 code. And we avoid to waste the valuable time of core developers supporting old browsers. We jumped on the bandwagon of modern JavaScript libraries. /divdiv /divdivAs I said sometimes, the biggest change in Drupal core front-end is not Twig, it's Drupal core dropping IE8 support./divdiv /divdivstrongThe only big problem is that IE8 is dying very slowly./strong/divdiv /divdivDuring the discussions in 2012-2013 we thought that IE8 usage will drop fast (we wanted to believe that). But the reality hurts, /divdivThis is a chart from StatCounter (IE8 has a 4.71% usage. IE11 is not available in the chart, but it has a 6.29% usage in March 2014):/divdiv /divdivimg alt=top_12_browser_versions_combining_chrome_and_firefox_5_from_may_2012_to_mar_2014__statcounter_global_stats_2014-04-03_23-42-27_2014-04-03_23-50-39.jpg class=media-image height=326 title=top_12_browser_versions_combining_chrome_and_firefox_5_from_may_2012_to_mar_2014__statcounter_global_stats_2014-04-03_23-42-27_2014-04-03_23-50-39.jpg width=480 src= //divdiv /divdivFrom, the trend is even worse. IE8 has still 21.14% of the browser share on March 2014./divdiv /divdivimg alt=browser_market_share_2014-04-05_13-18-46_2014-04-05_13-20-55.jpg class=media-image height=160 title=browser_market_share_2014-04-05_13-18-46_2014-04-05_13-20-55.jpg width=480 src= //divdivbr /I hid other browsers in the charts to highlight the situation with Internet Explorer./divdivBut one thing is clear: IE8 seems to be more popular than IE9, IE10 and even IE11. This is mainly due of Windows XP users./divdiv /divh3Why the difference between StatCounter and Netmarketshare?/h3divThey have different methodologies.  As I understand, netmarketshare manipulates their data to make them more realistic./divdivThey are adding a country level weighting, based on how many internet-users the country has, even if their data samples are tiny. So that could distort a bit their data. But the good thing in netmarketshare methodology, is that they count users not traffic. (the same user is only counted once per day, no matter how many page loads she makes). In the other hand StatCounter counts strongpage visits/strong, not users. For example, for StatCounter, an internet-savy teenager  loading hundreds of pages per day in Chrome, counts the same as 100 hundred grandpas that are loading once a day their local newspaper in IE8./divdiv /divdivThere is no winner. Both charts are correct, since they represent different things. But the truth is that there is a lot of people outside there using IE8 today./divdiv /divh3The hope/h3divEveryone hopes that IE8 dies faster, including Microsoft. /divdivTwo positive notes:/divulliTomorrow, 8th of April, Microsoft is announcing the a href= of Windows XP support/a. No more updates. /liliIE8 doesn't exist in mobile phones. The trend is that mobile browsers are eating desktop browsers usage, around the world. /li/ulh2Non official FAQ. Drupal amp; IE8/h2divstrongWhat if you try to load a Drupal 8 website with IE8?/strong/divdiv /divdivIE8 won't support many CSS3 stuff and EcmaScript 5 code. So a broken layout and lost JavaScript funcionality will be the normal thing to see. Drupal will load jQuery 2.x (that uses emaddEventListener/em method), IE8 will complain about it, stop parsing jQuery, and all your jQuery code won't work because SCRIPT5009: jQuery is undefined./divdiv /divdivstrongWhat if a customer asks for IE8 support?/strong/divdivStick to Drupal 7. The other option is to use a Drupal 8 and the work-in-progress-contrib-module a href= Drupal module/a, that should downgrade jQuery to 1.x branch and include lots of polyfills to support ECMAScript 5 in IE8. Personally, it sounds to me too magical,  that it could fix all CSS and broken JS, specially if your site has many contrib modules. But for sure, it will help./divdiv /divdivAlso notice that Drupal helps the situation a bit,  a href= X-UA-Compatible http header/a to force IE use the most recent IE engine./divdiv /divdivstrongWhat if I'm maintainer of Drupal module or theme? /strong/divdivDrupal's core decision is pushing gently all the contrib modules and themes to follow the same path. When porting your modules, JavaScript code, etc make sure it works well with jQuery 2.x API./divdiv /divdivIf you’re upgrading your Drupal 7 jQuery code from a version older than 1.9, jQuery team recommends to read the a href= 1.9 Upgrade Guide/a since there have been a lot of changes, and help yourself using the jQuery Migrate plugin. Once that is migrated to 1.9, it will be compatible with jQuery 2.x, because they should have same API./divdiv /divh2Corrections welcome/h2divPlease, comment in this article, correct me in case I did wrong assumptions and I will update the post with the most up-to-date information./div /div /div Drupal Dev Days Szeged - Initial Sprint for Search API Drupal 8

Mon, 04/07/2014 - 12:02
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedh2Szeged/h2 pI’ll tell you in a small prelude a story of a small place in the world named Szeged and why it holds a special place in my heart for me (Nick_vh). When I was job-hunting about 5 years and a half ago I found many companies willing to offer me a job after graduating but the one company I chose was willing to take a huge bet on me and offered me a job + an instant trip to Szeged, Hungary. It seemed that that was the location of the gathering of the Drupal Community in 2008. They said it would be amazing and I never looked back since then and I am still connected to the same and growing Drupal Community./p pGoing back to Szeged promised to be a lot of nostalgia and a lot of fun also./p h2Looking back/h2 pFor those that just tune in on this story of the Search API Drupal 8 port, there is a href= reading to do/a./p blockquotepIn short: strong“Contrib Search maintainers are committed to make Drupal 8 kick ass with Search API.”/strong/p /blockquote pThis is also exactly what we wanted to prove on this wonderful trip to Hungary./p h2What our goals were/h2 pThomas and I already agreed this week in Szeged would be the first of a series of sprints to get Search API to a decent state in Drupal 8. As you can read in the a href= API for Drupal 8 sprint entry for the Drupal Dev Days/a  the goals were the following: “The primary focus will be to get the Search API to a usable state in D8 and then decide on and implement framework improvements”/p pWe discussed and talked about what needed to happen but in true community style, not many words were needed to get the first port started and so it happened that, even before all of this, freblasty started a sandbox and already ported a good chunk of the Drupal 7 code to well factored Drupal 8 code./p pThere was a sign up sheet for the sprints and to our surprise a LOT of people signed up for the sprint. I’ve masked the last names to protect their privacy, so they can opt-in on the exposure of their full name. Drunkenmonkey also prepared a nice list of meta issues that mark the Drupal 8 state before the sprint./p pimg alt= src= style=height:147px; width:150px //p h2Plan of attack/h2 pSome of us already arrived early Monday, the other half arrived Monday afternoon. The team was already hacking away on the code when we decided to use a Google Doc that would semi-coordinate the progress. Process was simple:/p olliRaise your hand and say your name and that you wanted to help out/li liYou were given commit access to the sandbox/li liChoose a task from the “To Do” in the collaborative document/li liSolve it and commit it/li liSay “I committed, please pull!” and do a little Ski-Dance (ask Aspilicious for specifics)/li liGo to 3 and repeat until Sunday afternoon./li /olpWe purposefully supported this simple plan of attack because adding more process would block people from making progress and we figured it was better to break all the things than to block people from helping out./p h2The attack itself/h2 pII’m not going to waste a lot of empty words here but let the hard work/visuals speak for itself./p ulliDuring the whole week we’ve had strong322/strong commits./li liHeaviest hours were from strong09:00 till 19:00/strong and then it went up again from strong22:00 till 24:00/strong. Thanks to freblasty we even had commits during the middle of the night, strong9 of them at 04:00/strong./li listrongWednesday/strong was our most productive day with strong75 commits/strong. Saturday was our low point with only 36 commits, I guess that has something to do with the party on Friday evening…!/li listrong20834/strong lines were added, strong11996/strong were removed/li /ulpIn total we had strong15 contributors!!!! /strongWe’ve listed them by # of commits but by no means this means that the ones with more commits worked harder./p ollidrunkenmonkey            55    (15.62%)/li limollux_                51    (14.49%)/li liNick_vh            46     (13.07%)/li liaspilicious            43     (12.22%)/li liAndrew_l            38     (10.80%)/li lifreblasty            34     (9.66%)/li liekes                23     (6.53%)/li lim1r1k                18     (5.11%)/li lidpovshed            17     (4.83%)/li liAndre-B            12     (3.41%)/li libaldwinlouie            7     (1.99%)    /li lisdecabooter            3     (0.85%)/li lipenyaskito            3     (0.85%)/li litstoeckler            1     (0.28%)/li lipcambra             1     (0.28%)/li /olh2Drupal 8 Codebase versus Drupal 7 codebase/h2 pA quick preview ofthe differences in terms of files of Drupal 8 vs Drupal 7./p pimg alt= src= style=height:250px; line-height:1.6; width:100px / versus img alt= src= style=height:250px; width:75px / /p h2Future plans/h2 pFor now, work continues in the sandbox until the basic functionality is working. Also, mollux is already working on a port of the Database Search backend, which will allow us to test the module with a real search backend./p pOnce the functionality is stable and we get into improvement/feature-adding mode, the project will be transferred back to the 8.x branch of the proper search_api project and work will continue in the normal style of patches and issues. (Issues for the individual tasks from the Google document have already been converted to issues in the sandbox’s issue queue as of last meeting)./p h2Weekly Meetings on Hangout amp; IRC/h2 pWe also set up a weekly meeting in the form of a Google hangout, every Tuesday at 18:00 UTC. Please contact us if you want to be invited, everyone who wants to help with this project is welcome!/p pOther than this, there is also the possibility of discussing and coordinating via IRC. We are using a special channel, #drupal-search-api on Freenode lt;a href=irc://freenode/drupal-search-apigt;irc://freenode/drupal-search-apigt;/a, where you can also just join in and ask around if you want to get involved./p h2Thanks/h2 pMany many many thanks to all those involved in the sprint. We understand this takes a big personal commitment and passion to focus so hard on complex problems to drive the next generation of Drupal Search. Also many thanks to all companies that sponsored the time and funds for allowing those people to be there. I hope this blogpost can help your company to convince them to send you to these events. It's educational, helpful and will lift you and your company to a higher level./p p /p h2Proof of the team in Szeged, hard at work/h2 pimg alt= src= /img alt= src= /img alt= src= /img alt= src= /img alt= src= /img alt= src= //p /div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-above clearfixh3 class=field-labelTags: /h3ul class=linksli class=taxonomy-term-reference-0 rel=dc:subjecta href=/taxonomy/term/91 typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=searchapi/a/lili class=taxonomy-term-reference-1 rel=dc:subjecta href=/taxonomy/term/106 typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=szeged/a/lili class=taxonomy-term-reference-2 rel=dc:subjecta href=/taxonomy/term/111 typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=drupaldevdays/a/lili class=taxonomy-term-reference-3 rel=dc:subjecta href=/taxonomy/term/86 typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=drupalplanet/a/li/ul/div

Web Omelette: Adding Facebook Open Graph tags to your Drupal site

Mon, 04/07/2014 - 09:10
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpIn this article we are going to look at implementing the Facebook Open Graph (OG) tags on a Drupal site. It involves a bit of coding but nothing too major so bear with me. All the code we are going to write goes into the theme's codetemplate.php/code file so no need to to create a module for it. And if your theme does not yet have this file, go ahead and create it./p h2Why use Open Graph tags?/h2 pI'm sure by now you know that people share pages on Facebook and you want your site to be shared as much as possible. You also know that a little teaser information is made available on Facebook when you share these pages (title, image, short description)./p pBut have you ever noticed that with some sites, when you share pages on Facebook, or like/recommend them, some random, unintented image gets used in this teaser. Or the description is not correct, or even the title is not right. Facebook is quite good at picking the right elements to show there but sometimes it doesn't manage by default. And you can't expect the random user who shares your page to make adjustments to the text or title. So what do you do? You use Open Graph meta tags./p h2What are the Open Graph meta tags?/h2 pThese are simple codelt;metagt;/code tags that you put in the head of your site to specify which elements should be used by Facebook for various purposes. For instance, you specify a link to an image and then Facebook knows exactly which image to use when building the teasers. The same goes with the title, description and many others./p pThe tag is quite simply structured. It contains a codeproperty/code attribute in which you specify what this tag is for and a codecontent/code attribute where you specify what should be used for this property. Let's see an example for the title:/p precodelt;meta property=og:title content=This is the article title /gt; /code/pre pSimple. You'll also notice that the codeproperty/code attribute value is preceeded by codeog:/code. This stands for Open Graph and Facebook will recognize it as such. Here are some examples for other more common OG tags:/p precodelt;meta property=og:url content= /gt; lt;meta property=og:site_name content=Web Omelette /gt; lt;meta property=og:type content=blog /gt; /code/pre pThe first one is the canonical URL for the page, the second is the site title and the third is the type of site./p h2But how do we add them to Drupal?/h2 pI wrote a while back a href=/drupal-add-html-tag-head-meta-linkan article/a on this site in which I looked at how you can add your own custom tags into the codelt;headgt;/code of the site. And there we learned that we use the a href= function inside of a preprocess one to achieve this./p pSo let's say that our Article nodes don't show up properly in the Facebook teasers and we would like to specify OG tags for the title, image and description. We will do this in the theme's codetemplate.php/code file inside of the codetemplate_preprocess_node()/code function:/p precodefunction theme_name_preprocess_node(amp;$vars) { } /code/pre pInside this function we get access to the node information being loaded and we can test to make sure we are adding our OG tags only to the pages that load these nodes:/p precode// If the node is of type article, add the OG tags if ($vars['type'] == 'article') { // Inside this conditional, we define and add our OG tags } /code/pre ppFirst, let's create the title tag, the simplest of them all. It will be represented by the node title:/p precode$og_title = array( '#tag' =gt; 'meta', '#attributes' =gt; array( 'property' =gt; 'og:title', 'content' =gt; $vars['title'], ), ); drupal_add_html_head($og_title, 'og_title'); /code/pre pIf you remember from the other article, this is how we create a new meta tag in the site header. We define a renderable array that describes the tag (type and attributes) and we use the codedrupal_add_html_head()/code function to set it. Simple. Now if you clear the cache and go to an article page you'll notice in its source a new tag:/p precodelt;meta property=og:title content=The title of the article /gt; /code/pre pThis was simple. Let's see how we can extract the image URL and specify it inside a new tag for the image Facebook will use:/p precode$img = field_get_items('node', $vars['node'], 'field_image'); $img_url = file_create_url($img[0]['uri']); $og_image = array( '#tag' =gt; 'meta', '#attributes' =gt; array( 'property' =gt; 'og:image', 'content' =gt; $img_url, ), ); drupal_add_html_head($og_image, 'og_image'); /code/pre pSo what happens here? First, we use the a href= function to retrieve the field called codefield_image/code from the loaded node. This will return an array of one or more images (depending on how the field is set up and how many images are in it)./p pNext, we use the image file URI inside the a href= function to turn it into an absolute URL. Then, just like above, we create the renderable array with the codeog:image/code property and the image URL as the codecontent/code. The result will be:/p precodelt;meta property=og:image content= /gt; /code/pre pFinally, let's see how we can get a small chunk of our body field and use that as a description for Facebook:/p precode$body_field = field_view_field('node', $vars['node'], 'body', array('type' =gt; 'text_plain')); $og_description = array( '#tag' =gt; 'meta', '#attributes' =gt; array( 'property' =gt; 'og:description', 'content' =gt; text_summary($body_field[0]['#markup']), ), ); drupal_add_html_head($og_description, 'og_description'); /code/pre pInstead of using the same function as when we retrieved the image field earlier, we use a href= in this case. The reason is that it already prepares the body for output and we can specify a text format to use. We want to use plain text to avoid printing all the HTML markup that is usually found in the body field./p pNext, like above, we create our renderable array. Only this time, we also use the a href= function to trim the text down to a reasonable default of 600 words (the defaul teaser length on the site). If you want to specify a different length, you could pass it as the strongthird/strong argument, like so:/p precodetext_summary($body_field[0]['#markup'], NULL, 100), /code/pre pThis will trim it to 100 words. One thing I noticed about this function however is that it doesn't trim nicely. It will end the chunk in the middle of the sentence even if its API says it will try to find a sensible place. For this purpose it doesn't really matter because Facebook will trim it down anyway to a shorter version./p h2Conclusion/h2 pSo there you have it. Now you can use the Open Graph meta tags on your Drupal site to let Facebook know about your content. It's a handy social helper that can greatly improve your social presence by making your site more appealing on Facebook./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=Adding Facebook Open Graph tags to your Drupal site class=st_facebook/span span st_url= st_title=Adding Facebook Open Graph tags to your Drupal site class=st_twitter st_via=drupalexp/span span st_url= st_title=Adding Facebook Open Graph tags to your Drupal site 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

Harry Slaughter: One revision control system to rule them all

Mon, 04/07/2014 - 04:18
pThe first revision control system I ever used was called RCS. It was the pre-cursor to CVS and stored all revision data locally. It was nifty but very limited and not suited for group development. CVS was the first shared revisioning system I used. It was rock solid, IMHO. But it had a few big problems, like the inability to rename or move files. Everything had to be deleted and re-added.nbsp;/p pSince those days, I#39;ve used several other revisioning systems: Perforce, Bitkeeper, Clearcase, Subversion and GIT./ppa href= target=_blankread more/a/p

High Rock Media: Drupal 8: Attaching Core Libraries and Other Scripts to Your Theme

Mon, 04/07/2014 - 01:54
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item odd property=content:encodedpimg src= width=880 height=250 alt=In this blog post, we learn how to add core and theme scripts in to Drupal 8 using a theme libraries YML or YAML file. title=In this blog post, we learn how to add core and theme scripts in to Drupal 8 using a theme libraries YML or YAML file. class=image-adaptive inline-adaptive //p pFor the past six months, I've been in the process of porting my contrib theme, Gratis, to Drupal 8. One of the challenges for contrib is Drupal 8 has been a constant moving target in terms of API changes. With every new Alpha of Drupal 8, I've had to adjust many bits of theme code to adhere to these new APIs./p pOne of the biggest challenges has been figuring out how to add jQuery and other core scripts into the theme. That's because off the shelf, Drupal 8 does not add these for anonymous users. This seems like an odd choice by core but my guess is that is was done for Drupal 8 to be more minimalistic and nimble on its feet./p pAt any rate, if you have a contrib theme, most likely the first thing you'll do is add all of these back in to bring it back to a point where Drupal 7 was. To add an additional layer of complexity to all this is the fact that the manner in which this is done has changed dramatically in recent weeks./p h2Exit nested arrays, enter YAML/h2 pAt first one added core libraries using codehook_library_info/code which was a mess of PHP nested arrays in your theme's code.theme/code file. Now, in true Drupal 8 fashion, we do this with a code.yml/code or emyaml/em (rhymes with camel) file. YAML is an acronym for Yet Another Markup Language or emAin't Markup Language/em and has become a core method for streamlining code in Drupal 8./p pHere is a basic example of how you can add jQuery to a theme and a few dependencies. You'd do this by creating a code*libraries.yml/code file in the root of your theme. So in my case my theme name is emfoobar/em so the file name would be codefoobar.libraries.yml/code./p pdiv class=geshifilterfoobarspan style=color: #339933;-/spancorescriptsspan style=color: #339933;:/spanbr / nbsp; versionspan style=color: #339933;:/span VERSIONbr / nbsp; jsspan style=color: #339933;:/spanbr / nbsp; nbsp; jsspan style=color: #339933;//spanscriptsspan style=color: #339933;./spanjsspan style=color: #339933;:/span span style=color: #009900;#123;/spanspan style=color: #009900;#125;/spanbr / nbsp; dependenciesspan style=color: #339933;:/spanbr / nbsp; nbsp; span style=color: #339933;-/span corespan style=color: #339933;//spanjquerybr / nbsp; nbsp; span style=color: #339933;-/span corespan style=color: #339933;//spandrupalspan style=color: #339933;./spanajaxbr / nbsp; nbsp; span style=color: #339933;-/span corespan style=color: #339933;//spandrupalbr / nbsp; nbsp; span style=color: #339933;-/span corespan style=color: #339933;//spandrupalSettingsbr / nbsp; nbsp; span style=color: #339933;-/span corespan style=color: #339933;//spanjqueryspan style=color: #339933;./spanonce/div/p pWith the above code, we'll be adding the core scripts emjquery.js, drupal.js, ajax.js and jquery.once.js/em to our theme. This will make it available for anonymous users. With YAML, indentation spaces are relevant so you'll need to get that bit right. In addition, we are calling a theme relative script in the theme's js folder, emscripts.js/em. The name code-corescripts/code can be anything you want as long as it matches when you go to attach it in your code.theme/code file as outlined below./p h2Attach the Library/h2 pThe next step to actually attach the library we created with a theme preprocess function creating a variable in combination with the code#attached/code method./p pdiv class=geshifilterspan style=color: #009933; font-style: italic;/**br / nbsp;* Override or insert variables into the page / nbsp;*//spanbr / span style=color: #000000; font-weight: bold;function/span foobar_preprocess_pagespan style=color: #009900;#40;/spanspan style=color: #339933;amp;/spanspan style=color: #000088;$vars/spanspan style=color: #339933;,/span span style=color: #000088;$hook/spanspan style=color: #009900;#41;/span span style=color: #009900;#123;/spanbr / nbsp; span style=color: #666666; font-style: italic;// Render the library we defined in foobar.libraries.yml/spanbr / nbsp; span style=color: #000088;$libraries/spanspan style=color: #009900;#91;/spanspan style=color: #0000ff;'#attached'/spanspan style=color: #009900;#93;/spanspan style=color: #009900;#91;/spanspan style=color: #0000ff;'library'/spanspan style=color: #009900;#93;/spanspan style=color: #009900;#91;/spanspan style=color: #009900;#93;/span span style=color: #339933;=/span span style=color: #0000ff;'foobar/foobar-corescripts'/spanspan style=color: #339933;;/spanbr / nbsp; drupal_renderspan style=color: #009900;#40;/spanspan style=color: #000088;$libraries/spanspan style=color: #009900;#41;/spanspan style=color: #339933;;/spanbr / span style=color: #009900;#125;/span/div/p pAttaching the library above implements emprovider-namespaced strings/em i.e. code'gratis/foobar-corescripts'/code where previously it had an array associated with it. This is new in Drupal 8 Alpha 10 and it through me off for a while until I found a core issue that documented this change. Finally, we use codefunction drupal_render/code to render the new library./p h2What's Next?/h2 pIn a future Drupal 8 related articles, I'll get in to setting custom configuration for your Drupal 8 theme, this comes in real handy and we'll be using YAML with the added addition of using Drupal 8's CMI layer. I'll also talk more about API changes as they relate to themers, it's probably safe to do that now as Drupal 8 is most likely heading toward a beta within the next few months and it seems like many of the major core API changes have been done./p /div/div/divh2 class=field-labelTagsnbsp;/h2ul class=field-items tag-itemsli class=field-item odd firstDrupal/lili class=field-item evenYAML/lili class=field-item oddDrupal 8/lili class=field-item evenDrupal Planet/lili class=field-item odd lastTheming/li/ulh2 class=field-labelResourcesnbsp;/h2ul class=field-items tag-itemsli class=field-item odd firsta href= target=_blank rel=nofollowReplace hook_library_info() by *.libraries.yml file/a/lili class=field-item evena href= target=_blank rel=nofollowReplace #attached library array values with provider-namespaced strings/a/lili class=field-item odda href= target=_blank rel=nofollowYAML Ain't Markup Language (YAML™) Version 1.1/a/lili class=field-item evena href= target=_blank rel=nofollowfunction drupal_render/a/lili class=field-item odda href= target=_blank rel=nofollowHow do I make a Drupal 8 theme require Jquery (for anonymous users)?/a/lili class=field-item evena href= target=_blank rel=nofollowYAML (Wikipedia)/a/lili class=field-item odda href= target=_blank rel=nofollowDrupal Gratis, A Responsive Theme (7 amp; 8)/a/lili class=field-item even lasta href= target=_blank rel=nofollowGratis Drupal 8 related issues/a/li/ul