Drupal Planet

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

Valuebound: Drupal 8: How to create a custom block programatically

Mon, 12/19/2016 - 2:33am
span property=schema:name data-quickedit-field-id=node/212/title/en/rss class=field field--name-title field--type-string field--label-hiddenDrupal 8: How to create a custom block programatically/span span data-quickedit-field-id=node/212/uid/en/rss rel=schema:author class=field field--name-uid field--type-entity-reference field--label-hiddena title=View user profile. href=/user/9 lang= about=/user/9 typeof=schema:Person property=schema:name datatype= class=usernameJaywant.Topno/a/span span property=schema:dateCreated content=2016-12-19T07:33:52+00:00 data-quickedit-field-id=node/212/created/en/rss class=field field--name-created field--type-created field--label-hiddenMon, 12/19/2016 - 02:33/span
Categories: Drupal Feeds

Valuebound: Drupal 8: Custom Block Creation programmatically

Mon, 12/19/2016 - 2:33am
span property=schema:name data-quickedit-field-id=node/211/title/en/rss class=field field--name-title field--type-string field--label-hiddenDrupal 8: Custom Block Creation programmatically /span span data-quickedit-field-id=node/211/uid/en/rss rel=schema:author class=field field--name-uid field--type-entity-reference field--label-hiddena title=View user profile. href=/user/9 lang= about=/user/9 typeof=schema:Person property=schema:name datatype= class=usernameJaywant.Topno/a/span span property=schema:dateCreated content=2016-12-19T07:33:52+00:00 data-quickedit-field-id=node/211/created/en/rss class=field field--name-created field--type-created field--label-hiddenMon, 12/19/2016 - 02:33/span
Categories: Drupal Feeds

PreviousNext: Why project managers need to lose control

Tue, 09/27/2016 - 8:39pm
pBeing accountable for the planning, execution, and delivery of a project is demanding. Managing people, facilitating communication, resolving conflict, and mitigating risk are prerequisites to completing on schedule, and within an agreed budget. Add to this the often unpredictable nature of these factors and it's little wonder that project managers feel a great burden of responsibility./p span property=dc:title content=Why project managers need to lose control class=rdf-meta element-hidden/span
Categories: Drupal Feeds

KnackForge: Drupal form's #tree option

Tue, 09/27/2016 - 12:08pm
div class=blog_posts-item itemprop=blogPost itemscope=itemscope itemtype=http://schema.org/BlogPosting article class=post is-excerpt post_excerptdiv class=post-row post_excerpt_cover-wrapper div class=post_cover is-excerpt post_excerpt_cover img src=https://knackforge.com/themes/custom/knackforge_d8_v1/img/blog-header.jpg alt=knackforge blog class=post_cover-image post-cover-image-default /span class=post_excerpt_cover-content span class=post_avatar itemprop=image article typeof=schema:Person about=https://knackforge.com/vannia class=profilediv class=field field--name-user-picture field--type-image field--label-hidden field__item a href=https://knackforge.com/vanniaimg src=https://knackforge.com/sites/default/files/styles/thumbnail/public/pictures/picture-5-1437977585.jpg?itok=secROf9E width=100 height=100 alt=Profile picture for user vannia typeof=foaf:Image class=image-style-thumbnail //a /div /article/spanspan class=post_cover-info/span /span span class=post_excerpt_cover-triangle/span /div /div div class=post-row has-padding has-no_bottom_padding h2 class=post-title itemprop=name headlinea href=https://knackforge.com/blog/vannia/drupal-forms-tree-optionspan class=field field--name-title field--type-string field--label-hiddenDrupal form's #tree option/span /a/h2 div class=post_meta div class=post_meta-author itemprop=author itemscope= itemtype=http://schema.org/Person pby strongspan class=kf-blue itemprop=name span class=field field--name-uid field--type-entity-reference field--label-hiddena title=View blogs by vannia. href=https://knackforge.com/blog/vannia lang= about=https://knackforge.com/vannia typeof=schema:Person property=schema:name datatype= itemprop=url rel=author class=username xml:lang=vannia/a/span /span/strong - time itemprop=datePublished Sep 27, 2016 span class=comment_counti class=fa fa-comments/i 0 Comments /span /time/p /div /div /div div class=post-row post-tags list-inline itemprop=tags div class=field field--name-field-blog-tag field--type-entity-reference field--label-above div class=field__labelTag(s)/div div class=field__items div class=field__itema href=https://knackforge.com/tags/form-api hreflang=enForm API/a/div div class=field__itema href=https://knackforge.com/tags/drupal-planet hreflang=enDrupal planet/a/div /div /div /div div class=kf-clear-both/div article class=post_excerpt_contentdiv class=content_body is-small itemprop=articleBody p /pdiv class=clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__itempThere may be a need to name the form elements in an array structure how the form is built. You can see this in Ubercart checkout pane form's input elements. This is very useful when one has a large multi-part form which can be grouped easily by their POST content's array format./p pre Eg: panes[delivery][delivery_first_name]/pre pA simple flag on you $form construct array will do the trick. It's the #tree option. For whichever elements you set this #tree option, the element's children will be named with full reference to its parents./p/div a href=https://knackforge.com/blog/vannia/drupal-forms-tree-option class=continue-reading kf-blueContinue reading →/a /div /article/article/div
Categories: Drupal Feeds

Nuvole: Configuration Management: Theory and Practice

