Elsewhere

CMS Quick Start: Drupal 7 Login Methods and Module Roundup: Part 2

Planet Drupal - Wed, 15/10/2014 - 21:35

Last time we explored some different options that determined how the login form was displayed on your site. Today we're going to expand on that and look at different ways of wrangling or changing the actual login experience for your users. The default settings aren't exactly very refined and so it can take some configuration to get a better user experience out of the whole process.

read more

Categories: Elsewhere

CTI Digital: See the team behind Drupal 8 (all 2,300 of them!)

Planet Drupal - Wed, 15/10/2014 - 18:28

On October 1st 2014, Dries announced at DrupalCon Amsterdam that Drupal 8 had reached Beta 1, a significant milestone in the journey to Drupal 8.  

He also revealed that 2,300 individuals have contributed to the Drupal 8 project. Pretty impressive - but hard to imagine, right?   One of our Drupal developers here at CTI decided to create a visualisation to express the flurry of activity before, during and after DrupalCon, which has culminated in this significant achievement.    The video Adam created helps communicate the true scale of the project. Enjoy…  

Categories: Elsewhere

LightSky: Are you Giving Back?

Planet Drupal - Wed, 15/10/2014 - 17:56

LightSky has been using Drupal for quite some time, but because of a lot of factors haven’t contributed as much during that time as we probably should.  Mike and I implemented a philosophical change about a year ago to make a concerted effort to give back.  It has been small steps for us though, we are a small organization and in a growing phase, so our resources to give back have been limited.  Starting with attending some Drupal camps, to building modules, contributing to core, and growing from there, we have made a pretty big effort on our end to help support the Drupal community and we think you should too.

Agencies like us aren’t the only ones to give back though, companies of all different backgrounds across the globe use Drupal, and give back to the community.  Some, more directly than others, but even passively, giving back to the community is what keeps Drupal sustainable, and makes the platform so desirable.

How Can a Widget Factory Give Back to Drupal?

This is an interesting question, but it isn’t as complicated as one might think.  Look at all of our clients for example, they all give back to Drupal and many of them have no web experience, and can’t write or interpret even the most basic of code.  They give back through us.  They choose to partner with a company that gives back to the Drupal community, and that is a big deal.  There is great value in their support of the community for their company and their bottom line.  Open source projects are often some of the most cost effective choices in the software world, and Drupal is really no different. 

Experience Not Needed

Contributing doesn’t have to be through a third party though.  Content on Drupal.org can be updated by anyone with a user account.  Making documentation changes to a module that your organization is using, or building better documentation is a great way to give back, and anyone can do it.  But the way that I recommend companies give back is speaking at a Drupal camp.  Do a case study, it doesn’t have to be technical, show people how Drupal has helped your company.

Drupal allows our clients to to have an enterprise level product, that is community based, and completely flexible, and often Drupal provides them a solution that no other software could really match.  But what created this excellent product is the community, and without people giving back regularly, this product would never exist.  So if you aren’t giving back, think about how you can, and if your Drupal firm isn’t giving back, make sure that they know you think they should.

For more tips like these, follow us on social media or subscribe for free to our RSS feed and newsletter. You can also contact us directly or request a consultation
Categories: Elsewhere

Drupal Watchdog: The Angry Themer

Planet Drupal - Wed, 15/10/2014 - 17:00
Column

Welcome back to the ANGRY THEMER!

Faithful readers of this column who have followed my outbursts over the past few years might ask, “How can I prevent myself from turning into a grumpy old themer with high blood pressure like you?”

Fortunately, the Drupal project has grown to include new tools to help battle-hardened Vikings such as I cope with Drupal’s terrible markup and keep my rage more or less under control.

And you, dear themer, no longer have to dive into code or understand the inner workings of Drupal, while also battling Responsive, Web 2.0, Internet Explorer versions 6,7, 8, 9..., Safari, Chrome, Firefox, or Opera – not to mention the gazillion tablets and smartphones. (Ah, but that’s another story, best saved for another day.)

