Skip to Content

Newsfeeds

drupalsear.ch: Drupal Dev Days Szeged - Initial Sprint for Search API Drupal 8

Planet Drupal - 7 April 2014 - 3:02am
Szeged

I’ll tell you in a small prelude a story of a small place in the world named Szeged and why it holds a special place in my heart for me (Nick_vh). When I was job-hunting about 5 years and a half ago I found many companies willing to offer me a job after graduating but the one company I chose was willing to take a huge bet on me and offered me a job + an instant trip to Szeged, Hungary. It seemed that that was the location of the gathering of the Drupal Community in 2008. They said it would be amazing and I never looked back since then and I am still connected to the same and growing Drupal Community.

Going back to Szeged promised to be a lot of nostalgia and a lot of fun also.

Looking back

For those that just tune in on this story of the Search API Drupal 8 port, there is some reading to do.

In short: “Contrib Search maintainers are committed to make Drupal 8 kick ass with Search API.”

This is also exactly what we wanted to prove on this wonderful trip to Hungary.

What our goals were

Thomas and I already agreed this week in Szeged would be the first of a series of sprints to get Search API to a decent state in Drupal 8. As you can read in the Search API for Drupal 8 sprint entry for the Drupal Dev Days  the goals were the following: “The primary focus will be to get the Search API to a usable state in D8 and then decide on and implement framework improvements”

We discussed and talked about what needed to happen but in true community style, not many words were needed to get the first port started and so it happened that, even before all of this, freblasty started a sandbox and already ported a good chunk of the Drupal 7 code to well factored Drupal 8 code.

There was a sign up sheet for the sprints and to our surprise a LOT of people signed up for the sprint. I’ve masked the last names to protect their privacy, so they can opt-in on the exposure of their full name. Drunkenmonkey also prepared a nice list of meta issues that mark the Drupal 8 state before the sprint.

Plan of attack

Some of us already arrived early Monday, the other half arrived Monday afternoon. The team was already hacking away on the code when we decided to use a Google Doc that would semi-coordinate the progress. Process was simple:

  1. Raise your hand and say your name and that you wanted to help out
  2. You were given commit access to the sandbox
  3. Choose a task from the “To Do” in the collaborative document
  4. Solve it and commit it
  5. Say “I committed, please pull!” and do a little Ski-Dance (ask Aspilicious for specifics)
  6. Go to 3 and repeat until Sunday afternoon.

We purposefully supported this simple plan of attack because adding more process would block people from making progress and we figured it was better to break all the things than to block people from helping out.

The attack itself

II’m not going to waste a lot of empty words here but let the hard work/visuals speak for itself.

  • During the whole week we’ve had 322 commits.
  • Heaviest hours were from 09:00 till 19:00 and then it went up again from 22:00 till 24:00. Thanks to freblasty we even had commits during the middle of the night, 9 of them at 04:00.
  • Wednesday was our most productive day with 75 commits. Saturday was our low point with only 36 commits, I guess that has something to do with the party on Friday evening…!
  • 20834 lines were added, 11996 were removed

In total we had 15 contributors!!!! We’ve listed them by # of commits but by no means this means that the ones with more commits worked harder.

  1. drunkenmonkey            55    (15.62%)
  2. mollux_                51    (14.49%)
  3. Nick_vh            46     (13.07%)
  4. aspilicious            43     (12.22%)
  5. Andrew_l            38     (10.80%)
  6. freblasty            34     (9.66%)
  7. ekes                23     (6.53%)
  8. m1r1k                18     (5.11%)
  9. dpovshed            17     (4.83%)
  10. Andre-B            12     (3.41%)
  11. baldwinlouie            7     (1.99%)    
  12. sdecabooter            3     (0.85%)
  13. penyaskito            3     (0.85%)
  14. tstoeckler            1     (0.28%)
  15. pcambra             1     (0.28%)
Drupal 8 Codebase versus Drupal 7 codebase

A quick preview ofthe differences in terms of files of Drupal 8 vs Drupal 7.

 versus  