Tue, 09/27/2016 - 11:23am
div class=field field-name-field-blog-subtitle field-type-text-long field-label-hiddendiv class=field-itemsdiv class=field-item evenOur presentation at DrupalCon Dublin 2016/div/div/divdiv class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpDevelopers often want to use Configuration Management outside its intended use case. New workflows and practices have to be established./p pWe've just presented a gallery of problems and solutions at DrupalCon Dublin 2016./p pThe room was packed, and many people were denied admission for security reasons. For them, and for those who didn't manage to come to this DrupalCon, we are making the full presentation available here:/p ullia href=http://nuvole.org/sites/default/files/Configuration-Management-Theory-and-Practice.pdfPDF slides/a for download/li lia href=https://www.youtube.com/watch?v=57t_CS2wbHIFull video of the presentation/a/li /uldiv align=center iframe width=640 height=360 src=https://www.youtube.com/embed/57t_CS2wbHI frameborder=0 allowfullscreen=/iframe /div /div/div/divdiv class=field field-name-field-blog-tags field-type-taxonomy-term-reference field-label-inline clearfixdiv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item evenDrupal Planet/divdiv class=field-item oddDrupal 8/divdiv class=field-item evenDrupalCon/div/div/divdiv class=field field-name-field-blog-attachments field-type-file field-label-abovediv class=field-labelAttachments:nbsp;/divdiv class=field-itemsdiv class=field-item evenspan class=fileimg class=file-icon alt= title=application/pdf src=/modules/file/icons/application-pdf.png / a href=http://nuvole.org/sites/default/files/Configuration-Management-Theory-and-Practice.pdf type=application/pdf; length=2530235Configuration-Management-Theory-and-Practice.pdf/a/span/div/div/div
Categories: Drupal Feeds

Chromatic: Drupal Code Standards: The t() Function