These are my favorite weapons – uh, I mean tools, tools of the trade – that I utilize when I need to slice through the Drupal Markup sludge.

Themes

Drupal contrib has a ton of “Starter Themes”; so you don't have to trudge through all the basics every time you design a site.

Of course my favorite theme is the Mothership (Full Disclosure: written by your very own Angry Themer), which isn’t so much a theme as a complete cleanup of Drupal’s approach to markup.

Mothership – Keelhaul the DIV!

The Mothership theme is not something you use to make your site pretty; this isn’t Wordpress. It’s designed to make your source code look and act awesome by knifing through the sea of divs, classes, and about 20% of old markup fixes that come packed with Drupal, and deep-sixing it – leaving sparkling-clean HTML5 in its wake.

The Mothership theme comes equipped to clean up nearly every dusty corner and musty absess of Drupal that needs cleaning up:

  • settings for removing class names
  • corrects the markup to HTML5 standards
  • modifies CSS & Javascript files

It also comes with commonly used basic CSS and JS libraries to help with responsive HTML5 sites, and now it even fixes the IE 9 CSS caching/respond.js issue.

As a bonus, you get to swagger and swear like a Caribbean pirate – and the ship’s captain strongly resembles Johnny Depp!

For those less-aggressive themers out there (and you know who your are), maybe Zen or Aurora – which have a more relaxed attitude towards markup – are more your speed.

Categories: Elsewhere

Drupal.org frontpage posts for the Drupal planet: Drupal 7.32 released

Planet Drupal - Wed, 15/10/2014 - 14:47

Drupal 7.32, a maintenance release which contain fixes for security vulnerabilities, is now available for download. See the Drupal 7.32 release notes for further information.

Download Drupal 7.32

Upgrading your existing Drupal 7 is strongly recommended. There are no new features or non-security-related bug fixes in this release. For more information about the Drupal 7.x release series, consult the Drupal 7.0 release announcement.

Security information

We have a security announcement mailing list and a history of all security advisories, as well as an RSS feed with the most recent security advisories. We strongly advise Drupal administrators to sign up for the list.

Drupal 7 and 6 include the built-in Update Status module (renamed to Update Manager in Drupal 7), which informs you about important updates to your modules and themes.

Bug reports

Both Drupal 7.x and 6.x are being maintained, so given enough bug fixes (not just bug reports) more maintenance releases will be made available, according to our monthly release cycle.

Changelog

Drupal 7.32 is a security release only. For more details, see the 7.32 release notes. A complete list of all bug fixes in the stable 7.x branch can be found in the git commit log.

Security vulnerabilities

Drupal 7.32 was released in response to the discovery of critical security vulnerabilities. Details can be found in the official security advisory:

To fix the security problem, please upgrade to Drupal 7.32.

Known issues

None.

Front page news: Planet DrupalDrupal version: Drupal 7.x
Categories: Elsewhere

Code Karate: Drupal 7 jQuery Countdown

Planet Drupal - Wed, 15/10/2014 - 14:36
Episode Number: 173

In episode 173 you learn about how to make a simple countdown timer using the jQuery Countdown module. This module, which uses jQuery, allows you to specify an end date which the countdown timer will countdown to. The countdown timer is available as a block and can be placed in any region that you desire for your website. Also, at this recording their was a minor bug that didn't allow for countdown dates to extend beyond 100 days (wouldn't display the third digit).

Tags: DrupalBlocksDrupal 7Drupal PlanetJavascriptJQuery
Categories: Elsewhere

Junichi Uekawa: Trying to migrate to new server and new infrastructure.

Planet Debian - Wed, 15/10/2014 - 09:47
Trying to migrate to new server and new infrastructure.

Categories: Elsewhere

Raphaël Hertzog: Freexian’s second report about Debian Long Term Support

Planet Debian - Wed, 15/10/2014 - 09:45

Like last month, here comes a report about the work of paid contributors to Debian LTS.

Individual reports