Future plans

For now, work continues in the sandbox until the basic functionality is working. Also, mollux is already working on a port of the Database Search backend, which will allow us to test the module with a real search backend.

Once the functionality is stable and we get into improvement/feature-adding mode, the project will be transferred back to the 8.x branch of the proper search_api project and work will continue in the normal style of patches and issues. (Issues for the individual tasks from the Google document have already been converted to issues in the sandbox’s issue queue as of last meeting).

Weekly Meetings on Hangout & IRC

We also set up a weekly meeting in the form of a Google hangout, every Tuesday at 18:00 UTC. Please contact us if you want to be invited, everyone who wants to help with this project is welcome!

Other than this, there is also the possibility of discussing and coordinating via IRC. We are using a special channel, #drupal-search-api on Freenode <irc://freenode/drupal-search-api>, where you can also just join in and ask around if you want to get involved.

Thanks

Many many many thanks to all those involved in the sprint. We understand this takes a big personal commitment and passion to focus so hard on complex problems to drive the next generation of Drupal Search. Also many thanks to all companies that sponsored the time and funds for allowing those people to be there. I hope this blogpost can help your company to convince them to send you to these events. It's educational, helpful and will lift you and your company to a higher level.

 

Proof of the team in Szeged, hard at work

Tags:
Categories: Drupal

Feature Boards - by Clinton Keith

Gamasutra.com Blogs - 7 April 2014 - 2:50am
Feature Boards often work better than Task Boards for game teams using agile.
Categories: Game Theory & Design

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

Planet Drupal - 7 April 2014 - 12:10am

In this article we are going to look at implementing the Facebook Open Graph (OG) tags on a Drupal site. It involves a bit of coding but nothing too major so bear with me. All the code we are going to write goes into the theme's template.php file so no need to to create a module for it. And if your theme does not yet have this file, go ahead and create it.

Why use Open Graph tags?

I'm sure by now you know that people share pages on Facebook and you want your site to be shared as much as possible. You also know that a little teaser information is made available on Facebook when you share these pages (title, image, short description).

But have you ever noticed that with some sites, when you share pages on Facebook, or like/recommend them, some random, unintented image gets used in this teaser. Or the description is not correct, or even the title is not right. Facebook is quite good at picking the right elements to show there but sometimes it doesn't manage by default. And you can't expect the random user who shares your page to make adjustments to the text or title. So what do you do? You use Open Graph meta tags.

What are the Open Graph meta tags?

These are simple <meta> tags that you put in the head of your site to specify which elements should be used by Facebook for various purposes. For instance, you specify a link to an image and then Facebook knows exactly which image to use when building the teasers. The same goes with the title, description and many others.

The tag is quite simply structured. It contains a property attribute in which you specify what this tag is for and a content attribute where you specify what should be used for this property. Let's see an example for the title:

<meta property="og:title" content="This is the article title" />

Simple. You'll also notice that the property attribute value is preceeded by og:. This stands for Open Graph and Facebook will recognize it as such. Here are some examples for other more common OG tags:

<meta property="og:url" content="http://webomelette.com/article-url" /> <meta property="og:site_name" content="Web Omelette" /> <meta property="og:type" content="blog" />

The first one is the canonical URL for the page, the second is the site title and the third is the type of site.

But how do we add them to Drupal?

I wrote a while back an article on this site in which I looked at how you can add your own custom tags into the <head> of the site. And there we learned that we use the drupal_add_html_head() function inside of a preprocess one to achieve this.

So let's say that our Article nodes don't show up properly in the Facebook teasers and we would like to specify OG tags for the title, image and description. We will do this in the theme's template.php file inside of the template_preprocess_node() function:

function theme_name_preprocess_node(&$vars) { }

Inside this function we get access to the node information being loaded and we can test to make sure we are adding our OG tags only to the pages that load these nodes:

// If the node is of type "article", add the OG tags if ($vars['type'] == 'article') { // Inside this conditional, we define and add our OG tags }