Tue, 09/27/2016 - 9:16am
pThis is the fifth post in a series about coding standards. In this post we’ll talk about how to use translation functions in both Drupal 7 and 8. This is so essential that it deserves its own post!/p pOther posts in this series:/p ollia href=https://chromatichq.com/blog/code-standards-what-are-theyDrupal Code Standards: What Are They?/a/li lia href=https://chromatichq.com/blog/code-standards-how-do-we-implement-themDrupal Code Standards: How Do We Implement Them?/a/li lia href=https://chromatichq.com/blog/code-standards-formattingDrupal Code Standards: Formatting/a/li lia href=https://chromatichq.com/blog/code-standards-documentationDrupal Code Standards: Documentation/a/li lia href=https://chromatichq.com/blog/drupal-code-standards-t-functionDrupal Code Standards: The t() function/a/li liDrupal Code Standards: Object Oriented Coding Drupal 8/li liDrupal Code Standards: Twig in Drupal 8/li /olh3What is the t() function?/h3 pThe codet()/code function allows for localization and translates a given string to a given language at run-time. When coding, you wrap your user-facing strings in this function so that they can be translated./p h3When do I use it?/h3 pIn just about every user-facing string. This ensures that your site can be localized! When in doubt, translate everything. You might be thinking oh, this string will never need to be translated, but 2 years later, when you’re trying to find this string that’s showing up untranslated on the site, and your shareholders want it changed, you’ll be much happier if it’s already ready to translate. I may be speaking from a href=https://chromatichq.com/blog/theatermania-lessons-learned-localizationexperience/a here./p h3What does it do?/h3 pFirstly, codet()/code translates text at runtime if you have more than one language enabled. Depending on which placeholder you use, it runs different sanitization functions./p pThe t() function takes 3 parameters, 2 of which are optional. The first is the string to be translated, the second is the array of replacements, if any. The third is an array of options. From Drupal.org:/p blockquote p$options: An associative array of additional options, with the following elements: * 'langcode' (defaults to the current language): The language code to translate to a language other than what is used to display the page. * 'context' (defaults to the empty context): A string giving the context that the source string belongs to./p /blockquote pString context (or translation context) is a way to organize translations when words have 1 to many translations. From the handbook page:/p blockquote pstrongWhat is string context?/strong/p pWhen translating Drupal’s user interface to other languages, each original (English) string can have only one translation. This is a problem when one English word has several meanings, like Order, which can mean the order of elements in a list, to order something in a shop, or an order someone has placed in a shop. For many languages, the string Order needs a different translation for each of these meanings./p /blockquote pYou can read more about string context a href=https://www.drupal.org/node/1369936here/a./p h3Using Placeholders/h3 pPlaceholders come from the a href=https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/format_string/7.xcodeformat_string/code function/a, which is called by codet()/code./p pThe most common placeholder is probably code@variable/code. This placeholder runs a href=https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/check_plain/7.xcodecheck_plain()/code/a on the text before replacing it. Never pass a variable through codet()/code directly - only string literals. The short explanation for this is that the string to be translated needs to be available at runtime, and a variable may not be available and may change its value. You can find an in-depth explanation a href=http://drupal.stackexchange.com/questions/9362/is-it-always-bad-to-pass-a-variable-through-there/a./p pYou use a placeholder to insert a value into the translated text, like in this example from the a href=https://www.drupal.org/project/advanced_forumAdvanced Forum contrib module/a:/p precode$block-title = t( 'Most active poster in @forum', array('@forum' = $forum-name) ); /code/pre pYou may also use code%variable/code, which runs a href=https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/drupal_placeholder/7.xcodedrupal_placeholder()/code/a on the text, which both escapes the text and formats it as emphasized text./p pIn Drupal 7, code!variable/code inserts your value exactly as is, without running any sanitization functions, so you would never want to use this on user-entered text, and only on text that has already been properly escaped./p pIn Drupal 8, code!variable/code is deprecated, replaced by code:variable/code./p pIn Drupal 8, code:variable/code is escaped with a href=https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Utility%21Html.php/function/Html%3A%3Aescape/8.2.xcode\Drupal\Component\Utility\Html::escape()/code/a and filtered for dangerous protocols using a href=https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Utility%21UrlHelper.php/function/UrlHelper%3A%3AstripDangerousProtocols/8.2.xcodeUrlHelper::stripDangerousProtocols()/code/a./p pSo now you might be wondering what to do in Drupal 8 if you do not want to escape your text at all, now that the code!variable/code placeholder is gone. There is a way! In the a href=https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Render%21FormattableMarkup.php/function/FormattableMarkup%3A%3AplaceholderFormat/8.2.xcodeplaceholderFormat()/code/a function, there’s a default case. Let’s take a look at the code:/p precodedefault: // We do not trigger an error for placeholder that start with an // alphabetic character. if (!ctype_alpha($key[0])) { // We trigger an error as we may want to introduce new placeholders // in the future without breaking backward compatibility. trigger_error('Invalid placeholder (' . $key . ') in string: ' . $string, E_USER_ERROR); } break; } /code/pre pSo if we use a placeholder that starts with an alphabetic character, it won’t trigger an error, but it also won’t trigger any actions. You can use any alphabetic character(s) you like for your dummy placeholder. Something easily identifiable, like codeTT/code is a good idea - and comment your code!/p h3When don’t I use it?/h3 pIn Drupal 7, there are some instances where codet()/code is not available./p pDuring the installation phase, codet()/code isn’t available, so you must use a href=https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/get_t/7.xcodeget_t()/code/a. You can do something like this:/p precode$t = get_t(); $t(‘my string’); /code/pre pTranslation is also not used inside of codehook_schema()/code or codehook_menu()/code./p pIn Drupal 8, a href=https://www.drupal.org/node/2021435codet()/code is always available/a, so you can always use it./p h3t() and links/h3 pThere are a lot of times that you may want to translate the text in a link - there are lots of ways to do this, and most of them aren’t the best. Here are some bad examples, and a good (and simple!) one./p pBad:/p pre code class=code-smell $do_not_do_this = t('Do not ').a href=https://api.drupal.org . t('link ') . /a .t('to something like this.'); /code /pre pre code class=code-smell $bad = t('This is not a good way to make a @link.', array('@link' = 'a href=https://api.drupal.org'. t('link') .'/a')); /code /pre pre code class=code-smell $dreadful = t('This is a dreadful way to make a link pointing to the a href=https://api.drupal.orgDrupal API t() documentation/a.'); /code /pre pre code class=code-smell $awful = t('This may seem good, but it’s an awful way to link to this @doc.', array('@doc = l(t(‘documentation'), 'https://api.drupal.org')); /code /pre pGood:/p precode$good = t('Read about the t() function a href=@apihere/a.', array('@api' = 'https://api.drupal.org')); /code/pre pHere’s an example from Drupal 8 Core, in the function a href=https://api.drupal.org/api/drupal/core%21includes%21install.core.inc/function/install_check_translations/8.2.xcodeinstall_check_translations()/code/a in codeinstall.core.inc/code:/p precode// If the translations directory is not readable, throw an error. if (!$readable) { $requirements['translations directory readable'] = array( 'title' = t('Translations directory'), 'value' = t('The translations directory is not readable.'), 'severity' = REQUIREMENT_ERROR, 'description' = t('The installer requires read permissions to %translations_directory at all times. The a href=:handbook_urlwebhosting issues/a documentation section offers help on this and other topics.', array('%translations_directory' = $translations_directory, ':handbook_url' = 'https://www.drupal.org/server-permissions')), ); } /code/pre pIn this code you can see that the codea href/code tags are inside the codet()/code function, and the url is escaped using the code:variable/code placeholder./p pIt’s okay to put a little html in your t() function to simplify like this. The element can easily be moved around if the translation requires it, without needing to know any code other than which word is being linked. Our next section will talk more about keeping your text translatable./p h3Translation Best Practices/h3 pWriting your code and content to be translatable isn’t just a best practice, it may very well be used to actually translate your site, so sometimes you need to think from the point of view of a translator. Try not to abstract out pieces of content too much. Here’s an example. In English, you may have a blog title Bob’s Homepage. You could want to abstract that into the following:/p pre code class=code-smell $username . ‘s . t(‘Homepage.’); /code /pre pWhat’s the problem here? In other languages, this phrase may be re-arranged. For example, in French or Spanish, it would be Homepage de Bob. The above example would require a translator to change code. We don’t want that. So we write this:/p precodet(‘@user’s Homepage.’, array(‘@username’ = ‘Bob’)); /code/pre pNow, this string can easily be changed to:/p precodet(‘Homepage de @user.’, array(‘@username’ = ‘Bob’)); /code/pre h3Concatenation Dos and Don’ts/h3 pIn the example in the previous section, we showed where concatenating a translated string with another string can make trouble. There are some other things you want to avoid./p pDon’t concatenate strings within codet()/code. For example, don’t do this:/p pre code class=code-smell t(‘Don’t try to join’ . ‘ ‘ . @num . ‘ ‘ . ‘strings.’, array(‘@num’ = ‘multiple’)); /code /pre pEven if you think you have to, there is a better way./p pAnd don’t concatenate codet()/code strings and variables - you don’t need to!/p pDon’t do this:/p pre code class=code-smell t(‘This is a complicated way to join ’) . $mystring . t(‘ and translated strings’); /code /pre pAdditionally, the above would give you a codesniffer error because you should not have leading or trailing whitespace in a translatable string./p pDo this:/p precodet(‘This is a simple way to join @mystring and translated strings’, array(‘@mystring’ = ‘whatever my string is’)); /code/pre pThis is how the codet()/code function is designed to be used! Going around it defeats the purpose of using it at all./p h3Drupal 8 Twig/h3 pIn Drupal 8, the essential function and its use are the same. Wrap text in your module code in codet(‘’)/code, with the same optional placeholder and options arrays. As noted in the placeholders section, code!variable/code has been deprecated and replaced with code:variable/code./p pWith Drupal 8, we have the introduction of the Twig templating engine, and with that, new ways format our text for translation./p pThe simplest way is to pipe your text through code|t/code. Here’s an example from the a href=https://www.drupal.org/project/develDevel contrib module/a:/p precodethead tr th{{ 'Name'|t }}/th th{{ 'Path'|t }}/th th{{ 'Info file'|t }}/th /tr /thead /code/pre pIn the above code, we can see the text in the table headers piped into the translation function, just as it would be passed through codet()/code in Drupal 7. You can also use code|trans/code interchangeably with code|t/code. You can use a code{% trans %}/code block to translate a larger chunk of text or use placeholders. These blocks can also handle logic for plurals. Here’s an example from Drupal 8 Core:/p precodeh3 class=views-ui-view-title data-drupal-selector=views-table-filter-text-source{{ view.label }}/h3 div class=views-ui-view-displays {% if displays %} {% trans %} Display {% plural displays %} Displays {% endtrans %}: em{{ displays|safe_join(', ') }}/em {% else %} {{ 'None'|t }} {% endif %} /div /code/pre pHere we can see that the template appropriately shows the translated text for “Display” or the plural, “Displays.”/p pa href=https://www.drupal.org/developing/api/8/localizationFrom Drupal.org/a:/p blockquote pValues are escaped by default. The 'passthrough' filter can be used to skip escaping. The 'placeholder' filter can be used to form a placeholder. The default behavior is equivalent to @ in t(), while 'passthrough' matches ! and 'placeholder' matches %./p /blockquote pThis comes from Twig, and is not yet commonly used in Drupal, but its usage with placeholders is similar to codet()/code. Here’s an example from Drupal 8 Core:/p precode {% set includes = includes|join(', ') %} {% if disabled %} {{ 'Includes:'|t }} ul li {% trans %} Enabled: {{ includes|placeholder }} {% endtrans %} /li li {% set disabled = disabled|join(', ') %} {% trans %} Disabled: {{ disabled|placeholder }} {% endtrans %} /li /ul {% else %} {% trans %} Includes: {{ includes|placeholder }} {% endtrans %} {% endif %} /div /code/pre pIn the above code, we can see the use of the placeholder in Twig. The codeset/code lines set the placeholders to be used later in the code. The code|placeholder/code filter indicates that a replacement is to be made./p h3Wrapping Up/h3 pThis post has a lot of what emnot/em to do, but you’ll run into a lot of creatively incorrect code when it comes to translation, and now you’ll know it when you see it. Simple is best. Remember that this function exists to give translators a list of strings to translate, and you’ll be in the right frame of mind when assembling these strings to keep them flexible and translatable!/p pHave some questions/comments/concerns? Experience you’d like to share? Talk to us on Twitter: a href=https://twitter.com/ChromaticHQ@ChromaticHQ/a!/p pKeep an eye out for our next post in our Drupal Code Standards series, on Object Oriented programming in Drupal 8!/p
Categories: Drupal Feeds