In September 2014, 3 contributors have been paid for 11h each. Here are their individual reports:

Evolution of the situation

Compared to last month, we have gained 5 new sponsors, that’s great. We’re now at almost 25% of a full-time position. But we’re not done yet. We believe that we would need at least twice as many sponsored hours to do a reasonable work with at least the most used packages, and possibly four times as much to be able to cover the full archive.

We’re now at 39 packages that need an update in Squeeze (+9 compared to last month), and the contributors paid by Freexian did handle 11 during last month (this gives an approximate rate of 3 hours per update, CVE triage included).

Open questions

Dear readers, what can we do to convince more companies to join the effort?

The list of sponsors contains almost exclusively companies from Europe. It’s true that Freexian’s offer is in Euro but the economy is world-wide and it’s common to have international invoices. When Ivan Kohler asked if having an offer in dollar would help convince other companies, we got zero feedback.

What are the main obstacles that you face when you try to convince your managers to get the company to contribute?

By the way, we prefer that companies take small sponsorship commitments that they can afford over multiple years over granting lots of money now and then not being able to afford it for another year.

Thanks to our sponsors

Let me thank our main sponsors:

Categories: Elsewhere

KnackForge: Drupal user picture deleted automatically

Planet Drupal - Wed, 15/10/2014 - 09:33
Sometimes you could be in a fury when user picture gets deleted automatically with nothing being noticed as strange. Even this thread 935592 might not help you. Then you have come to right place. Ofcourse the culprit could be your call to user_save() somewhere. The actual issue might be, you are passing global user object instead of full account object. The first param of user_save() should be a full account object, while global user does not have all the data of account object. In this case $account->picture is an object while $user->picture is just an integer, fid (File id) of the image file. So while trying to save, your picture association with the user account gets broken. The reason can be understood by looking at the user_save() source code. The method checks for  empty($account->picture->fid) While using $user, this condition becomes false (we only have $account->picture not $account->picture->fid) and user picuter is removed. So make sure you call like this, global $user $account = account_load($user->uid); /*Some operations with $account object*/ user_save($account, $edit); /*NOT user_save($user, $edit)*/
Categories: Elsewhere

Matthew Palmer: My entry in the "Least Used Software EVAH" competition

Planet Debian - Wed, 15/10/2014 - 07:00

For some reason, I seem to end up writing software for very esoteric use-cases. Today, though, I think I’ve outdone myself: I sat down and wrote a Ruby library to get and set process resource limits – those things that nobody ever thinks about except when they run out of file descriptors.

I didn’t even have a direct need for it. Recently I was grovelling through the EventMachine codebase, looking at the filehandle limit code, and noticed that the pure-ruby implementation didn’t manipulate filehandle limits. I considered adding it, then realised that there wasn’t a library available to do it. Since I haven’t berked around with FFI for a while, I decided to write rlimit. Now to find the time to write that patch for EventMachine…

Since I doubt there are many people who have a burning need to manipulate rlimits in Ruby, this gem will no doubt sit quiet and undisturbed in the dark, dusty corners of rubygems.org. However, for the three people on earth who find this useful: you’re welcome.

Categories: Elsewhere

Web Wash: Add Keyword Highlighting using Search API in Drupal 7

Planet Drupal - Wed, 15/10/2014 - 00:44

Search API has been my go-to module for building search pages for the last two years. Even if the client doesn't ask for anything fancy, I still download and install Search API, use Database Search for the index and Views for the page.

If you start with Search API from the beginning, then it's easier to customise later on. The core Search module, on the other hand, is easy to setup but hard to modify.

Recently, I had to create a search page that highlighted the keywords in the results. If you search using a particular keyword, then the word is highlighted.

Categories: Elsewhere

Julian Andres Klode: Key transition

Planet Debian - Tue, 14/10/2014 - 23:46

I started transitioning from 1024D to 4096R. The new key is available at:

https://people.debian.org/~jak/pubkey.gpg

and the keys.gnupg.net key server. A very short transition statement is available at:

https://people.debian.org/~jak/transition-statement.txt

and included below (the http version might get extended over time if needed).

The key consists of one master key and 3 sub keys (signing, encryption, authentication). The sub keys are stored on an OpenPGP v2 Smartcard. That’s really cool, isn’t it?

Somehow it seems that GnuPG 1.4.18 also works with 4096R keys on this smartcard (I accidentally used it instead of gpg2 and it worked fine), although only GPG 2.0.13 and newer is supposed to work.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1,SHA512 Because 1024D keys are not deemed secure enough anymore, I switched to a 4096R one. The old key will continue to be valid for some time, but i prefer all future correspondence to come to the new one. I would also like this new key to be re-integrated into the web of trust. This message is signed by both keys to certify the transition. the old key was: pub 1024D/00823EC2 2007-04-12 Key fingerprint = D9D9 754A 4BBA 2E7D 0A0A C024 AC2A 5FFE 0082 3EC2 And the new key is: pub 4096R/6B031B00 2014-10-14 [expires: 2017-10-13] Key fingerprint = AEE1 C8AA AAF0 B768 4019 C546 021B 361B 6B03 1B00 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlQ9j+oACgkQrCpf/gCCPsKskgCgiRn7DoP5RASkaZZjpop9P8aG zhgAnjHeE8BXvTSkr7hccNb2tZsnqlTaiQIcBAEBCgAGBQJUPY/qAAoJENc8OeVl gLOGZiMP/1MHubKmA8aGDj8Ow5Uo4lkzp+A89vJqgbm9bjVrfjDHZQIdebYfWrjr RQzXdbIHnILYnUfYaOHUzMxpBHya3rFu6xbfKesR+jzQf8gxFXoBY7OQVL4Ycyss 4Y++g9m4Lqm+IDyIhhDNY6mtFU9e3CkljI52p/CIqM7eUyBfyRJDRfeh6c40Pfx2 AlNyFe+9JzYG1i3YG96Z8bKiVK5GpvyKWiggo08r3oqGvWyROYY9E4nLM9OJu8EL GuSNDCRJOhfnegWqKq+BRZUXA2wbTG0f8AxAuetdo6MKmVmHGcHxpIGFHqxO1QhV VM7VpMj+bxcevJ50BO5kylRrptlUugTaJ6il/o5sfgy1FdXGlgWCsIwmja2Z/fQr ycnqrtMVVYfln9IwDODItHx3hSwRoHnUxLWq8yY8gyx+//geZ0BROonXVy1YEo9a PDplOF1HKlaFAHv+Zq8wDWT8Lt1H2EecRFN+hov3+lU74ylnogZLS+bA7tqrjig0 bZfCo7i9Z7ag4GvLWY5PvN4fbws/5Yz9L8I4CnrqCUtzJg4vyA44Kpo8iuQsIrhz CKDnsoehxS95YjiJcbL0Y63Ed4mkSaibUKfoYObv/k61XmBCNkmNAAuRwzV7d5q2 /w3bSTB0O7FHcCxFDnn+tiLwgiTEQDYAP9nN97uibSUCbf98wl3/ =VRZJ -----END PGP SIGNATURE-----
Filed under: Uncategorized
Categories: Elsewhere

Joachim Breitner: Switching to systemd-networkd

Planet Debian - Tue, 14/10/2014 - 21:30

Ever since I read about systemd-networkd being in the making I was looking forward to try it out. I kept watching for the package to appear in Debian, or at least ITP bugs. A few days ago, by accident, I noticed that I already have systemd-networkd on my machine: It is simply shipped with the systemd package!

My previous setup was a combination of ifplugd to detect when I plug or unplug the ethernet cable with a plain DHCP entry in /etc/network/interface. A while ago I was using guessnet to do a static setup depending on where I am, but I don’t need this flexibility any more, so the very simple approach with systemd-networkd is just fine with me. So after stopping ifplugd and

