Drupal Planet

Syndicate content
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 1 hour 57 min ago

Wunderkraut blog: Just get the files you need when you develop

8 hours 38 min ago
p class=field-ns-blog-post-lead When you work locally on development or test on stage/dev whatever you sometimes needs the files from production. Our old way in solving that is downloading the whole file catalogue and have it local. Sometimes the file catalogues where several gigabytes large so that is not a good workflow at all. /p div class=field-ns-blog-post-body clearfix div class=field-item even pTo solve that problem we are now using a href=https://drupal.org/project/stage_file_proxyStage file proxy/a. We have been using it for some time now to get files to stage or locally, and it works really well (we have some issues on D6-sites, but works almost flawless on D7-sites). Stage file proxy downloads the files that are requested from production (or whatever) site running environment./ppSo you just get the files you need, and you could easily delete the files locally and get them back when called for. Time and space saver./ppimg alt=markering_229.png class=media-image height=298 title=markering_229.png width=480 src=http://www.wunderkraut.com/sites/wunderkraut.com/files/styles/large/public/markering_229.png?itok=PqHjk9H3 //ppA nice patch to the module is getting an a href=https://drupal.org/node/1545912admin-interface/a - so that you don’t need to add settings to settings.php or creating variables. strongEDIT:/strong a href=https://drupal.org/user/36762Greggles/a just committed that patch to dev :-)/ppemPhoto by James Butler/em/p /div /div
Categories: Drupal Feeds

Frederick Giasson: Exporting Entities using OSF for Drupal (Screencast)

9 hours 30 min ago
span class=Z3988 title=ctx_ver=Z39.88-2004amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adcamp;rfr_id=info%3Asid%2Focoins.info%3Ageneratoramp;rft.title=Exporting Entities using OSF for Drupal (Screencast)amp;rft.aulast=Giassonamp;rft.aufirst=Frederickamp;rft.subject=Open Semantic Frameworkamp;rft.subject=OSF Academyamp;rft.subject=OSF for Drupalamp;rft.subject=Planet Drupalamp;rft.subject=Semantic Webamp;rft.subject=Structured Dynamicsamp;rft.source=Frederick Giasson#8217;s Weblogamp;rft.date=2014-04-23amp;rft.type=blogPostamp;rft.format=textamp;rft.identifier=http://fgiasson.com/blog/index.php/2014/04/23/exporting-entities-using-osf-for-drupal-screencast/amp;rft.language=English/span pThis screencast will introduce you to the a href=https://drupal.org/project/osfcodeOSF for Drupal/code/a features that let you export codeDrupal Entities/code in one of the following supported serializations:/p ul lia class=external text href=http://www.w3.org/TR/REC-rdf-syntax/ rel=nofollowRDF+XML/a (RDF in XML)/li lia class=external text href=http://www.w3.org/TeamSubmission/n3/ rel=nofollowRDF+N3/a (RDF in N3)/li lia title=StructJSON href=http://wiki.opensemanticframework.org/index.php/StructJSONstructJSON/a (Internal OSF RDF serialization in JSON)/li lia title=StructXML href=http://wiki.opensemanticframework.org/index.php/StructXMLstructXML/a (Internal OSF RDF serialization in XML)/li lia title=Instance Record and Object Notation (irON) Specification href=http://wiki.opensemanticframework.org/index.php/Instance_Record_and_Object_Notation_%28irON%29_Specification#SUB-PART_2:_irJSON_PROFILEironJSON/a (irON serialization in JSON)/li lia title=Instance Record and Object Notation (irON) Specification href=http://wiki.opensemanticframework.org/index.php/Instance_Record_and_Object_Notation_%28irON%29_Specification#SUB-PART_3:_commON_PROFILEcommON/a (CSV serialization to be used in spreadsheet applications)/li /ul pI will show you how you can use codeOSF for Drupal/code to export entire a href=http://wiki.opensemanticframework.org/index.php/Category:OSF_for_Drupal_User_Manual#Exporting_a_Datasetdatasets of codeEntities/code/a, or how to export a href=http://wiki.opensemanticframework.org/index.php/Category:OSF_for_Drupal_User_Manual#Exporting_ResourcescodeEntities/code individually/a. You will see how you can configure Drupal such that different users roles get access to these functionalities./p pI will also briefly discuss how you can create new converters to support more data formats./p pFinally, I will show you how Drupal can be used as a codea href=http://en.wikipedia.org/wiki/Linked_datalinked data/a/code platform with a feature that makes every Drupal codeEntities/code a href=http://en.wikipedia.org/wiki/Dereferenceable_Uniform_Resource_Identifiercodedereferencable/code/a on the Websup class='footnote'a href='#fn-2408-1' id='fnref-2408-1' onclick='return fdfootnote_show(2408)'1/a/sup. You will see how you can use a href=http://curl.haxx.se/cURL/a to export the codeEntities/code#8216; descriptions using their URI in one of the 6 supported serialization formats./p pcenterbr / a href=https://www.youtube.com/watch?v=KI7uIbXQIbEimg class=aligncenter size-full wp-image-2414 src=http://fgiasson.com/blog/wp-content/uploads/2014/04/tut_11_blog_400.png alt=tut_11_blog_400 width=400 height=225 //a/centernbsp;/p div class='footnotes' id='footnotes-2408' div class='footnotedivider'/div ol li id='fn-2408-1'OSF for Drupal follows thea href=http://www.w3.org/TR/cooluris/ Cool URIs for the Semantic Web/a W3C#8217;s interest group notes span class='footnotereverse'a href='#fnref-2408-1'#8617;/a/span/li /ol /div
Categories: Drupal Feeds

Drupal Commerce: Commerce Module Tuesday: Commerce Add to Cart Extras

9 hours 36 min ago
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpa href=http://www.drupalcommerce.org/blog/13680/commerce-module-tuesday-commerce-add-cart-extrasimg src=http://www.drupalcommerce.org/sites/default/files/commerce_add_to_cart_cmt_cover.jpg alt=Commerce Add to Cart Extras border=0 width=100% style=height: auto; //a/p pa href=http://dgo.to/commerce_add_to_cart_extrasCommerce Add to Cart Extras/a is a great little module that provides the ability to turn a product listing view into an add to cart form. It does this by providing a new field that you add to a view which provides a quantity text box and makes the entire view an add to cart form. This differs from the existing “Add to Cart” field provided by commerce, which allows you to add a single item to the cart from a list./p pThis allows you to do some useful things such as creating a bulk order form which lists some or all of the products on your site, allowing customers to enter a quantity directly for the products they want. Or, you can utilize standard Views functionality to create another add to cart form for wholesalers on products with several attributes allowing them to add quantities of each individual product quickly and easily. Let’s take a brief look at how we can do this.  Just download and enable the module, and you’re ready to get started./p pa href=http://www.drupalcommerce.org/blog/13680/commerce-module-tuesday-commerce-add-cart-extrasVideo and run-down after the break./a/p /div/div/div
Categories: Drupal Feeds