Acquia Developer Center Blog: How to Get Behind the Great Firewall of China

Tue, 09/27/2016 - 9:10am
div class=field field-name-field-blog-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evenimg typeof=foaf:Image src=https://dev.acquia.com/sites/default/files/styles/blog__190_x110_/public/blog/china_0.jpg?itok=v6v9yLkV width=140 height=85 alt=photo of earth title=photo of earth //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:encodedpWhether you’re outside China and trying to get in, or inside China and trying to get out, a well-known barrier sits between the Chinese internal network and the wider internet. The Great Firewall of China (防火长城) acts as a giant filter between the two networks, restricting access to external sites considered unsavory by the Chinese government./p/div/div/divdiv class=field field-name-field-blog-tags field-type-taxonomy-term-reference field-label-inline clearfixdiv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/tags/acquia-drupal-planet typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=acquia drupal planet/a/div/div/div
Categories: Drupal Feeds

Attiks: Drupal and polymer

Tue, 09/27/2016 - 6:42am
div class=field field-name-titleh2a href=/blog/drupal-and-polymerDrupal and polymer/a/h2/divdiv class=field field-name-post-date27-09 2016/divdiv class=field field-name-field-authora href=/peter-droogmansPeter Droogmans/a/divdiv class=field field-name-field-intropWhat if there were polymer elements for custom Drupal functionality/p /divdiv class=field field-name-node-linka href=/blog/drupal-and-polymer class=Read more/a/divdiv class=field field-name-field-imagesa href=/blog/drupal-and-polymerimg src=https://attiks.com/sites/attiks.com/files/styles/blog_800/public/blog/drupal_polymer.png width=800 height=451 alt= //a/div
Categories: Drupal Feeds

Amazee Labs: A day at DrupalCon with Corina

Tue, 09/27/2016 - 5:21am
spanA day at DrupalCon with Corina/span div class=field field-node--field-lead field-name-field-lead field-type-text-long field-label-hidden div class=field-items div class=field-itempIt's this time of the year again. DrupalCon Dublin is finally here. Even though it's my fourth Con already, it's always a special event./p /div /div /div spana href=/en/corina-schmid title=View user profile. lang= about=/en/corina-schmid typeof=schema:Person property=schema:name datatype= class=usernameCorina Schmid/a/span spanTue, 09/27/2016 - 12:21/span div class=field field-node--field-image field-name-field-image field-type-image field-label-hidden div class=field-items div class=field-itemimg class=image-style-blog-full src=https://www.amazeelabs.com/sites/default/files/styles/blog_full/public/29647707320_0f9c184192_h.jpg?itok=s85nD92z width=580 height=387 alt= typeof=foaf:Image / /div /div /div div class=field field-node--body field-name-body field-type-text-with-summary field-label-hidden div class=field-items div class=field-itempThe conference officially only starts Tuesday but Monday for me Monday is the more important day. It's the day of setting up our booth, making sure all things arrived and in the evening there was our Amazee Story Telling Tour around Dublin. They say a picture says more than 1000 words so here are some impressions of my DrupalCon Monday:/p pimg alt=setting up data-entity-type=file data-entity-uuid=d940fea1-23ec-4d10-8a00-d116359162b4 src=https://www.amazeelabs.com/sites/default/files/inline-images/29827255492_10c2e18df6_h.jpg //p pimg alt=settin up2 data-entity-type=file data-entity-uuid=11efe6c6-d845-41a4-9c00-fc009e0afeb9 src=https://www.amazeelabs.com/sites/default/files/inline-images/29647707320_0f9c184192_h.jpg //p pimg alt=booth last steps data-entity-type=file data-entity-uuid=efff7940-30b7-44c1-8800-e839eb08da18 src=https://www.amazeelabs.com/sites/default/files/inline-images/29647701110_07788562e2_h.jpg //p pOnce the booth was set up we enjoyed the welcome reception. By the way, if you want to see the finished booth make sure you come by and meet us at the exhibit hall; we're at booth 700./p pimg alt=fhuby data-entity-type=file data-entity-uuid=943d267d-96c8-4c73-9c00-d7b405b88ddf src=https://www.amazeelabs.com/sites/default/files/inline-images/29923577076_18a9133692_h.jpg //p pimg alt=inky data-entity-type=file data-entity-uuid=ddb1b710-beb9-4723-ad00-a56db0fb2252 src=https://www.amazeelabs.com/sites/default/files/inline-images/29331130773_e852cfe40b_h.jpg //p pTo finish off the day we ventured out on our Story Telling Tour learning about Irish Tales./p pimg alt=sstt data-entity-type=file data-entity-uuid=1b12f4eb-0449-43c8-a800-e1bd55887456 src=https://www.amazeelabs.com/sites/default/files/inline-images/29331146033_9ff8ef0821_h.jpg //p pimg alt=stt data-entity-type=file data-entity-uuid=30a950fa-43e3-4a9e-b637-55dcb7ac25a3 src=https://www.amazeelabs.com/sites/default/files/inline-images/29331146073_a560e40088_h.jpg //p pimg alt=sttd data-entity-type=file data-entity-uuid=5cfc98fc-5411-40c1-b85d-935f13e4712b src=https://www.amazeelabs.com/sites/default/files/inline-images/29923594596_d202896d71_h.jpg //p pimg alt=tt data-entity-type=file data-entity-uuid=f9b71a47-ec00-4dd3-9526-38dba56f5cf3 src=https://www.amazeelabs.com/sites/default/files/inline-images/29923595496_ba5d0ded72_h.jpg //p p /p /div /div /div
Categories: Drupal Feeds