$ cat > /etc/systemd/network/eth.network <<__END__ [Match] Name=eth0 [Network] DHCP=yes __END__ $ systemctl enable systemd-networkd $ systemctl start systemd-networkd

I was ready to go. Indeed, systemd-networkd, probably due to the integrated dhcp client, felt quite a bit faster than the old setup. And what’s more important (and my main motivation for the switch): It did the right thing when I put it to sleep in my office, unplug it there, go home, plug it in and wake it up. ifplugd failed to detect this change and I often had to manually run ifdown eth0 && ifup eth0; this now works.

But then I was bitten by what I guess some people call the viral nature of systemd: systemd-networkd would not update /etc/resolve.conf, but rather relies on systemd-resolved. And that requires me to change /etc/resolve.conf to be a symlink to /run/systemd/resolve/resolv.conf. But of course I also use my wireless adapter, which, at that point, was still managed using ifupdown, which would use dhclient which updates /etc/resolve.conf directly.

So I investigated if I can use systemd-networkd also for my wireless account. I am not using NetworkManager or the like, but rather keep wpa_supplicant running in roaming mode, controlled from ifupdown (not sure how that exactly works and what controls what, but it worked). I found out that this setup works just fine with systemd-networkd: I start wpa_supplicant with this service file (which I found in the wpasupplicant repo, but not yet in the Debian package):

[Unit] Description=WPA supplicant daemon (interface-specific version) Requires=sys-subsystem-net-devices-%i.device After=sys-subsystem-net-devices-%i.device [Service] Type=simple ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I [Install] Alias=multi-user.target.wants/wpa_supplicant@%i.service

Then wpa_supplicant will get the interface up and down as it goes, while systemd-networkd, equipped with

[Match] Name=wlan0 [Network] DHCP=yes

does the rest.

So suddenly I have a system without /etc/init.d/networking and without ifup. Feels a bit strange, but also makes sense. I still need to migrate how I manage my UMTS modem device to that model.

The only thing that I’m missing so far is a way to trigger actions when the network configuration has changes, like I could with /etc/network/if-up.d/ etc. I want to run things like killall -ALRM tincd and exim -qf. If you know how to do that, please tell me, or answer over at Stack Exchange.

Categories: Elsewhere

Joachim Breitner: Switching to sytemd-networkd

Planet Debian - Tue, 14/10/2014 - 21:00

Ever since I read about sytemd-networkd being in the making I was looking forward to try it out. I kept watching for the package to appear in Debian, or at least ITP bugs. A few days ago, by accident, I noticed that I already have systemd-networkd on my machine: It is simply shipped with the systemd package!

My previous setup was a combination of ifplugd to detect when I plug or unplug the ethernet cable with a plain DHCP entry in /etc/network/interface. A while ago I was using guessnet to do a static setup depending on where I am, but I don’t need this flexibility any more, so the very simple approach with systemd-networkd is just fine with me. So after stopping ifplugd and

$ cat > /etc/systemd/network/eth.network <<__END__ [Match] Name=eth0 [Network] DHCP=yes __END__ $ systemctl enable systemd-networkd $ systemctl start systemd-networkd

I was ready to go. Indeed, systemd-networkd, probably due to the integrated dhcp client, felt quite a bit faster than the old setup. And what’s more important (and my main motivation for the switch): It did the right thing when I put it to sleep in my office, unplug it there, go home, plug it in and wake it up. ifplugd failed to detect this change and I often had to manually run ifdown eth0 && ifup eth0; this now works.

But then I was bitten by what I guess some people call the viral nature of systemd: sytemd-networkd would not update /etc/resolve.conf, but rather relies on systemd-resolved. And that requires me to change /etc/resolve.conf to be a symlink to /run/systemd/resolve/resolv.conf. But of course I also use my wireless adapter, which, at that point, was still managed using ifupdown, which would use dhclient which updates /etc/resolve.conf directly.