First, let's create the title tag, the simplest of them all. It will be represented by the node title:

$og_title = array( '#tag' => 'meta', '#attributes' => array( 'property' => 'og:title', 'content' => $vars['title'], ), ); drupal_add_html_head($og_title, 'og_title');

If you remember from the other article, this is how we create a new meta tag in the site header. We define a renderable array that describes the tag (type and attributes) and we use the drupal_add_html_head() function to set it. Simple. Now if you clear the cache and go to an article page you'll notice in its source a new tag:

<meta property="og:title" content="The title of the article" />

This was simple. Let's see how we can extract the image URL and specify it inside a new tag for the image Facebook will use:

$img = field_get_items('node', $vars['node'], 'field_image'); $img_url = file_create_url($img[0]['uri']); $og_image = array( '#tag' => 'meta', '#attributes' => array( 'property' => 'og:image', 'content' => $img_url, ), ); drupal_add_html_head($og_image, 'og_image');

So what happens here? First, we use the field_get_items() function to retrieve the field called field_image from the loaded node. This will return an array of one or more images (depending on how the field is set up and how many images are in it).

Next, we use the image file URI inside the file_create_url() function to turn it into an absolute URL. Then, just like above, we create the renderable array with the og:image property and the image URL as the content. The result will be:

<meta property="og:image" content="http://your-site.com/sites/all/files/your-image.jpg" />

Finally, let's see how we can get a small chunk of our body field and use that as a description for Facebook:

$body_field = field_view_field('node', $vars['node'], 'body', array('type' => 'text_plain')); $og_description = array( '#tag' => 'meta', '#attributes' => array( 'property' => 'og:description', 'content' => text_summary($body_field[0]['#markup']), ), ); drupal_add_html_head($og_description, 'og_description');

Instead of using the same function as when we retrieved the image field earlier, we use field_view_field() in this case. The reason is that it already prepares the body for output and we can specify a text format to use. We want to use plain text to avoid printing all the HTML markup that is usually found in the body field.

Next, like above, we create our renderable array. Only this time, we also use the text_summary() function to trim the text down to a reasonable default of 600 words (the defaul teaser length on the site). If you want to specify a different length, you could pass it as the third argument, like so:

text_summary($body_field[0]['#markup'], NULL, 100),

This will trim it to 100 words. One thing I noticed about this function however is that it doesn't trim nicely. It will end the chunk in the middle of the sentence even if its API says it will try to find a sensible place. For this purpose it doesn't really matter because Facebook will trim it down anyway to a shorter version.

Conclusion

So there you have it. Now you can use the Open Graph meta tags on your Drupal site to let Facebook know about your content. It's a handy social helper that can greatly improve your social presence by making your site more appealing on Facebook.

In Theming | Drupal var switchTo5x = true;stLight.options({"publisher":"dr-8de6c3c4-3462-9715-caaf-ce2c161a50c"});
Categories: Drupal

Fuzzy Thinking: Whoops!

RPGNet - 7 April 2014 - 12:00am
The pain! The pain!
Categories: Game Theory & Design

How Long Does It Take to Make an Indie Game? - by Joseph Mirabello

Gamasutra.com Blogs - 6 April 2014 - 11:20pm
I tracked the development of Indie FPS Tower of Guns to the minute. Here's a brief breakdown of how long it took to make the game, with super professional hand drawn pie charts.
Categories: Game Theory & Design

Enemy Mind: Straying from Tradition to Feel Like a Classic - by Connor Fallon

Gamasutra.com Blogs - 6 April 2014 - 11:17pm
Enemy Mind’s appeal comes from mixing familiar retro gameplay with the powerful ability to become your enemies. When it became clear that this new mechanic was conflicting with the shmup formula, we had to find new ways to capture the classic feel.
Categories: Game Theory & Design

LibGDX in Depth series – Entry 02 - by Vijay Kartick Prem Kumar