Chromatic: Chromatic at DrupalCon Dublin

Mon, 09/26/2016 - 11:06am
pIf you're going to be at a href=https://events.drupal.org/dublin2016/DrupalCon Dublin/a this week and let's be honest, if you're reading this post, you probably are...our very own Larry Walangitan (a href=https://www.drupal.org/u/walangitan@walangitan/a) will be presenting on Twig templates in Drupal 8. If you're looking to gain a thorough understanding of Twig in Drupal 8, Larry has you covered./p pFrom Larry's session page:/p blockquote pDrupal 8’s theming engine is now powered by Twig, but how do we turn over a new leaf after years spent using PHPTemplate to drive our themes? It’s time to take the plunge and discover how easy it is to start working with Twig today. Let’s put Twig under the microscope and compare what’s new and what’s stayed the same! ... You'll leave this session prepared to start working with Twig templates in Drupal 8./p /blockquote pLarry's session starts at 5pm IST tomorrow, September 27th in the Ecocem Room./p pMore on Larry's session here:/p ullia href=https://events.drupal.org/dublin2016/sessions/branch-out-your-comfort-zone-twig-templatesBranch Out Of Your Comfort Zone with Twig Templates/a/li /ul
Categories: Drupal Feeds

Morten.dk: Flatearth Drupal 8 Admin theme.

Mon, 09/26/2016 - 9:40am
article data-history-node-id=162 role=article class=teaser teaser--darka href=http://www.morten.dk/flatearth-drupal-8-admin-theme h3 class=teaser__titlespanFlatearth Drupal 8 Admin theme./span /h3 div class=teaser__content div pFlat earth is an admin theme for Drupal8, that is, colourfull, light fun.br / Its my first take on breaking down the barrier between frontend and backend themingbr /  /p /div footer class=teaser__meta 26.09.16 16:09 /footer/div figure class=teaser__imageimg src=http://www.morten.dk/sites/default/files/styles/w_4/public/images/2016-09/Luftballon_toaster_001.jpg?itok=jeRr6w-F width=600 height=434 alt= class=image-style-w-4 //figure/a /article
Categories: Drupal Feeds

The Sego Blog: Drupal 8.2 Release October 5th!

Mon, 09/26/2016 - 8:42am
div class=field field-name-post-date field-type-ds field-label-hiddendiv class=field-itemsdiv class=field-item even09/26/2016/div/div/divdiv class=field field-name-title field-type-ds field-label-hiddendiv class=field-itemsdiv class=field-item even property=dc:titleh2a href=/node/62Drupal 8.2 Release October 5th!/a/h2/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:encodedpEarlier this month Acquia put on a great webinar hosted by a href=https://www.drupal.org/u/webchick target=_blankAngie Byron/a amp; a href=https://www.drupal.org/u/g%C3%A1bor-hojtsy target=_blankGabor Hojtsy/a titled All You Need to Know About Drupal 8.2 and Beyond (slides linked below)./p pThere were many topics covered and I could not help but get super excited for some things we can look forward to in the upcoming release of Drupal 8.2 slated for October 5th 2016./p p/div/div/divdiv class=field field-name-ds-user-picture field-type-ds field-label-hiddendiv class=field-itemsdiv class=field-item evenimg typeof=foaf:Image src=http://www.segosolutions.com/sites/default/files/styles/thumbnail/public/pictures/picture-12-1443827127.png?itok=7YBAiqkp alt=Mike#039;s picture title=Mike#039;s picture //div/div/div
Categories: Drupal Feeds

Faichi.com: Faichi at DrupalCon Dublin

Mon, 09/26/2016 - 6:55am
Categories: Drupal Feeds

myDropWizard.com: How to QUICKLY and SAFELY deploy to the live site WITHOUT comprehensive testing!

Mon, 09/26/2016 - 6:41am
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpOn the one hand, you want to deploy changes to the live site QUICKLY (for, say, a Highly Critical security update)./ppOn the other hand, you want make changes SAFELY, ie. you don't want it to break the site./ppTesting is good. Automated testing is great./ppstrongBut what if you simply didn't have the resources to comprehensively test the change (either manually or automatically)?/strong/ppMaybe the client isn't willing to fund a project to write automated tests. Maybe you don't have the extra time or extra people to do proper QA. Whatever reason, you just couldn't do it./ppstrongIs it possible to both span style=text-decoration:underlinequickly/span AND span style=text-decoration:underlinesafely/span deploy to the live site WITHOUT comprehensive testing?/strong/pp... besides just crossing your fingures and hoping it doesn't break?/ppWe think there is a way. :-) Read more to found out!/pp/div/div/div
Categories: Drupal Feeds

Annertech: At DrupalCon? Need Help? We'll Take Care of You.