So I investigated if I can use systemd-networkd also for my wireless account. I am not using NetworkManager or the like, but rather keep wpa_supplicant running in roaming mode, controlled from ifupdown (not sure how that exactly works and what controls what, but it worked). I found out that this setup works just fine with systemd-networkd: I start wpa_supplicant with this service file (which I found in the wpasupplicant repo, but not yet in the Debian package):

[Unit] Description=WPA supplicant daemon (interface-specific version) Requires=sys-subsystem-net-devices-%i.device After=sys-subsystem-net-devices-%i.device [Service] Type=simple ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I [Install] Alias=multi-user.target.wants/wpa_supplicant@%i.service

Then wpa_supplicant will get the interface up and down as it goes, while systemd-networkd, equipped with

[Match] Name=wlan0 [Network] DHCP=yes

does the rest.

So suddenly I have a system without /etc/init.d/networking and without ifup. Feels a bit strange, but also makes sense. I still need to migrate how I manage my UMTS modem device to that model.

The only thing that I’m missing so far is a way to trigger actions when the network configuration has changes, like I could with /etc/network/if-up.d/ etc. I want to run things like killall -ALRM tincd and exim -qf. If you know how to do that, please tell me, or answer over at Stack Exchange.

Categories: Elsewhere

Commerce Guys: DrupalCon Amsterdam Wrap Up

Planet Drupal - Tue, 14/10/2014 - 20:22
Wow!!! As I think about the week spent in Amsterdam, I am in awe of the entire experience. This beautiful place has a very long and eventful history dating back to the 12th century, and was the perfect setting for DrupalCon Amsterdam 2014. As I think back upon the week, so many words come to mind that reflect emotions I felt while there: festivity, jubilance, liveliness, pride and treasure.   Having only been with Commerce Guys for a short 3 months, I wasn’t sure what to expect. I’ve been in the world of technology for over 13 years, and I’ve been around the block more than once with emerging technologies within the word of digital commerce. This experience for me personally will be one that I will forever treasure.     I said on many occasions that I felt like a fish out of water just trying to get some air. I consider myself fairly smart – I realized in Amsterdam with these magnificent people that any hopes of me getting an invite to be part of Mensa International most likely will never happen. Their kindness and willingness to welcome me to the world of Drupal was more than I could ever ask for.   Henry Ford once said, “Coming together is a beginning; keeping together is progress; working together is success.” The amazing group of people whom I refer to as the “Drupal People” (all 2,370 of them in attendance) embody this quote by Henry Ford. These are some of the most amazing, generous and intellectually aware people I have ever had the experience to associate with.    There was something rare and unique about this group of “Drupal People”. I believe that rareness is their desire to work together for one common goal…it’s what sets them apart from so many others. That goal is to serve the customer, and to provide the best of the best when it comes to a solution that is cost effective, manageable and scalable. From small startup business to full-blown enterprise organization, we have a solution that will work. Whether you are a current Drupal customer or are looking to make a change over to Drupal, I am here to tell you that the “Drupal People” truly are working together in a spirit of togetherness that will make Drupal the platform of the future (if they haven’t already).     I mentioned in the first paragraph some adjectives such as festivity, jubilance, liveliness, treasure and pride. There are two that stand out above all the rest: pride and treasure. I can’t be more proud of the company I have the privilege of working for and the people I have the opportunity to work with. Each and every team member of Commerce Guys brings to work a sense of pride that can’t be explained; only witnessed. Many sleepless hours are spent building the best of the best and ensuring that our customers know only one name: and that name is Drupal, a rare treasure.   I am excited about the next DrupalCons in Bogota, Los Angeles and Barcelona in 2015. As always, Commerce Guys will be there loud and proud supporting Drupal Commerce, Platform.sh, our partners, and the great people who are advocating the vision and future of Drupal.     Cheers to the beautiful city of Amsterdam, the fine people of Amsterdam, and each and every one of you who make what we do possible.   Thanks again for welcoming me to the Drupal Community in Amsterdam, I will be back!!!  
Categories: Elsewhere

Aten Design Group: Drupal Migrate for Development Content