Gamasutra.com Blogs - 6 April 2014 - 11:07pm
In this entry i’ll discuss how meshes are normally sent with Opengl and in the next entry i’ll continue on how LibGDX hides these details from developer.
Categories: Game Theory & Design

Harry Slaughter: One revision control system to rule them all

Planet Drupal - 6 April 2014 - 7:18pm

The first revision control system I ever used was called RCS. It was the pre-cursor to CVS and stored all revision data locally. It was nifty but very limited and not suited for group development. CVS was the first shared revisioning system I used. It was rock solid, IMHO. But it had a few big problems, like the inability to rename or move files. Everything had to be deleted and re-added. 

Since those days, I've used several other revisioning systems: Perforce, Bitkeeper, Clearcase, Subversion and GIT.

read more

Categories: Drupal

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

Planet Drupal - 6 April 2014 - 4:54pm

For the past six months, I've been in the process of porting my contrib theme, Gratis, to Drupal 8. One of the challenges for contrib is Drupal 8 has been a constant moving target in terms of API changes. With every new Alpha of Drupal 8, I've had to adjust many bits of theme code to adhere to these new APIs.

One of the biggest challenges has been figuring out how to add jQuery and other core scripts into the theme. That's because off the shelf, Drupal 8 does not add these for anonymous users. This seems like an odd choice by core but my guess is that is was done for Drupal 8 to be more minimalistic and nimble on its feet.

At any rate, if you have a contrib theme, most likely the first thing you'll do is add all of these back in to bring it back to a point where Drupal 7 was. To add an additional layer of complexity to all this is the fact that the manner in which this is done has changed dramatically in recent weeks.

Exit nested arrays, enter YAML

At first one added core libraries using hook_library_info which was a mess of PHP nested arrays in your theme's .theme file. Now, in true Drupal 8 fashion, we do this with a .yml or "yaml" (rhymes with camel) file. YAML is an acronym for "Yet Another Markup Language" or "Ain't Markup Language" and has become a core method for streamlining code in Drupal 8.

Here is a basic example of how you can add jQuery to a theme and a few dependencies. You'd do this by creating a *libraries.yml file in the root of your theme. So in my case my theme name is foobar so the file name would be foobar.libraries.yml.

foobar-corescripts:
  version: VERSION
  js:
    js/scripts.js: {}
  dependencies:
    - core/jquery
    - core/drupal.ajax
    - core/drupal
    - core/drupalSettings
    - core/jquery.once

With the above code, we'll be adding the core scripts jquery.js, drupal.js, ajax.js and jquery.once.js to our theme. This will make it available for anonymous users. With YAML, indentation spaces are relevant so you'll need to get that bit right. In addition, we are calling a theme relative script in the theme's js folder, scripts.js. The name -corescripts can be anything you want as long as it matches when you go to attach it in your .theme file as outlined below.

Attach the Library

The next step to actually attach the library we created with a theme preprocess function creating a variable in combination with the #attached method.

/**
 * Override or insert variables into the page template.
 */
function foobar_preprocess_page(&$vars, $hook) {
  // Render the library we defined in foobar.libraries.yml
  $libraries['#attached']['library'][] = 'foobar/foobar-corescripts';
  drupal_render($libraries);
}

Attaching the library above implements provider-namespaced strings i.e. 'gratis/foobar-corescripts' where previously it had an array associated with it. This is new in Drupal 8 Alpha 10 and it through me off for a while until I found a core issue that documented this change. Finally, we use function drupal_render to render the new library.

What's Next?

In a future Drupal 8 related articles, I'll get in to setting custom configuration for your Drupal 8 theme, this comes in real handy and we'll be using YAML with the added addition of using Drupal 8's CMI layer. I'll also talk more about API changes as they relate to themers, it's probably safe to do that now as Drupal 8 is most likely heading toward a beta within the next few months and it seems like many of the major core API changes have been done.

Tags 
  • Drupal
  • YAML
  • Drupal 8
  • Drupal Planet
  • Theming
Resources 
Categories: Drupal