Mon, 09/26/2016 - 5:59am
span class=field field-node--title field-name-title field-type-string field-label-hiddenAt DrupalCon? Need Help? We#039;ll Take Care of You./span div class=field field-node--body field-name-body field-type-text-with-summary field-label-hidden div class=field-items div class=field-itempWith over 2,000 people expected to be in Dublin for DrupalCon this week, it's likely that someone, somewhere is going to need some assistance. We're all very helpful people in the Drupal community and so help should easily be available. But sometimes you get caught out and can't find people nearby - you get lost, you lose your phone, you're in an area of town and haven't a clue how to get back to your home, you are locked out of your AirBnB, you've gone to kiss the Blarney Stone not realising it was 350km away!/p/div /div /div
Categories: Drupal Feeds

qed42.com: Lazy Builders in Drupal 8 - Caching FTW

Mon, 09/26/2016 - 3:36am
span property=schema:name class=field field--name-title field--type-string field--label-hiddenLazy Builders in Drupal 8 - Caching FTW/span div class=clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above div class=field__labelBody/div div property=schema:text class=field__itempDrupal caching layer has become more advanced with the advent of a href=https://www.drupal.org/developing/api/8/cache/tagscache tags/a amp; a href=https://www.drupal.org/developing/api/8/cache/contextscontexts/a in Drupal 8. In Drupal 7, the core din't offer many options to cache content for authenticated users. Reverse proxies like Varnish, Nginx etc. could only benefit the anonymous users.  Good news is Drupal 8 handle many painful caching scenarios ground up and have given developers / site builders array of options, making Drupal 8 first class option for all sort of performance requirements.  /p pLets look at the criteria for an un-cacheable content:/p ulliContent that would have a very high cardinality e.g, a block that needs to display user info/li liBlocks that need to display content with a very high invalidation rate. e.g, a block displaying current timestamp/li /ulpIn both of the cases above, we would have a mix of dynamic amp; static content. For simplicity consider a block rendering current timestamp like The current timestamp is 1421318815. This rendered content consists of 2 parts:/p ullistatic/cacheable: The current timestamp is/li liDynamic: 1421318815/li /ulpDrupal 8 rendering amp; caching system provides us with a way to cache static part of the block, leaving out the dynamic one to be uncached. It does so by using the concept of lazy builders. Lazy builders as the name suggests is very similar what a lazy loader does in Javascript. Lazy builders are replaced with unique placeholders to be processed later once the processing is complete for cached content. So, at any point in rendering, we can have n cached content + m placeholders. Once the processing for cached content is complete, Drupal 8 uses its render strategy(single flush) to process all the placeholders amp; replace them with actual content(fetching dynamic data). The placeholders can also be leveraged by the experimental module a href=https://www.drupal.org/project/big_pipebigpipe/a to render the cached data amp; present it to the user, while keep processing placeholders in the background. These placeholders as processed, the result is injected into the HTML DOM via embedded AJAX requests./p pLets see how lazy builders actually work in Drupal 8. Taking the above example, I've create a simple module called as timestamp_generator. This module is responsible for providing a block that renders the text The current timestamp is {{current_timestamp}}./p pre code class=language-phplt;?php /** * @file * Contains \Drupal\timestamp_generator\Plugin\Block\Timestamp. */ namespace Drupal\timestamp_generator\Plugin\Block; use Drupal\Core\Block\BlockBase; /** * Provides a 'Timestamp' block. * * @Block( * id = timestamp, * admin_label = @Translation(Timestamp), * ) */ class Timestamp extends BlockBase { /** * {@inheritdoc} */ public function build() { $build = []; $user = \Drupal::currentUser()-gt;getAccount(); $build['timestamp'] = array( '#lazy_builder' =gt; ['timestamp_generator.generator:generateUserTimestamp', array()], '#create_placeholder' =gt; TRUE ); $build['#markup'] = $this-gt;t('The current timestamp is'); $build['#cache']['contexts'][] = 'languages'; return $build; } }/code/pre pIn the block plugin above, lets focus on the build array:/p pre code class=language-php$build['timestamp'] = array( '#lazy_builder' =gt; ['timestamp_generator.generator:generateUserTimestamp', array()], '#create_placeholder' =gt; TRUE ); $build['#markup'] = $this-gt;t('The current timestamp is');/code/pre pAll we need to define a lazy builder is, add an index #lazy_builder to our render array./p p#lazy_builder: The lazy builder argument must be an array of callback function amp; argument this callback function needs. In our case, we have created a service that can generate the current timestamp. Also, since it doesn't need any arguments, the second argument is an empty array./p p#create_placeholder: This argument when set to TRUE, makes sure a placeholder is generated amp; placed while processing this render element./p p#markup: This is the cacheable part of the block plugin. Since, the content is translatable, we have added a language cache context here. We can add any cache tag depending on the content being rendered here as well using $build['#cache']['tags'] = ['...'];/p pLets take a quick look at our service implementation:/p pre code class=language-yamlservices: timestamp_generator.generator: class: Drupal\timestamp_generator\UserTimestampGenerator arguments: []/code/pre p /p pre code class=language-phplt;?php /** * @file * Contains \Drupal\timestamp_generator\UserTimestampGenerator. */ namespace Drupal\timestamp_generator; /** * Class UserTimestampGenerator. * * @package Drupal\timestamp_generator */ class UserTimestampGenerator { /** * */ public function generateUserTimestamp() { return array( '#markup' =gt; time() ); } }/code/pre pAs we can see above the data returned from the service callback function is just the timestamp, which is the dynamic part of block content./p pLets see how Drupal renders it with its default single flush strategy. So, the content of the block before placeholder processing would look like as follows:/p pre code class=language-xmllt;div id=block-timestamp class=contextual-region block block-timestamp-generator block-timestampgt; lt;h2gt;Timestamplt;/h2gt; lt;div data-contextual-id=block:block=timestamp:langcode=en class=contextual role=formgt; lt;button class=trigger focusable visually-hidden type=button aria-pressed=falsegt;Open Timestamp configuration optionslt;/buttongt; lt;ul class=contextual-links hidden=gt;lt;li class=block-configuregt;lt;a href=/admin/structure/block/manage/timestamp?destination=nodegt;Configure blocklt;/agt;lt;/ligt;lt;/ulgt; lt;/divgt; lt;div class=contentgt;The current time stamp is lt;drupal-render-placeholder callback=timestamp_generator.generator:generateUserTimestamp arguments= token=d12233422gt;lt;/drupal-render-placeholdergt; lt;/divgt; lt;/divgt;/code/pre pOnce the placeholders are processed, it would change to:/p pre code class=language-xmllt;div id=block-timestamp class=contextual-region block block-timestamp-generator block-timestampgt; lt;h2gt;Timestamplt;/h2gt; lt;div data-contextual-id=block:block=timestamp:langcode=en class=contextual role=formgt; lt;button class=trigger focusable visually-hidden type=button aria-pressed=falsegt;Open Timestamp configuration optionslt;/buttongt; lt;ul class=contextual-links hidden=gt;lt;li class=block-configuregt;lt;a href=/admin/structure/block/manage/timestamp?destination=nodegt;Configure blocklt;/agt;lt;/ligt;lt;/ulgt; lt;/divgt; lt;div class=contentgt;The current time stamp is 1421319204 lt;/divgt; lt;/divgt;/code/pre pThe placeholder processing in Drupal 8 happens inside via a href=https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!Placeholder!ChainedPlaceholderStrategy.php/class/ChainedPlaceholderStrategy/8.2.xDrupal\Core\Render\Placeholder\ChainedPlaceholderStrategy::processPlaceholders/a. Drupal 8 core also provides with an interface for defining any custom placeholder processing strategy as well a href=https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!Placeholder!PlaceholderStrategyInterface.php/interface/PlaceholderStrategyInterface/8.2.xDrupal\Core\Render\Placeholder\PlaceholderStrategyInterface/a. a href=https://www.drupal.org/project/big_pipeBigpipe/a module implements this interface to provide its own placeholder processing strategy amp; is able to present users with cached content without waiting for the processing for dynamic ones./p pWith a href=https://www.drupal.org/project/big_pipebigpipe/a enabled, the block would render something like the one shown in the gif below:/p img alt=Lazy builder with Bigpipe data-entity-type=file data-entity-uuid=570dbccd-beb0-4ff7-addc-652f3152110a height=794 src=/sites/default/files/inline-images/lazy-builder.gif width=453 class=align-center /pAs you can see in this example, as soon as the cached part of the timestamp block The current timestamp is is ready, its presented to the end users without waiting for the timestamp value. Current timestamp loads when the lazy builders kick in. Lazy builders are not limited to blocks but can work with any render array element in Drupal 8, this means any piece of content being rendered can leverage lazy builders./p pstrongN.B./strong -- We use Bigpipe in the demo above to make the difference visble./p /div /div span rel=schema:author class=field field--name-uid field--type-entity-reference field--label-hiddenspan lang= about=/user/25 typeof=schema:Person property=schema:name datatype=PIYUESH KUMAR/span/span span property=schema:dateCreated content=2016-09-26T08:36:46+00:00 class=field field--name-created field--type-created field--label-hiddenMon, 09/26/2016 - 14:06/span
Categories: Drupal Feeds