Károly Négyesi: How to crash your site

15 hours 57 min ago
pI got a desperate call about a site being down, this is ordinary for me (advertisment: you can a href=https://drupal.org/chxcontact me/a if it happens to you). But the error I saw was new to me. This is surprising -- I have thought I have seen it all and then some. The modules/views/includes/plugins.inc was fataling about the function views_include not existing. At first I thought opcache went south cos how on earth could an include be loaded when the module isn't?? But it wasn't opcache. Next step was adding a debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) before the offending views_include call and behold... what?? variable_initialize?? o_O OH! Obviously the poor thing is trying to unserialize a views object but it's superb early in the bootstrap and so modules aren't loaded. So while unserializing the classloader loads plugins.inc which leads to this fatal. Neat. Moral of the story: don't ever try to store a views object in variables. Or an array containing a views object. /p
Categories: Drupal Feeds

Modules Unraveled: 105 Using Membership Entity to Set Up a Drupal Based Membership Site with Caleb Thorne, Bryan Jones and David Csonka - Modules Unraveled Podcast

17 hours 12 min ago
div class=field field-name-field-image field-type-image field-label-hidden view-mode-rssdiv class=field-itemsfigure class=clearfix field-item evenimg typeof=foaf:Image class=image-style-podcast-default src=http://modulesunraveled.com/sites/default/files/styles/podcast_default/public/podcast/image/Caleb%20Bryan%20David.png?itok=sVccYRyN width=300 height=141 alt=Photo of Caleb Thorne, Bryan Jones and David Csonka //figure/div/divspan class=submitted-byPublished: Wed, 04/23/14/spandiv class=field field-name-field-podcast-file field-type-file field-label-hidden view-mode-rssdiv class=field-itemsdiv class=field-item evendiv class=mediaelement-audioaudio src=http://traffic.libsyn.com/modulesunraveled/105_Using_Membership_Entity_to_Set_Up_a_Drupal_Based_Membership_Site_with_Caleb_Thorne_Bryan_Jones_and_David_Csonka_-_Modules_Unraveled_Podcast.mp3 class=mediaelement-formatter-identifier-1398239845-0 controls=controls /audiodiv class=mediaelement-download-linka href=http://traffic.libsyn.com/modulesunraveled/105_Using_Membership_Entity_to_Set_Up_a_Drupal_Based_Membership_Site_with_Caleb_Thorne_Bryan_Jones_and_David_Csonka_-_Modules_Unraveled_Podcast.mp3Download this episode/a/div/div/div/div/divdiv class=field field-name-body field-type-text-with-summary field-label-hidden view-mode-rssdiv class=field-itemsdiv class=field-item even property=content:encodedh2Project/h2 ulli pWhat is the Membership Entity module?br / Project backgroundbr / First membership site developed was Mercedes-Benz Club of America (http://www.mbca.org).br / Involved a bunch of custom code.br / Developmentbr / Entity APIbr / Key featuresbr / Multiple users per membership (primary and secondary)br / Join/Renew onlinebr / Role managementbr / Membership terms and modifiersbr / E-Commerce solutions (coming soon)br / Commerce integration (Caleb)br / Ubercart integration (Bryan)br / product classbr / Using product attributes to store membership data.br / Investigating better ways to store data before official release./p /li li pDo you handle pro-rated renewals?/p /li liTrials?/li liHow are you guys dealing with role based permissions, and time limited access?/li liAre there different levels of membership?/li liDo you deal with CC details?/li liWhat other solutions did you guys look at before creating this one? ulliWhy not just use profile2/rules/civiCRM or other existing modules?/li /ul/li /ulpThe big problem with Profile2 is that it only allows one user per profile. Some fields should be shared for all users that belong to a single membership.br / Membership Entity includes rules integration.br / Membership Entity is 100% Drupal. No third party integration required./p !-- Last chance to send in questions using the hashtag: #MUP105 --h2Use Cases/h2 ulliDo you guys have any sites currently running the Membership Entity module?br / (David) - Joined the team after much of the development of the module was already done, so had the perspective of a developer on the outside, learning what the module provides and how to extend it. Being built around the Entity API made creating Views-based reports very simple, as most of the membership data that I needed to display was already exposed. For any that wasn’t, the extensible nature of the module (via things like all of the provided custom hooks) made the process of developing additional custom entities derived from membership meta-data rather straightforward.br / (Bryan) - Drop in solution for simple membership sites (CEMA).br / No custom code required.br / Membership process working in less than an hour.br / Integrated with Ubercart (Module coming soon)./li /ul/div/div/divsection class=field field-name-field-items-mentioned field-type-link-field field-label-above view-mode-rssh2 class=field-labelEpisode Links:nbsp;/h2div class=field-itemsdiv class=field-item evena href=http://drupal.org/user/689392 target=_blank rel=nofollowdraenen (Caleb Thorne)/a/divdiv class=field-item odda href=https://drupal.org/user/699770 target=_blank rel=nofollowBryan/a/divdiv class=field-item evena href=https://drupal.org/user/1761862 target=_blank rel=nofollowDavid Csonka/a/divdiv class=field-item odda href=https://twitter.com/monarchd target=_blank rel=nofollowMonarch Digital/a/divdiv class=field-item evena href=https://drupal.org/project/membership_entity target=_blank rel=nofollowMembership Entity/a/divdiv class=field-item odda href=https://drupal.org/sandbox/draenen/2211367 target=_blank rel=nofollowCommerce integration (sandbox)/a/divdiv class=field-item evena href=https://drupal.org/sandbox/Bartuc/1819954 target=_blank rel=nofollowUbercart integration (sandbox)/a/divdiv class=field-item odda href=http://www.monarchdigital.com/blog/2014-03-17/announcing-membership-entity-contributed-module-drupal target=_blank rel=nofollowModule release blog post/a/divdiv class=field-item evena href=https://austin2014.drupal.org/ target=_blank rel=nofollowWe will be having a BoF at DrupalCon Austin. Watch for it at/a/div/div/sectionsection class=field field-name-field-tags field-type-taxonomy-term-reference field-label-above view-mode-rssh2 class=field-labelTags:nbsp;/h2ul class=field-itemsli class=field-item evena href=/planet-drupal typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=planet-drupal/a/li/ul/section
Categories: Drupal Feeds

Darren Mothersele: Drupal Site Builder Patterns - The State Machine

Tue, 04/22/2014 - 6:00pm
pIn this new series for my blog, I#39;ll be documenting some common design patterns for Drupal site builds. This first post is about the State Machine pattern, which is something I#39;ve used on several sites recently./p pFirst, let me explain what I mean by quot;patternquot;. If you are already familiar with design patterns in Object-oriented software then you can probably skip this bit, but I think it#39;s useful for context./p !--break-- h3Design patterns?/h3 pHere#39;s a quote from the original a href=http://en.wikipedia.org/wiki/Design_PatternsGang of Four book/a on design patterns. That book is about design of object-oriented software, but I think it applies to Drupal development too. The quote is from p.1 of the book, apologies if I offend anyone by bastardising it. I#39;ve taken the liberty of substituting the words quot;Designing object-oriented softwarequot; with quot;building Drupal sitesquot;, and a few other substitutions to make my point.../p blockquote p[Building large maintainable Drupal sites] is hard... Your design should be specific to the problem at hand but also general enough to address future problems and requirements [and be maintainable]... Experienced [Drupal site builders] will tell you that a reusable and flexible design is difficult if not impossible to get quot;rightquot; the first time./p pYet experienced [Drupal site builders] do make good designs. Meanwhile new [site builders] are overwhelmed by the options available and tend to fall back on non-[Drupal] techniques they#39;ve used before. It takes a long time for novices to learn what good [Drupal site building] is all about. Experienced [site builders] evidently know something inexperienced ones don#39;t. What is it?/p pOne thing expert [site builders] know NOT to do is solve every problem from first principles. Rather, they strongreuse solutions that have worked for them in the past/strong. When they find a good solution, they use it again and again. Such experience is part of what makes them experts./p /blockquote pSo I#39;ve been looking at what these quot;good solutionsquot; are that I might have been using, and as I identify them I#39;ve been documenting them along the same lines of the original design patterns from the Gang of Four book:/p ul liPattern name - the handle we use to describe the problem/li liProblem - explain the problem and its context, and when you might want to use this pattern/li liSolution - describe the elements that make up the solution, in my case how the pattern can be best implemented in Drupal/li liConsequences - results and trade-offs of using the pattern, in this case I also consider further issues that many need to be considered as a result of using the pattern./li /ul pSo, first let#39;s look at what a state machine is, and what problems it solves, before going on to look at how to configure it in Drupal./p h3State Machine/h3 pA state machine is a theoretical computer science concept that provides a a href=http://blog.markshead.com/869/state-machines-computer-science/mathematical basis for modelling computation/a. But don#39;t worry, the kind of state machines we#39;ll be using don#39;t require a degree in computer science to understand./p pAll you really need to know is that the state machine (or more correctly a a href=http://en.wikipedia.org/wiki/Finite-state_machineFinite State Machine/a) has a finite number of quot;statesquot; it can be in and the machine is only ever in one of these states at a time, it#39;s emcurrent state/em. The state machine can change from one state to another triggered by an event or condition. This change of state is called a emtransition/em. A state machine is typically visualised using a emstate machine diagram/em, for example:/p pimg src=http://darrenmothersele.com/img/state-machine/diagram1.png alt=Simple state machine/p pAs you can see the states are represented by an ellipse with the name of the state inside, the arrows denote the possible transitions. You can also see how the entry point and exit point would be notated./p pHere#39;s a (very simplified) example of a ticket in an agile issue queue. In reality this would probably have several other states but for the sake of this example, here#39;s a simple state machine for the ticket:/p pimg src=http://darrenmothersele.com/img/state-machine/diagram2.png alt=Example state machine/p pA state machine is defined by the list of possible states and the event/condition that triggers each transition./p pIf you#39;re reading this and thinking quot;Eventsquot;, quot;Conditionsquot;, sounds a bit like Drupal Rules, then you#39;ve already worked out how we#39;re going to implement this in Drupal!/p pIn this simple ticket example the states are quot;In progressquot;, quot;Approvalquot;, and quot;Finishedquot;. The transitions are quot;Completedquot;, quot;Rejectedquot;, quot;Acceptedquot;./p h3When to use it?/h3 pIt might be useful to think that in business speak, when they say quot;business processesquot; they are actually talking about state machines. Here are some cases when you might want to think about state machines:/p ul liIf you#39;ve ever had to model a quot;statequot; or quot;statusquot; field, then you#39;ve got a good candidate for a state machine./li liIf you#39;ve ever wanted to anything more complex than just published and unpublished nodes then you have a good candidate for using a state machine./li liIf you have boolean fields in your content model called things like quot;paid/unpaidquot;./li liIf you have records that need to expire after a specific period of time/li /ul pDrawing out a state machine diagram to model this kinds of problems can be really useful to help identify any quot;edge-casequot; scenarios you may not have thought of, and capture them early in the design process. It also shows you exactly what you need to test further along in the site build./p h3Let#39;s build it/h3 pAs with anything in Drupal there are several ways to achieve this functionality, in fact there#39;s even a a href=https://drupal.org/project/state_machineState Machine/a module, but that relies on creating custom plugins. If you#39;re a developer you might want to take a look at this module./p pa href=https://drupal.org/project/workbench_moderationWorkbench Moderation/a and various other workflow modules include a state machine implementation for a specific purpose./p pThe approach documented here is suitable for site builders, is flexible, and provides a neat solution that can be configured using the following contributed modules:/p ul lia href=https://drupal.org/project/rules_linkRules Link/a/li lia href=https://drupal.org/project/field_permissionsField Permissions/a/li /ul pI said before that the state machine is defined by it#39;s set of possible states and set of transitions. In Drupal we#39;ll be using a simple list field to store the list of possible states for the node./p pIn a a href=http://drupalize.me/blog/201404/hiding-form-fields-drupal-8recent post/a on Drupalize.me they mention the addition of the ability to hide form fields in Drupal 8 core. In Drupal 7 we need a module to help us do this. In this case we are adding a field that will never be directly edited by the user so we just deny access to edit that field using the a href=https://drupal.org/project/field_permissionsField Permissions/a module./p pFor the simple ticket example, we have 3 states. So use an integer list field with the following allowed values:/p ul li0|In progress/li li1|Awaiting approval/li li2|Finished/li /ul pI said that the state machine was defined by the set of possible states (implemented by our list field), and a set of transitions. These transitions can be implemented using the a href=https://drupal.org/project/rules_linkRules Link/a module./p pUsing the Rules Link module you can add a button to the ticket node which manipulates the quot;statequot; value preventing the user from actually editing the value in the state field directly, and thus enforcing the workflow defined in our state machine./p pEach quot;Rules linkquot; is configured in two parts. First you define the conditions for when the link should be visible using standard Rules conditions. Secondly, you use the rules reaction to set the value of the state field to the new value (and perform any other actions that you want as a side effect of the transition)./p h3Considerations/h3 pIt#39;s good to follow a principle of audit-ability, so you probably need to keep the transition history. A simple solution might be to add a timestamp field such as quot;confirmed atquot; to mark when it went to confirmed state. If using node, you could log revisions to track state changes in the revision log for the node. Or you could look at Messages module to log messages when state changes happen./p h3More patterns/h3 pIf you#39;re interested in learning more from my 7 years of Drupal experience (and if you#39;re based in London) why not join me for a href=http://www.eventbrite.com/e/everything-i-know-about-drupal-2-day-intensive-drupal-training-course-tickets-11153411153?aff=stateEverything I Know About Drupal/a an intensive 2-day Drupal training I#39;ve been working on. It#39;s taken a lot of preparation, and there#39;s still a small number of tickets available. You can find more information on my a href=http://darrenmothersele.com/blog/2014/04/15/drupal-training-london/blog post/a about it or grab a ticket on a href=http://www.eventbrite.com/e/everything-i-know-about-drupal-2-day-intensive-drupal-training-course-tickets-11153411153?aff=statethe Eventbrite page/a./p
Categories: Drupal Feeds

Evolving Web: DrupalCamp NYC at the United Nations - Recap and Photos

Tue, 04/22/2014 - 4:52pm
img typeof=foaf:Image src=http://evolvingweb.ca/sites/default/files/styles/medium/public/_q4a2601.jpg?itok=D8Ud3Hgf width=308 height=220 alt=Drupal Panels Presentation at the UN /pThis year's DrupalCamp NYC was held at the United Nations. The camp was crammed with summits and useful sessions and included a lot of content about Drupal 8./p a href=http://evolvingweb.ca/blog/drupalcamp-nyc-united-nationsread more/a
Categories: Drupal Feeds

Drupalize.Me: Webinar: Easily Create Maps with Leaflet

Tue, 04/22/2014 - 2:50pm
div class=field field-name-body field-type-text-with-summary field-label-hidden text-content text-secondarydiv class=field-itemsdiv class=field-item evenpCurious about Leaflet? Join Drupalize.Me Trainer Amber Matz for a live tutorial on how to add Leaflet maps to your Drupal site during this Acquia hosted webinar on May 1, 2014 at 1:00 PM EDT./p /div/div/div
Categories: Drupal Feeds

Dcycle: Simpletest Turbo: how I almost quadrupled the speed of my tests

Tue, 04/22/2014 - 2:15pm
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpMy development team is using a a href=http://dcycleproject.org/blog/44site deployment module/a which, when enabled, deploys our entire website (with translations, views, content types, the default theme, etc.)./p pWe defined about 30 tests (and counting) which are linked to Agile user stories and confirm that the site is doing what it's supposed to do. These tests are defined in Drupal's own Simpletest framework, and works as follows: for every test, our site deployment module is enabled on a new database (a href=http://dcycleproject.org/blog/48/do-not-clone-databasethe database is never cloned/a), which can take about two minutes; the test is run, and then the temporary database is destroyed./p pThis created the following problem: because we were deploying our site 30 times during our test run, a single test run was taking over 90 minutes. Furthermore, we are halfway into the project, and we anticipate doubling, perhaps tripling our test coverage, which would mean our tests would take over four hours to run./p pNow, we have a Jenkins server which performs all the tests every time a change is detected in Git, but even so, when several people are pushing to the git repo, test results which are 90 minutes old tend to be harder to debug, and developers tend to ignore, subvert and resent the whole testing process./p pWe could combine tests so the site would be deployed less often during the testing process, but this causes another problem: tests which are hundreds of lines long, and which validate unrelated functionality, are harder to debug than short tests, so it is not a satisfactory solution./p pWhen we look at what is taking so long, we notice that a majority of the processing power goes to install (deploy) our testing environment emfor each test/em, which is then destroyed after a very short test./p pEnter a href=https://drupal.org/project/simpletest_turboSimpletest Turbo/a, which provides very simple code to emcache/em your database once the setUp() function is run, so the next test can simply reuse the same database starting point rather than recreate everything from scratch./p pimg src=http://dcycleproject.org/sites/dcycleproject.org/files/screen_shot_2014-04-22_at_3.13.55_pm.png //p pAlthough Simpletest Turbo is in early stages of development, I have used it to almost emquadruple the speed of my tests/em, as you can see from this Jenkins trend chart:/p pimg src=http://dcycleproject.org/sites/dcycleproject.org/files/screen_shot_2014-04-22_at_3.14.08_pm.png //p pI know: my tests are failing more than I would like them to, but now I'm getting feedback every 25 minutes instead of every 95 minutes, so failures are easier to pinpoint and fix./p pFurthermore, fairly little time is spent deploying the site: this is done once, and the following tests use a cached deployment, so we are not merely speeding up our tests (as we would if we were adding hardware): we are streamlining duplicate effort. It thus becomes relatively cheap to add new independent tests, because they are using a cached site setup./p /div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-abovediv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item even rel=dc:subjecta href=/tags/planet typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=planet/a/divdiv class=field-item odd rel=dc:subjecta href=/tags/blog typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=blog/a/div/div/div
Categories: Drupal Feeds

AGLOBALWAY: Drupal Bootstrap

Tue, 04/22/2014 - 12:34pm
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encoded divHere at AGLOBALWAY, we are constantly learning to take advantage of the myriad of tools available to us whether for communication, productivity, or development. As a company dedicated to all things open source, one of the tools we employ is Twitter’s Bootstrap framework. Thanks to the industriousness and generosity of companies like Twitter, (or Zurb for its own Foundation framework, among others), the web community has a tremendous amount of resources from which to draw upon./div div /div divDrupal has been a key content management framework for us ever since the inception of our company for its flexibility, power, and configurability. Bootstrap has made an excellent companion for Drupal in several of our projects so far, so I will highlight just a few of the many ways that a Bootstrap-based theme can compliment your Drupal website./div div /div divstrongBootstrapped Style/strong/div div /div divWhile some decry the design style and “look” that is quintessentially Bootstrap, there really is no need to. Yes, it has been a major influence on modern web design trends. Bootstrap has prepackaged layouts and default styles for nearly all UI elements, taking away the need to create styles for everything. But, building a unique site that doesn’t follow that typical Bootstrap style own doesn’t have to be difficult. The real undertaking is in learning the ins and outs of the preprocessor system employed by Bootstrap (Less, in this case), and how they have laid everything out./div div /div divOnce familiar with the system, one will quickly realize that it’s relatively straightforward to take advantage of all of the mixins and variables already given in order to generate the styles you have designed. In one .less file, we can quickly define colours, sizes, and other default settings that will appear throughout your site. Again, like the JavaScript libraries above, this is not unique to Drupal. However, being able to take advantage of these tools helps immensely to speed up the development cycle of building Drupal sites./div div /div divstrongJavaScript Libraries/strong/div div /div divHaving access to a number of common functions used throughout the web is a huge time saver. Already bundled with jQuery, a Drupal Bootstrap-based theme allows for easy integration of accordions, image carousels and more, without having to write your own JavaScript. While these libraries are certainly not exclusive to Drupal, there can be unique ways of making use of them with Drupal. For example, rendering a block inside of a modal for a login form is a snap, and css is all you really need to customize it once you initialize it with the proper JavaScript./div div /div divAnother example would be to pair Bootstrap with the popular CKEditor module to generate templates, using Bootstrap’s markup. Users may want to place an accordion inside their own managed content, so we can create a template with CKEditor’s default.js file (even better, create a separate file and use that one instead), following the pattern of the templates already given. Add the Bootstrap markup with the appropriate classes, and voila! Your users now have an accordion they can insert using only the WYSIWYG editor./div div /div divstrongBootstrap Views/strong/div div /div divThis is a Drupal module I have yet to really play around with personally, but a cursory look tells me just how easy it can be to display content using Bootstrap elements without even getting into template files or writing code. While I generally prefer to separate markup from data output, I can see the potential here for a lot of time saving, while avoiding some head-scratching at the same time. This is the whole point of views in the first place - making it easy to display the content you want without having to dive too deep./div div /div divAs we can see, integrating Drupal with Twitter Bootstrap has considerable advantages. While its heaviness is a fair criticism, I believe those advantages justify the use of Bootstrap, particularly in an Agile development environment. Besides, we can always eliminate the JavaScript or CSS we don’t use once we’re done developing our site. Whether it’s Bootstrap, Foundation, or your framework of choice, having such front-end tools to integrate with Drupal can only be a good thing. Many thanks to all who are dedicated to creating and maintaining these resources for the benefit of us all./div /div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-abovediv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item even rel=dc:subjecta href=/tags/drupal-planet typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=drupal planet/a/divdiv class=field-item odd rel=dc:subjecta href=/tags/bootstrap typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Bootstrap/a/div/div/div
Categories: Drupal Feeds

Propeople Blog: Propeople at Stanford Drupal Camp 2014

Tue, 04/22/2014 - 12:26pm
div id=comment-wrapper-nid-1446/divdiv class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedp dir=ltrThis past weekend, some of our team had the pleasure of attending a href=https://drupalcamp.stanford.edu/Stanford Drupal Camp/a, which Propeople supported as a a href=https://drupalcamp.stanford.edu/sponsorsGold Sponsor/a. Stanford University is one of the biggest advocates of Drupal in higher-education, and is home to an active and passionate Drupal community. Hosted on the world famous (and too-gorgeous-to-put-into-words) Stanford campus, the Stanford Drupal Camp is an annual event focused on Drupal and the state of Drupal at the university (where thousands of websites are powered by the CMS). Propeople has participated in the event the past few years, and we've had the pleasure to work on a wide variety of Stanford projects in the same amount of time. These include the a href=/clients/stanford-graduate-school-businessStanford Graduate School of Business/a, a href=/clients/slacSLAC National Accelerator Laboratory/a, a href=/clients/stanford-student-affairsStanford Student Affairs/a, a href=/clients/riverwalk-jazzRiverwalk Jazz/a, and many others. /pp dir=ltrspan style=line-height: 1.538em;Stanford Drupal Camp featured a great line-up of sessions and talks all day Friday and Saturday, ranging from the simple to the complex. The talks focused on a variety of topics, from site building to Agile and Scrum methodology to specific Drupal use cases in higher education. As you can expect at any Drupal camp, more casual BoFs and lightning talks were interspersed throughout the conference./span/pp dir=ltrWe were happy to have the packed schedule include two sessions presented by one of Propeople’s own Drupal experts, a href=/blog/author/yuriy-gerasimovYuriy Gerasimov/a, on Saturday. Yuriy’s first session was titled “CI and Other Tools for Feature Branch Development”, aimed at helping developers and organizations implement feature-branch workflow. The second was “Local Development with Vagrant”, which, as you might have guessed from the title, was all about the benefits of using Vagrant to spin up local virtual machines with the same settings on different platforms./pp dir=ltr /pp dir=ltrimg alt=Propeople at Stanford Drupal Camp class=media-element file-default data-file_info=%7B%22fid%22:%223391%22,%22view_mode%22:%22default%22,%22fields%22:%7B%22format%22:%22default%22,%22field_file_image_alt_text%5Bund%5D%5B0%5D%5Bvalue%5D%22:%22Propeople%20at%20Stanford%20Drupal%20Camp%22,%22field_file_image_title_text%5Bund%5D%5B0%5D%5Bvalue%5D%22:%22%22,%22field_tags%5Bund%5D%22:%22%22%7D,%22type%22:%22media%22%7D src=http://d3gda9raw7t781.cloudfront.net/sites/default/files/Yuriy_Propeople_1_0.jpg style=line-height: 1.538em; typeof=foaf:Image //pp dir=ltr /pp dir=ltrimg typeof=foaf:Image src=http://d3gda9raw7t781.cloudfront.net/sites/default/files/Yuriy_Propeople_2_0.jpg alt=Yuriy Gerasimov, one of Propeopleamp;#039;s Drupal experts //pp dir=ltrspan style=line-height: 1.538em;Overall, the many sessions, BoFs, and lightning talks provided Stanford staff, faculty, students, and developers (from the university and beyond) with plenty of great information./span/ppIn addition to the full session schedule, Stanford Drupal Camp featured plenty of opportunities for those at the event to enjoy each other’s company, catch up, and engage in some great conversation about every attendee’s favorite topic...Drupal! As a technology partner to more than a dozen Stanford departments and institutions, Propeople has learned first hand how great the Stanford community is, and it was a treat to have some of our team on campus to join in on the fun at Stanford Drupal Camp. We’ll be looking forward to next year!/p/div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-abovediv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/tags/drupal typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Drupal/a/divdiv class=field-item odda href=/tags/drupal-camp typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Drupal camp/a/divdiv class=field-item evena href=/tags/stanford typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Stanford/a/div/div/divdiv class=field field-name-field-drupal-planet field-type-taxonomy-term-reference field-label-abovediv class=field-labelCheck this option to include this post in Planet Drupal aggregator:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/drupal/planet typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=planet/a/div/div/divdiv class=field field-name-field-topics field-type-taxonomy-term-reference field-label-abovediv class=field-labelTopics:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/topics/community-events typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Community amp; Events/a/div/div/div
Categories: Drupal Feeds

Phase2: Exploring Maps In Sass 3.3(Part 3): Calling Variables with Variables

Tue, 04/22/2014 - 12:25pm
p dir=ltrFor this blog entry, the third in a a href=http://www.phase2technology.com/?s=ssseriesseries about Sass Maps/a, I am going to move away from niche application, and introduce some more practical uses of maps./p h2 dir=ltrLiving Style Guides/h2 p dir=ltrIn my current project, a large Drupal media site,  I wanted to have a style guide, a single static page where we could see all of the site colors, along with the variable name. I collected all of my color variables, and created some static markup with empty divs. Below is the loop I started to write./p p/ppre class=crayon-plain-taglt;!-- The HTML for our Style Guide --gt; lt;div class=styleguidegt; lt;div class=primary-colorgt;lt;/divgt; lt;div class=secondary-colorgt;lt;/divgt; lt;div class=tertiary-colorgt;lt;/divgt; lt;/divgt;/prep/ppre class=crayon-plain-tag// Our site color variables $primary-color: #111111; $secondary-color: #222222; $tertiary-color: #333333; // Make a list of the colors to display $styleguide-colors: primary-color, secondary-color, tertiary-color; // Loop through each color name, create class name and styles @each $color in $styleguide-colors { .styleguide .#{$color} { background-color: $#{$color}; // Spoiler Alert: Does not work!! amp;:after { content: “variable name is #{$color}” } } }/prep/p p dir=ltrThis loop goes through each color in my pre class=crayon-plain-tag$styleguide-colors/pre list and creates a class name based on the color name. It then attempts to set the background-color by calling a variable that matches the name from the list. We also set the content of a pseudo element to the variable name, so that our styleguide automatically prints out the name of the color./p p dir=ltrThis is what we strongwant/strong the first loop to return:/p p/ppre class=crayon-plain-tag.styleguide .primary-color {  background-color: $primary-color; // Nope, we won’t get this variable  amp;:after {      content: “variable name is primary-color”    } }/prepThe problem is that we can’t interpolate one variable to call another variable! pre class=crayon-plain-tag$#{$color}/pre  doesn’t actually work in Sass. It won’t interpolate into pre class=crayon-plain-tag$ + primary-color/pre , and then yield pre class=crayon-plain-tag#111111/pre  in the final CSS. This 3 year old github issue points out this exact issue, and hints at how maps is going to be introduced in Sass 3.3 to solve this problem. a href=https://github.com/nex3/sass/issues/132https://github.com/nex3/sass/issues/132/a/p h2 dir=ltrMake it better with maps/h2 p dir=ltrSo now that we have maps, how can we create this color styleguide? Lets take this a step at a time./p p dir=ltrFirst we need to wrap all of our colors in a map. Remember, any of these colors can be accessed like this: pre class=crayon-plain-tagmap-get($site-colors, primary-color)/pre/p p/ppre class=crayon-plain-tag$site-colors: (  primary-color: #111111,  secondary-color: #222222,  tertiary-color: #333333, );/prep/p p dir=ltrNow we can create a list of the colors we want to iterate through and loop through them just like we did before./p p/ppre class=crayon-plain-tag$styleguide-colors: primary-color, secondary-color, tertiary-color; @each $color in $styleguide-colors {  .styleguide .#{$color} {    background-color: map-get($site-colors, $color); // This DOES work!    amp;:after {      content: “variable name is #{$color}”    }  } }/prepThis time when we loop through our colors we get the same class name and pseudo element content, but lets look at what happens with the background color. Here is the first pass through the loop, using primary-color as pre class=crayon-plain-tag$color/pre :/ppre class=crayon-plain-tag.styleguide .primary-color {   background-color: map-get($site-colors, primary-color);   amp;:after {      content: “variable name is primary-color”    } }/prep/p p dir=ltrAs you can see in this intermediate step, we are able to use pre class=crayon-plain-tagmap-get($site-colors, primary-color)/pre  to programmatically pass our color name into a function, and get a returned value. Without maps we’d be stuck waiting for $#{$color} to be supported (which will probably never happen). Or in the case of my project, write all 20 site color classes out by hand!/p h2 dir=ltrMake it awesomer with maps/h2 p dir=ltrAstute readers might realize that I am still doing things the hard way. I created a map of colors, and then duplicated their names in a list called pre class=crayon-plain-tag$styleguide-colors/pre . We can skip that middle step and greatly simplify our code, if we are wanting to print out every single value in the map./p p/ppre class=crayon-plain-tag$site-colors: ( primary-color: #111111, secondary-color: #222222, tertiary-color: #333333, ); @each $color, $value in $site-colors { .styleguide .#{$color} { background-color: $value; amp;:after { content: “variable name is #{$color}” } } }/prepNow, instead of passing a list into the @each loop, we pass the entire map. We can do this with the following pattern: pre class=crayon-plain-tag@each $key, $value in $map/pre . Each iteration of the loop has access to both the key pre class=crayon-plain-tagprimary-color/pre  AND the value pre class=crayon-plain-tag#111111/pre , so we don’t even need the map-get function./p pThe ability to #8216;call variables with variables’ is incredibly useful for creating these programmatic classes, and is a foundational process upon which we start to build more complex systems. Be sure to check out a href=http://www.phase2technology.com/blog/exploring-maps-in-sass-3-3/?utm_source=websiteamp;utm_medium=blog%20postamp;utm_campaign=Sass%20Maps%20blog%20seriespart 1/a and a href=http://www.phase2technology.com/blog/sass-maps-memoization/?utm_source=websiteamp;utm_medium=blog%20postamp;utm_campaign=Sass%20Maps%20blog%20series2/a of my Sass Maps blog series!/p
Categories: Drupal Feeds

Gábor Hojtsy: Drupal Developer Days 2014 Organizers Report

Tue, 04/22/2014 - 11:21am
div class=field field-name-body field-type-text-with-summary field-label-hidden view-mode-rssdiv class=field-itemsdiv class=field-item evenpa href=https://docs.google.com/file/d/0B6xsrc5BVkagNVpoeEFDZy1RMVk/editimg src=http://hojtsy.hu/files/Drupal%20Developer%20Days%202014%20Organizers%20Report.png align=right style=float: right; margin: 0 0 2em 2em; //abr / The organizer team is still energized after our experience putting together a href=http://szeged2014.drupaldays.org/Drupal Dev Days Europe 2014/a in Szeged, Hungary between 24 and 30 March. /p pSeveral people asked about details and we wanted to document the event for future event organizers to share what worked best for us. a href=https://docs.google.com/file/d/0B6xsrc5BVkagNVpoeEFDZy1RMVk/editWe prepared a report/a for you so if you experienced Drupal Dev Days Szeged, you can look behind the curtain a bit, or if you heard about it, you can see what we did to pull off an event like this. If you were not there and did not hear about it, we included several feedback references as well to give you an idea./p pDo you want to see tweets and articles like those about your event? Read the report for our tips! /p pWe definitely did not do everything right but we hope we can help people learn from the things we did right./p pExcuse us if the report is a bit too long, we attempted to pack useful information to every single sentence to make reading it worth your time. a href=http://szeged2014.drupaldays.org/contactSend questions and comments to the team/a./p /div/div/div
Categories: Drupal Feeds

Acquia: I’m Kris Vanderwater, Drupal Developer and Acquia’s Developer Evangelist.

Tue, 04/22/2014 - 10:01am
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 evenpI’ve been working at Acquia for a little over two weeks now. The experience has been one I would characterize as “whirlwind” in nature. If you ask new Acquians about their on-boarding experience, the most common comparison is the age old “Drinking from a firehose” analogy. I honestly expected, as someone who already knew Drupal, that this might in some way lessen the stream of information to manageable levels. I was wrong. If anything the fire hose is a bit like sticking your toes into the shallow end of the pool, and knowing Drupal already was like “Oh you know how to swim?/p/div /div /div span property=dc:title content=I’m Kris Vanderwater, Drupal Developer and Acquia’s Developer Evangelist. class=rdf-meta/span
Categories: Drupal Feeds

Frederick Giasson: Configuring and Using OSF Ontology (Screencast)

Tue, 04/22/2014 - 8:47am
span class=Z3988 title=ctx_ver=Z39.88-2004amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adcamp;rfr_id=info%3Asid%2Focoins.info%3Ageneratoramp;rft.title=Configuring and Using OSF Ontology (Screencast)amp;rft.aulast=Giassonamp;rft.aufirst=Frederickamp;rft.subject=Open Semantic Frameworkamp;rft.subject=OSF Academyamp;rft.subject=OSF for Drupalamp;rft.subject=Planet Drupalamp;rft.subject=Structured Dynamicsamp;rft.source=Frederick Giasson#8217;s Weblogamp;rft.date=2014-04-22amp;rft.type=blogPostamp;rft.format=textamp;rft.identifier=http://fgiasson.com/blog/index.php/2014/04/22/configuring-and-using-osf-ontology-screencast/amp;rft.language=English/span pThis screencast will quickly introduce you to ontologies, and will explain you what are their rules in the a href=http://opensemanticframework.orgOpen Semantic Framework/a (OSF)./p pYou will see how you can manage ontologies in OSF using the a href=https://drupal.org/project/osfOSF for Drupal/a web interface. You will be able to a href=http://wiki.opensemanticframework.org/index.php/Category:OSF_for_Drupal_User_Manual#Import_Optionimport/a, a href=http://wiki.opensemanticframework.org/index.php/Category:OSF_for_Drupal_User_Manual#Create_Optioncreate/a, update, a href=http://wiki.opensemanticframework.org/index.php/Category:OSF_for_Drupal_User_Manual#Delete_Optiondelete/a and a href=http://wiki.opensemanticframework.org/index.php/Category:OSF_for_Drupal_User_Manual#Export_Optionexport/a ontologies. You will see how you can a href=http://wiki.opensemanticframework.org/index.php/Category:OSF_for_Drupal_User_Manual#Searchingsearch/a within imported ontologies, how you can manage their permissions./p pFinally you will see how you can manage the ontologies themselves: how you can create, update and delete a href=http://wiki.opensemanticframework.org/index.php/Category:OSF_for_Drupal_User_Manual#Classes_Tabclasses/a, a href=http://wiki.opensemanticframework.org/index.php/Category:OSF_for_Drupal_User_Manual#Properties_Tabproperties/a and a href=http://wiki.opensemanticframework.org/index.php/Category:OSF_for_Drupal_User_Manual#Individuals_Tabnamed individuals/a using the Web user interface./p pcenterbr / a href=https://www.youtube.com/watch?v=3qQdC7cnIDwdiv style=margin:10px;overflow:hidden;display:table;line-height:0;text-align:center;width:400px; class=aligncenterimg class=shadow_curl wp-image-2403 size-full src=http://fgiasson.com/blog/wp-content/uploads/2014/04/tut_10_blog_400.png alt=tut_10_blog_400 width=400 height=244 style=padding:0 !important; margin:0 !important; max-width:100% !important;br/img src=http://fgiasson.com/blog/wp-content/plugins/shadows/shadow_curl.png class=shadow_img style=margin:0 !important;height:10px;width:100%;/div/a/center/p
Categories: Drupal Feeds

Vasily Yaremchuk: Don't forget to check BackupMigrate settings after D6 to D7 upgrade!

Tue, 04/22/2014 - 6:41am
!-- google_ad_section_start --div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpSeveral days ago we upgraded simple Drupal 6 site to Drupal 7. After core upgrade process was finished we turned on all necessary modules such as Admin menu and Backup amp; Migrate./p pSome features required custom update by scripts and some manual work, we made backup before this activity.br / ... something went wrong and we go back by restoring DB via Backupamp;Migrate module and site wend down :-( /p pWhen we took a look on DB backup script we found that there was empty dump with the structure of some tables.br / So as a result the data in several tables was killed./p pWhen we repeated upgrade process again and took a look on Backupamp;Migrate advanced settings we were shocked/p p img src=/sites/default/files/bm.png alt=incorrect table exclude settings title=incorrect table exclude settings //p pBy some reason all tables was excluded from backup. /p pAfter we align Bamp;M settings backup became works correctly :-)/p pThe main idea of this post due to automatic upgrade process you should double check settings of contributed modules, upgrade can make them different according initial state. /p pAnd, of course, backups is necessary part of site development activity but you should be sure that your backups correct. /p /div/div/div!-- google_ad_section_end --div class=field field-name-taxonomy-wp-blog-tags field-type-taxonomy-term-reference field-label-above clearfixh3 class=field-labelBlog tags: /h3ul class=linksli class=taxonomy-term-reference-0a href=/blog-tags/planet-drupalPlanet Drupal/a/lili class=taxonomy-term-reference-1a href=/blog-tags/drupal-faqDrupal FAQ/a/li/ul/div
Categories: Drupal Feeds

Open Source Training: Personalized Content Feeds in Drupal

Tue, 04/22/2014 - 5:02am
pOne of our members wanted to allow users to create customized information feeds in Drupal./p pIn this tutorial, we'll show you how to do that./p pWe'll show you how to allow users to choose only certain types of content to show. This could be useful for news sites, but also for many other types of site where users want personalized content./p pIn this example, we're going to create a list of movies that will only show genres that the user chooses./pimg src=http://feeds.feedburner.com/~r/ostrainingdrupal/~4/LmKH4uQDPJ0 height=1 width=1/
Categories: Drupal Feeds

blog.studio.gd: Create automatic URL alias in drupal

Tue, 04/22/2014 - 3:22am
p class=headerEvery time you create a site with drupal you may add a new contextual tab for a node or for a user. if you have used pathauto to create automatic (multilangual) aliasing of user and node url, so on, you got good urls for SEO ! But your custom module urls must also be optimised for search engines./p pFor the example we create a node type called article, and we add a two custom url : Poll and Photos./p pre class=brush:php; /** * Implements hook_menu(). */ function module_name_menu() { $items = array(); $items['node/%node/poll'] = array( 'title' = 'Poll', 'page callback' = 'module_name_poll_page_view', 'page arguments' = array(1, 2), 'access callback' = 'node_access', 'access arguments' = array('view', 1), 'type' = MENU_LOCAL_TASK, ); $items['node/%node/photos'] = array( 'title' = 'Photos', 'page callback' = 'module_name_photos_page_view', 'page arguments' = array(1, 2), 'access callback' = 'node_access', 'access arguments' = array('view', 1), 'type' = MENU_LOCAL_TASK, ); return $items; } /pre pWith pathauto enabled, we have a customisable, translatable pattern url for the node page :br stronghttp://example.com/node/245/strongbr that becamebr stronghttp://example.com/content/article-title/strong/p pBUT/p pstronghttp://example.com/node/245/poll and http://example.com/node/245/photos/strongbr staybr stronghttp://example.com/node/245/poll and http://example.com/node/245/photos/strongbr /p pTo fix that issue you can implement the pathauto api to create custom URL patterns :/p pre class=brush:php; /** * Implements hook_pathauto(). */ function module_name_pathauto($op) { switch ($op) { case 'settings': $settings = array(); $settings['module'] = 'module_name'; $settings['token_type'] = 'node'; $settings['groupheader'] = t('Module_name node paths'); $settings['patterndescr'] = t('Default pattern'); $settings['patterndefault'] = ''; $settings['batch_update_callback'] = 'module_name_pathauto_bulkupdate'; $path = array( 'module_name_node_poll' = 'Module_name poll path', 'module_name_node_photos' = 'Module_name photos path', ); $langs = array_keys(language_list()); foreach ($path as $k = $p) { foreach ($langs as $lang) { $path[$k . '_' . $lang] = $p . ' for language ' . $lang; } unset($path[$k]); } $settings['patternitems'] = $path; return (object) $settings; } } /pre pThe custom pattern are done. a href=http://drupalcontrib.org/api/drupal/contributions!pathauto!pathauto.api.php/function/implementations/hook_pathauto/7 target=_blankMore example for the implementation of this hook/a/p pWhen a new node is created, updated or deleted the alias must be updated or deleted, to do that we use the hook provided by drupal :/p pre class=brush:php; /** * Implements hook_node_insert(). */ function module_name_node_insert($node) { module_name_create_alias($node, 'insert'); } /** * Implements hook_node_update(). */ function module_name_node_update($node) { module_name_create_alias($node, 'update'); } /** * Implements hook_node_delete(). */ function module_name_node_delete($node) { module_load_include('inc', 'pathauto'); pathauto_path_delete_all('node/' . $node-nid . '/poll'); pathauto_path_delete_all('node/' . $node-nid . '/photos'); } /** * Module_name create alias for a node custom urls. */ function module_name_create_alias($node, $op) { $langs = array_keys(language_list()); module_load_include('inc', 'pathauto'); foreach ($langs as $lang) { pathauto_create_alias('module_name', $op, 'node/' . $node-nid . '/poll' , array('node' = $node), 'module_name_node_poll_' . $lang, $lang); pathauto_create_alias('module_name', $op, 'node/' . $node-nid . '/photos' , array('node' = $node), 'module_name_node_photos_' . $lang, $lang); } } /pre pTo generate/update your urls alias with the bulk update interface or with drush there is callback defined in the hook_pathauto : batch_update_callback :/p pre class=brush:php; /** * Implements hook_pathauto_bulkupdate. */ function module_name_pathauto_bulkupdate() { if (!isset($context['sandbox']['current'])) { $context['sandbox']['count'] = 0; $context['sandbox']['current'] = 0; } $query = db_select('node', 'n'); $query-addField('n', 'nid'); $query-leftJoin('url_alias', 'ua', ua.source LIKE CONCAT('node/', n.nid, '/%')); $query-isNull('ua.source'); $query-condition('n.nid', $context['sandbox']['current'], ''); $query-orderBy('n.nid'); $query-addTag('pathauto_bulk_update'); $query-addMetaData('entity', 'node'); // Get the total amount of items to process. if (!isset($context['sandbox']['total'])) { $context['sandbox']['total'] = $query-countQuery()-execute()-fetchField(); // If there are no nodes to update, the stop immediately. if (!$context['sandbox']['total']) { $context['finished'] = 1; return; } } $query-range(0, 25); $nids = $query-execute()-fetchCol(); $nodes = node_load_multiple($nids); foreach ($nodes as $node) { module_name_create_alias($node, 'bulkupdate'); } $context['sandbox']['count'] += count($nids); $context['sandbox']['current'] = max($nids); $context['message'] = t('Updated alias for node @nid.', array('@nid' = end($nids))); if ($context['sandbox']['count'] != $context['sandbox']['total']) { $context['finished'] = $context['sandbox']['count'] / $context['sandbox']['total']; } } /pre pThe code is over, you can fill the pattern in your site administration : admin/config/search/path/patternsbr strongLet the default pattern blank and fill for each language and tabs the good patterns, example : content/[node:title]/poll/strong/p
Categories: Drupal Feeds

DrupalCon Amsterdam: Hallo from Amsterdam!

Tue, 04/22/2014 - 1:10am
div class=field field--name-body field--type-text-with-summary field--label-hiddendiv class=field__itemsdiv class=field__item eveniframe width=350 height=240 src=//w2.countingdownto.com/510779 frameborder=0/iframep DrupalCon Amsterdam is coming soon, and I can’t wait to welcome the Drupal community to this wonderful city. The conference is shaping up to be an absolutely incredible experience./p pThe local Dutch Drupal community has been hard at work coming up with a huge number of fun and cultural activities. From the a href=http://tourdedrupal.drupalgardens.com/Tour de Drupal/a bike ride from London to Amsterdam, to the Drupal bar crawl up and down the canals; DrupalCon Amsterdam is going to be a great place to learn more about Drupal, celebrate the community, and have a fantastic time./p pMake sure you buy your ticket and a href=https://www.rai-hotelservice.com/compass/external/index.cfm?meeting_ID=1887amp;Meeting_ID_Code=883368083amp;utm_medium=amp;utm_source=amp;utm_campaign=reserve your hotel room as soon as possible/a, so you can get the best prices. In the coming weeks, we’ll be rolling out more information about the convention, sponsorship opportunities, and more./p pThe website is now live, so get your tickets a href=https://amsterdam2014.drupal.org/ticketshere/a!/p p--br / Baris Wanschersbr / Chairman, a href=http://stichtingdrupal.nl/Stitching Drupal Nederland/a/p /div/div/div
Categories: Drupal Feeds

Károly Négyesi: The Simpletest sprint six years ago

Tue, 04/22/2014 - 12:14am
pAs the Simpletest sprint in Paris was exactly six years ago I feel it's a good time to remind the community how and why Simpletest was chosen especially in the light of the Simpletest hate lately. At that time we had almost no tests (compared to the massive test battery today with over 68 000 asserts) and it was paramount to allow emanyone/em to be able to write and run tests. Drupal in 2008 was not really API driven and so we needed browser based testing. Selenium at this time (Selenium 2 / WebDriver was released in 2011) required a standalone Java program to drive a browser -- we didn't quite feel being a Java-on-your-desktop helpdesk. So Selenium was out. PHPUnit offered a big fat nothing for Drupal -- Rok and I actually printed the source code out and read the whole thing at Boston DrupalCon and found nothing useful in there. Mind you, it was a very young project at that time. Behat? Mink? In 2008? Come on, Cucumber itself didn't appear until 2008 fall. So. In 2014 it is easy to say there are better and/or faster alternatives but those weren't there in 2008. Also, it's the massive refactoring in Drupal 8 that made it possible to use PHPUnit -- but guess what made the refactoring possible./p
Categories: Drupal Feeds