Project Pitched, where to go from there? - by Daniel de Ridder

Gamasutra.com Blogs - 5 April 2014 - 11:23pm
So your a student and your two-man pitch got selected as one of the projects to work on in a four-man team. What do you do next?
Categories: Game Theory & Design

David Herron: Stopping server overload, cleaning up the site front page, disabling comments, and general goodness

Planet Drupal - 5 April 2014 - 11:09pm

The last few days the server hosting this site was overloaded, and I finally took a look at the access log, saw a continuous stream of requests that shouldn't be occurring, and realized the "links" row of teasers on the front page needed to go away. The default links row includes one reading "Log in to post comments" but this blog doesn't allow anybody else to register for an account, and in any case comments are handled by Disqus rather than Drupal's commenting system. The link didn't need to be there at all, and the more I looked at the links row the more useless it looked.


Categories: Drupal

Re-Imagining the Sound of Pre-School Games - by Rob Bridgett

Gamasutra.com Blogs - 5 April 2014 - 3:53am
This is a brief post-mortem on how the development team at Clockwork Fox Studios approached sound in the pre-school math title – Zorbit’s Math Adventure (iOS / Android).
Categories: Game Theory & Design

Unimity Solutions Drupal Blog: Where do you find the Drupal.org Software working group?

Planet Drupal - 4 April 2014 - 11:33pm

Did you know that the Drupal.org Software working group appointed by the Drupal Association provides co

Categories: Drupal

LibGDX in Depth series - Entry 01 - by Vijay Kartick Prem Kumar

Gamasutra.com Blogs - 4 April 2014 - 10:11pm
This blog series is just me talking to myself about how libgdx works. This will not be about how to write a game but about how LibGDX works on the inside, which will help me and you ofcourse to expand this awesome engine. disclaimer : I'm a noob
Categories: Game Theory & Design

David Herron: Do 3rd party commenting systems (Disqus et al) support my community, or theirs?

Planet Drupal - 4 April 2014 - 5:45pm

It used to be that Web 2.0 was the cool new thing, and a core feature was that the audience could leave comments on websites. It's common nowadays for websites to support comments, and comment areas have become (in some cases) a war zone full of partisan bickering. It was ground-breaking the 10ish or so years ago that websites began to support 3rd party comments. Really.


Topics: Online CommunityDrupal PlanetDisqustechsparx
Categories: Drupal

Drupal Association News: Drupal.org team week notes #23: Drupal Dev Days Szeged

Planet Drupal - 4 April 2014 - 1:05pm

This week’s notes will be all about something unique, which happened last week: a 7 day long sprint for Drupal.org.

Personal blog tags: week notes
Categories: Drupal

Blog: $5B in one year? Try one quarter, as game industry acquisitions heat up

Social/Online Games - Gamasutra - 4 April 2014 - 12:56pm

"Games M& A smashed a record >$5B in the three months to March 2014, after the prior full year record of $5.6B in 2013... The activity was driven by blockbuster transactions in both Asia and America." ...

Categories: Game Theory & Design

Tips for exhibiting your game

Social/Online Games - Gamasutra - 4 April 2014 - 11:27am

15 quick, simple tips for working a booth at a trade show, which covers everything from keeping your stamina going to connecting with fans -- and getting insights from those who don't like your game, too. ...

Categories: Game Theory & Design

Clash of Clans' monetization formulas demystified

Social/Online Games - Gamasutra - 4 April 2014 - 10:54am

"I set out to learn more about the hidden formulas at work," writes Wolfgang Graebner, before laying out his research -- including those formulas, as well as the actual costs of the F2P game. ...

Categories: Game Theory & Design

Game Jams or: How I Learned to Stop Worrying and Make Some Games - by Shaquille Stoutamire

Gamasutra.com Blogs - 4 April 2014 - 9:18am
With an infinite sea of game jams looming, the use of rapid game development events has permeated every perceivable game related community. What can, or should, we do?
Categories: Game Theory & Design
Syndicate content


about seo