erdfisch: Arriving in Dublin

Mon, 09/26/2016 - 2:34am
span class=field field-node--title field-name-title field-type-string field-label-hiddenArriving in Dublin/span div class=field field-node--field-single-image field-name-field-single-image field-type-entity-reference field-label-visually_hidden div class=field-label visually-hiddenSingle image:nbsp;/div div class=field field-media--field-image field-name-field-image field-type-image field-label-hidden img src=https://erdfisch.de/sites/default/files/IMG_5206-we-are-all-made-of-the-same-stuff.png width=1579 height=1914 alt= title=Hydra in front of anti-racism poster in Dublin typeof=foaf:Image / /div div class=copyrightHydra in front of anti-racism poster in Dublin/div /div span class=field field-node--created field-name-created field-type-created field-label-hidden26.09.2016/span span class=field field-node--uid field-name-uid field-type-entity-reference field-label-hiddenspan lang= about=/users/michael-lenahan typeof=schema:Person property=schema:name datatype=Michael Lenahan/span/span div class=field field-node--body field-name-body field-type-text-with-summary field-label-visually_hidden div class=field-label visually-hiddenBody:nbsp;/div h1Arriving in Dublin/h1 pDrupalcon Dublin is starting this week. Particularly exciting one for me sincebr / I went to university here about a million years ago (a.k.a. the early nineties)./p pThis was another era entirely, before the internet. I think the arrival of thebr / internet changed Ireland even more than most other countries. It is mainlybr / rural, and stuck on the western edge of Europe on the Atlantic. Surrounded bybr / water as the song says. The water comes down from above as well. Very, verybr / frequently./p pimg src=https://erdfisch.de/sites/default/files/styles/medium/public/IMG_5267.JPG?itok=iB1KoOaB //p pSo Ireland remains geographically on the edge of Europe, but digitally it isbr / extremely connected. Companies from Silicon Valley discovered a country with abr / young and educated workforce, so they set up their European operations here frombr / the late 1990s on./p pimg src=https://erdfisch.de/sites/default/files/styles/medium/public/IMG_5256.JPG?itok=ITQ8bth4 //p pThis changed Ireland. For most of its recent history it had been a poor countrybr / where people mostly emigrated to find work. The Catholic church had a lot ofbr / power over society in general, the health and education systems in particular./p pimg src=https://erdfisch.de/sites/default/files/styles/medium/public/IMG_5251.JPG?itok=uVxzlYqP //p pNow, there are many foreigners living here and you hear people from all over thebr / world who speak English with Irish accents. This is something that is stillbr / quite amazing for me./p pIt's a privilege to be here. Thank you, erdfisch! More to come .../p /div div class=field field-node--field-blog-tags field-name-field-blog-tags field-type-taxonomy-term-reference field-label-visually_hidden div class=field-label visually-hiddenSchlagworte/Tags:nbsp;/div a href=/blog/taxonomy/term/345/0planet/a /div section class=field field-node--field-comments field-name-field-comments field-type-comment field-label-above comment-wrapper div class=comment-form-area div class=comment-form-area--container form class=comment-comment-form comment-form action=/comment/reply/node/358/field_comments method=post id=comment-form accept-charset=UTF-8 div class=form-item form-type-textfield form-item-name label for=edit-nameIhr Name/label input data-drupal-default-value=Anonymous type=text id=edit-name name=name value=Anonymous size=30 maxlength=60 class=form-text / /div input type=hidden name=form_build_id value=form-NBr5DfHGX6wK4BBKhZk3dnWIj9_vl3dbjuISdON-lVE / input type=hidden name=form_id value=comment_comment_form / input type=hidden name=honeypot_time value=1474879308 / div class=field-type-text-long field-name-comment-body field-widget-text-textarea form-wrapper id=edit-comment-body-wrapper div class=text-format-wrapper form-item div class=form-item form-type-textarea form-item-comment-body-0-value label for=edit-comment-body-0-value class=form-requiredKommentar/Comment/label div class=form-textarea-wrappertextarea class=text-full form-textarea required resize-vertical id=edit-comment-body-0-value name=comment_body[0][value] rows=5 cols=60 placeholder= required=required aria-required=true/textarea/div /div /div /div div class=form-actions form-wrapper id=edit-actionsbutton type=submit id=edit-submit name=op value=Kommentar hinzufügen/Add comment class=button button--primary form-submitspanKommentar hinzufügen/Add comment/span/button /div div class=url-textfielddiv class=form-item form-type-textfield form-item-url label for=edit-urlLeave this field blank/label input autocomplete=off type=text id=edit-url name=url value= size=20 maxlength=128 class=form-text / /div /div /form /div /div /section
Categories: Drupal Feeds