Planet Drupal - Tue, 14/10/2014 - 19:43

Drupal and many of the people who work with it are moving toward a configuration in code model of site development. One of the advantages of a config in code approach is that the code you add, share, and modify works for all the members of your team and across environments. Instead of everyone syncing databases (or passing around notes on how to update their environment because something changed), everything stays up-to-date with the latest code in your version control system. This essentially provides a known, common state for everyone to work against.

Configuration only gets you part of the picture, though. Modules like Features and configuration initiatives for Drupal 8 separate configuration from content. Configuration is sharable settings; content is the information that site stores/uses. This separation makes sense in organizing your code or site, but leaves a big gap in your ability to build and test a project. If I'm working on a project locally, I can't share a link to the article node I'm having trouble with because it’s a combination of configuration and content that exists only on my local machine.

You need standardized content to test against and to provide a common ground to review variations with your team. But what do you do when you're starting on a project and you don't have content from a client yet? You still need to develop code that uses content and you still need to style the site.

Luckily, we can use a common approach for bringing in content from another source, the Migrate module, to help create content we can share and test against. Additionally, the content can be updated, version controlled, and contributed back as the project rolls forward. And – this is very important for development content – when we're finished with dev content we can remove it with Migrate's rollback functionality. Content created with some modules like Devel Generate and even manually created development content aren’t easily removed when you're finished. At Aten, we commonly had many nodes with "DELETE" in the title to make it "easy" for us to find and remove it later, which is less than ideal.

How does this all work? This is our internal workflow:

  • Create a resources folder in your project. Typically we now have a "root" level that has resources, a public_html folder (which has the Drupal files), and other project files.
  • Inside of the resources, we create a content directory and add content files like YAML files, CSVs, etc. (more on that in a minute)
  • We have started to use gulp and we have a task that will convert the YAML files to JSON.
  • We create a custom module in the project for migrate and add migrate classes for each of the content files we need to import. Typically this will be something like "project_content". For dev specific content, we name the migrations with "Dev" on the end. When we have production content (which is awesome to have early in a project), we leave that suffix off the class name since that content isn't something we need to rollback later.
  • We've created a script that is shared in the project that enables/disables modules, enables and reverts features, runs the migrations, updates various other things related to the project setup. If I add a new migration, I update that script's configuration to include it for others working on the project. I hope to share more about this script soon.
Creating Test Content

Now we need to create the content. Typically this requires some insight provided by our Drupal architecture document, but I have also created a couple of tools to help out with this process which help me stay in code:

The typeinfo commands allow you to inspect content types/entities on the site. For example, if you are going to create content for an Article content type, you would run:

drush typeinfo article

That will output the content type's fields, field types, and some other information. Often this provides a good overview of what pieces you will need to create in your content file. If you have a taxonomy or entity reference field in that content type, you can also get more information about that via another typeinfo command:

drush typeinfo-field field_article_type

This will return a few specifics that may show you the taxonomy that field uses. And now we can use the taxonomyinfo command to list terms in that vocabulary:

drush taxonomyinfo-term-list article_type

We can also extend this functionality to automatically stub some of the content (à la devel-generate) by creating another drush command. This command lets us get the YAML with some data populated for us:

drush stub-content article --include-id --include-title --count=5 > resources/content/article.yaml

An example of this command is here: https://gist.github.com/robballou/a7aa247aa7bdfb3a1b2c

The stub content functionality makes some really rudimentary content and you can expand that with content from your favorite ipsum replacement or other sources.

We can migrate from a variety of sources: from CSV files, JSON files, or even other databases. CSV files are a popular choice because you can collaborate on a spreadsheet (especially via Google sheets) and export that data. JSON is another nice solution because the data can match the destination closely. In some of our projects we have even used YAML and converted that to JSON since the readability of YAML is slightly better than JSON — which means we can have people write content who don't know the ins-and-outs of JSON!