PreviousNext: Join us at the DrupalSouth Code Sprint

Sun, 09/25/2016 - 7:51pm
pThe Drupal open source project only exists because of code contributions by tens of thousands of developers and Drupal focused companies around the world. In his a href=http://buytaert.net/who-sponsors-drupal-developmentrecent post/a, project founder Dries Buytaert blogged that “The Drupal community has a shared responsibility to build Drupal and that those who get more from Drupal should consider giving more”./p pAustralia’s contribution to Drupal code is significantly underrepresented, with PreviousNext the only Australian company in the Top 100 contributors listed on Drupal.org’s a href=https://www.drupal.org/drupal-servicesglobal marketplace/a. DrupalSouth represents the best opportunity for a wider pool of Australian Drupal developers to change this status by participating in DrupalSouth's official Code Sprint, being held on Wednesday, 26th October.br / /p span property=dc:title content=Join us at the DrupalSouth Code Sprint class=rdf-meta element-hidden/span
Categories: Drupal Feeds

Greg Boggs: Content Modeling in Drupal 8

Sun, 09/25/2016 - 2:43pm
pIn many modern frameworks, data modeling is done by building out database tables. In Drupal, we use a web-based interface to build our models. This interface makes building the database accessible for people with no database experience. However, this easy access can lead to overly complex content models because itrsquo;s so easy to build out advanced structures with a few hours of clicking. Itrsquo;s surprising how often Drupal developers are expected to be content modeling experts. Herersquo;s a well-written a href=http://alistapart.com/article/content-modelling-a-master-skilloverview of content modeling/a for the rest of us who arenrsquo;t experts yet./p h2 id=data-modeling-goal:c77707ea70720d0bb8cce808c1bff833Data Modeling Goal/h2 pOur goal when modeling content in Drupal is build out the structure that will become our editor interface and HTML output. We also need to create a model that supports the functionality needed in the website. While accomplishing this, we want to reduce the complexity of our models as much as possible./p h2 id=getting-started:c77707ea70720d0bb8cce808c1bff833Getting Started/h2 pOne of the first things to do when building a Drupal site is to build content types. So, before you start a site build, start with either a content model or a detail page wireframe. This a href=https://docs.google.com/spreadsheets/d/15htLLWLguhwiuTLg_nndQNpgWVdUMy6UaR_d1q-v6iw/edit#gid=0spreadsheet from Palantir/a will help you. The home page design may look amazing, but itrsquo;s unhelpful for building out content types. Get the detail pages before you start building./p h2 id=why-reduce-complexity:c77707ea70720d0bb8cce808c1bff833Why Reduce Complexity?/h2 pThe more content types you create, the more effort it will take to produce a site. Further, the more types you have, the more time it will take to maintain the site in the future. If you have 15 content types and need to make a site-wide change, you need to edit 15 different pages./p pThe more pages you need to edit, the more mistakes you will make in choosing labels, settings, and formatters. Lastly, content canrsquo;t easily be copied from one type to another which makes moving content around your site harder when there are many content types. So, the first thing yoursquo;ll want to do with your content model is to collapse your types into as few types as feasible. How many is that?/p h2 id=5-content-types-is-enough:c77707ea70720d0bb8cce808c1bff8335 Content Types is Enough/h2 pDrupal has many built in entities like files, taxonomy, users, nodes, comments, and config. So, the vast majority of sites donrsquo;t need any more than 5 content types. Instead of adding a new content type for every design, look for ways to reuse existing types by adding fields and applying layouts to those fields./p h2 id=break-up-the-edit-form:c77707ea70720d0bb8cce808c1bff833Break Up the Edit Form/h2 pDrupal 8 allows you to have different form displays for a single content type. With either a href=https://www.drupal.org/project/form_mode_controlForm Mode Control/a or a href=https://www.drupal.org/project/form_mode_managerForm Mode Manager/a, you can create different edit experiences for the same content type without overloading the admin interface./p pNow that wersquo;ve got the goal in mind and some tools to get us there, wersquo;ll dive into the specifics of configuring field types such as hero images and drop down lists in my next post./p
Categories: Drupal Feeds

DrupalCon News: Badge Pick-Up is Open

Sun, 09/25/2016 - 9:18am
div class=field field--name-body field--type-text-with-summary field--label-hiddendiv class=field__itemsdiv class=field__item evenpDrupalCon is here! We have registration open here at the Dublin Convention Centre until 18:00 today. We will also be open bright and early at 7:00 on Monday to kick off the first day of DrupalCon Dublin! Come on by and pick your badge and tote and make sure to join us for the a href=http://events.drupal.org/dublin2016/opening-receptionOpening Reception/a from 17:00-19:00 where everyone is welcome./p pimg alt= height=300 src=https://events.drupal.org/sites/default/files/badge_pick_up.jpg style=float:left width=400 //p p /p p /p p /p/div/div/div
Categories: Drupal Feeds