Some systems may have access to a PHP YAML library and it could be used to create a Migrate YAML source class. This would eliminate the need to convert files but may rely on that YAML library to be available on local, staging, and production servers. We've used the node.js/gulp approach because it can be shared between environments and projects that may not have this PHP support built in. Migrating and Removing Test Content

This article won't get into the details of creating your Migrate code, but the next step in the process is creating and testing the code to get this content into Drupal. When this is done, commit this to your version control system to share with others working on the project or with other systems.

As an example, we'll say we created a migration called ArticlesDev which has a handful of articles in it. The content uses a variety of the fields in the content so we can make sure all the functionality works and includes several nodes so we can test lists of various sizes. We can import the content into any system with:

drush migrate-import ArticlesDev

If the article content type changes down the line, you can update the content files and re-run the migration, updating the existing content (or adding new content):

drush migrate-import --update ArticlesDev

Development-specific content may never get imported on shared systems, but if you do want to use that content for client acceptance testing or for any other case, you can easily remove this content with:

drush migrate-rollback ArticlesDev Content in Code

If you're working in a team or if you need a client to review functionality, development content can be very handy. Building on this workflow, you can get a set of content in place early in the process, update it as things change, and get rid of it if you don't need it anymore. Your team and your clients have a common ground when discussing the project. As a bonus, your development migration code can be used as a basis for creating or importing live content as you get it from the client.

Categories: Elsewhere

Gunnar Wolf: When Open Access meets the Napster anniversary

Planet Debian - Tue, 14/10/2014 - 18:58

Two causally unrelated events which fit in together in the greater scheme of things ;-)

In some areas, the world is better aligning to what we have been seeking for many years. In some, of course, it is not.

In this case, today I found our article on the Network of Digital Repositories for our University, in the Revista Digital Universitaria [en línea] was published. We were invited to prepare an article on this topic because this month's magazine would be devoted to Open Access in Mexico and Latin America — This, because a law was recently passed that makes conditions much more interesting for the nonrestricted publication of academic research. Of course, there is still a long way to go, but this clearly is a step in the right direction.

On the other hand, after a long time of not looking in that direction (even though it's a lovely magazine), I found that this edition of FirstMonday takes as its main topic Napster, 15 years on: Rethinking digital music distribution.

I know that nonrestricted academic publishing via open access and nonauthorized music sharing via Napster are two very different topics. However, there is a continuous push and trend towards considering and accepting open licensing terms, and they are both points in the same struggle. An interesting data point to add is that, although many different free licenses have existed over time, Creative Commons (which gave a lot of visibility and made the discussion within the reach of many content creators) was created in 2001 — 13 years ago today, two years after Napster. And, yes, there are no absolute coincidences.

Categories: Elsewhere

SitePoint PHP Drupal: Quick Tip: Up and Running with Drupal 8 in Under Five Minutes

Planet Drupal - Tue, 14/10/2014 - 18:51

In this quick tip, we’ll be installing a local instance of Drupal 8, beta 1. By the end, you’ll have a copy of Drupal that’s not only ready to be extended with Symfony bundles and other packages, but also ready to accept content and display it to end users.

Step 1: Prepare Environment

Continue reading %Quick Tip: Up and Running with Drupal 8 in Under Five Minutes%

Categories: Elsewhere

Open Source Training: The Payment Module: A Simpler Alternative to Drupal Commerce

Planet Drupal - Tue, 14/10/2014 - 18:45

Here at OSTraining we've given significant coverage to Drupal Commerce. You can watch a video class with nearly 30 lessons and download a book, "Building E-commerce Sites with Drupal Commerce".

However, Drupal Commerce is an enterprise-quality solution and a good number of OSTraining members have asked for simpler solutions.

For those members, we often recommend the Payment module which makes it easy to add e-commerce fields to your content.

Payment supports about half-a-dozen gateways (PayPal, Stripe, iDEAL, Authorize.net, Ogone, Rabo OmniKassa) and we'll use PayPal in this tutorial.

Categories: Elsewhere

Pages

Subscribe to jfhovinne aggregator - Elsewhere