Skip to Content

Newsfeeds

Wunderkraut blog: Adding a psuedo field

Planet Drupal - 2 April 2014 - 12:59pm

Sometimes you need to display a field that have no input, like a static text or image on each node, or a Facebook like button, or whatever that does not have an input, but you still want to display it as a field, for that you have the hook hook_field_extra_fields.

To display a psuedo field you just need two functions (these functions I added to a custom module called wk_extra_fields)

<?php
/**
* Implements hook_field_extra_fields().
*/
function wk_extra_fields_field_extra_fields() {
  $extra = array();
    // Just adding the psuedo field to the page node type.
    $extra['node']['page'] = array(
      'display' => array(
        'wk_foo' => array(
          'label' => t('WK: Foo'),
          'description' => t('A foo field.'),
          'weight' => -5,
        ),
      ),
    );
  return $extra;
}

/**
* Implements hook_node_view().
*/
function wk_extra_fields_node_view($node, $view_mode, $langcode) {
  // The field is showed in when using full view mode and on page node type.
  if ($view_mode == 'full' && $node->type == 'page') {
    $node->content['wk_foo'] = array(
      '#markup' => '<div class="wk-foo">Foo!</div>',
    );
  }
}
?>


So we use the function wk_extra_fields_field_extra_fields() to create the psuedo field for the page node type, after that we can activate it in the display tab, and choose where to show the field.

When we view the node, the function wk_extra_fields_node_view() is called and the content is displayed.

Image: "Air Guitar Championship" by AxsDeny. Attribution-NonCommercial-NoDerivs License

Categories: Drupal

Blog: Why first impressions matter for free-to-play games

Social/Online Games - Gamasutra - 2 April 2014 - 12:55pm

"People spend a short amount of time deciding if they like or dislike something (around 50 milliseconds). This gut reaction is often based on subconscious considerations." ...

Categories: Game Theory & Design

Blog: Dangerous advice - 'Worldbuild only enough to support the story'

Social/Online Games - Gamasutra - 2 April 2014 - 11:58am

"Instead of keeping writers on track, this advice can very easily create exactly the kind of hackneyed settings and narratives they so earnestly wish to avoid." ...

Categories: Game Theory & Design

How to Survive a Game-Dev Event (for Indies that Pay Rent) - by Tanya X Short

Gamasutra.com Blogs - 2 April 2014 - 9:25am
There's a lot of pressure in walking the line between art and business, and it comes into focus during conferences. One paycheck-aware indie speaks openly about her experiences, mistakes, and learnings from GDC 2014.
Categories: Game Theory & Design

Change(b)log: Commerce Marketplace payments

Planet Drupal - 2 April 2014 - 8:40am
The biggest step forward since From Commerce Store to Commerce Marketplace, my previous blog post in the Commerce Marketplace series, was added initial support for parallel payments.
Categories: Drupal

DrupalCon Austin News: Are You Ready for Drupal 8?

Planet Drupal - 2 April 2014 - 8:40am

You may not be able to control when Drupal 8 is ready. But you can control when you are ready for Drupal 8. Attending DrupalCon Austin is a great way to start.

Categories: Drupal

OhTheHugeManatee: How to Create a Custom Display Suite Field

Planet Drupal - 2 April 2014 - 8:12am

A few months ago I posted about how to create a custom Panels pane, a critical reference for anyone who uses Panels layouts. The other part of the toolkit for quick and awesome layouts is the Display Suite module. With DS you can create new “Display modes” for your content, to be reused around the site. For example, on one recent site I had four standard ways to display my nodes: Full, Teaser, Mini-Teaser, and Search Result. DS made this configuration a cinch.

But just as in Panels you sometimes need a pane that isn’t provided out of the box, in Display Suite you sometimes want to add a field that isn’t really a field on your content. In a recent site build, I used this capability to include information from the Organic Groups a user belongs to on his profile as it appears in search results.

DS offers some ability to create this kind of custom field through the UI, but I’m talking about more complicated outcomes where you need/want to use custom code instead. This is actually even easier than custom panels panes.

In our example, we will display the user’s name, but backwards. Obviously you can do much more complex things with this, but it’s nice to have a simple example!

Declare your fields

First we have to tell Display Suite about our new custom field. We do this with hook_ds_fields_info().

mymodule.module1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 <?php //@file: Add a custom suite to display suite for Users. /** * Implements hook_ds_fields_info(). * Declare my custom field. */ function mymodule_ds_fields_info($entity_type) { $fields = array(); if ($entity_type == 'user') { $fields['backwards_username'] = array( 'title' => t('Backwards Username'), 'field_type' => DS_FIELD_TYPE_FUNCTION, 'function' => 'mymodule_backwards_username', ); return array($entity_type => $fields); } return; }

Any guesses whathappens next? That’s right, we have to write our render function under the name we just declared. You can put anything here, really anything renderable at all.

mymodule.module1 2 3 4 5 6 7 8 /** * Render function for the Backwards Username field. */ function mymodule_backwards_username($field) { if (isset($field['entity']->name)) { return strrev($field['entity']->name); } }

That’s it. So simple, you’ll wonder why you ever did it any other way!

Categories: Drupal

Nobuo Uematsu to work on Defender's Quest 2 - by Lars Doucet

Gamasutra.com Blogs - 2 April 2014 - 8:03am
Legendary Final Fantasy composer Nobuo Uematsu will compose the main theme of Defender's Quest 2: Mists of Ruin. Details inside.
Categories: Game Theory & Design

Do You Play Games All Day? - by Matt Powers

Gamasutra.com Blogs - 2 April 2014 - 6:58am
Matt Powers tries to demystify what a producer is and gives his quick definition.
Categories: Game Theory & Design

Last Call Media: Drupal 8 Lessons for Developers

Planet Drupal - 2 April 2014 - 6:17am
Drupal 8 Lessons for Developers

A couple months ago, we decided to rebuild our company site on Drupal 8.  We had two goals in mind when we were planning the project.  First, we wanted to expose our developers to some real life scenarios in working with Drupal 8.  We had all been involved in the Drupal 8 development cycle in one way or another, but building a production site is very different from setting up a development instance.  Our second goal was to prove that it was possible to launch a feature complete Drupal 8 site without any contributed modules.  In my opinion, we succeeded on both counts.  There were certainly some snags in the process, but overall it was an enjoyable experience for everyone.  I’d like to share our major take-aways from the project with you.

1.  Stronger division between the “themer” and “module developer” roles  
The switch to object-oriented programming for all of the core subsystems has been talked about quite a lot.  And yes, it is a big transition.  Some crazy high percentage of our core code has changed or moved.  As a module developer, it’s going to be up to you to learn all about Routes, Plugins, Event Listeners, and more just to do the same things you used to use hooks for.  I don’t think anyone will argue that the new way is simpler for module developers.  But I was ready for that.  I transitioned from Drupal 6 to Drupal 7.  I remember that feeling of firing up the new version for the first time and feeling like you’re walking into your house after your mother-in-law dropped by for a visit - you know everything’s there, but you just don’t know where it is anymore.  
What caught me by surprise is how little has actually changed at the theme level.  Sure, there’s Twig, but when you get right down to it, Twig doesn’t even feel that different from raw PHP templates.  Once you learn the basics, my guess is that most people working with Twig will feel more comfortable there than in PHP code.  So, what’s really changed from the themer’s perspective?  Not a whole lot.  In fact, right now it feels like a conscious effort was made to keep things consistent at the theme level.  

2.  Fewer conflicts
I’ve been using and teaching Features for years, and there’s one question that always made me cringe: “How do I avoid conflicts/merge conflicts with my features?”  My answer would usually get very abstract and I’d be talking about packaging strategies and complex push/pull/revert commands.  Now that CMI is here, we have the tool we always wanted.  Instead of combining stuff into giant PHP files as Features does, CMI writes one file per configuration object.  While this sounds really verbose, it prevents a situation where you’d get a conflict if you and a coworker change different views in the same file, since every view is in it’s own file.  In the two-month development cycle we had for our website, I think we may have ended up with a single merge conflict resulting from configuration changes.

3.  No more packaging nightmares
This goes along with my previous point about CMI, but trying to teach the right way to use Features involved a lot of abstract and hand-wavey concepts like semantic grouping and composition (and that’s just for the way I consider right).  Now that we have a true configuration management tool, we don’t need to worry about packaging at all.  Think that through for a moment.  There is no longer a need to bundle components into groups.  It all goes into one big bucket for your site.  For those of you who actually do use Features for bundling reusable components, don’t worry.  Features already has a dev release for Drupal 8 that focuses solely on grouping config into modules.  

4.  You need an editor that autocompletes
Sorry, Notepad++ enthusiasts, but you’re going to want a bona fide IDE to do any serious development on Drupal 8.   Now that we’re using a lot of OO code, you can have a documentation trail that might be spread over 5-10 parent classes/interfaces.  It is extremely nice to be able to command+click a method name to go directly to the definition and read the docblock.  It’s even better to have your editor autocomplete the method name for you.  Plus, there are a lot more types of code in core these days (YAML, JSON, and others), and it’s nice to have syntax highlighting.

5.  Think global, act local
In case you hadn’t heard, theme(), drupal_add_js(), and drupal_add_css() functions have all been removed from Drupal 8.  The new way of doing things is to always return a render array.  The short explanation for this is that rendering stuff involves adding assets (CSS/JS) to the page, and when you call theme(), those assets are just added to a global variable somewhere.  That worked fine for Drupal 7, but since we’re a bunch of forward-thinking folks, we want our pages to be able to work with subrequests, which are a way of rendering a page using multiple processes. And guess what?  Separate processes don’t share global variables.  So, when you return the HTML for your cute little teddy bear field formatter, you should return a render array with your CSS/JS assets specified using the #attached property.

In summary…
Diving into Drupal 8 was a lot of fun for our team.  Yes, that’s right, I said fun.  We enjoyed it, partly because it’s the new stuff, and partly because it was our project.  Whereas we would have felt dangerously stressed doing our first Drupal 8 site for a client under a tight deadline, we were able to focus on learning the new workflows, contributing bugfixes, and developing best practices.  

We first posted about our Drupal 8 launch here.

Attached below are wallpaper ready versions of the image at the top of this post.

Categories: Drupal

What’s next for Kingdom Come: Deliverance - by Daniel Vavra

Gamasutra.com Blogs - 2 April 2014 - 4:47am
It’s over a month since our Kickstarter campaign ended and we’ve been keeping a bit quiet. Everyone is probably curious what we’re up to now. So here I am to tell you what our plans are for the upcoming months.
Categories: Game Theory & Design

Sexism in the game industry: A study

Social/Online Games - Gamasutra - 2 April 2014 - 3:00am

Research culled from a year of research and over 40 interviews with women working in the game industry, previously presented at GDC 2014. ...

Categories: Game Theory & Design

Blog: The challenges of creating an open-ended UI design

Social/Online Games - Gamasutra - 2 April 2014 - 1:29am

"We needed to figure out how to design a UI that looks just as great labeled as a cute kid's game as it does as a sleek racing title... Here are a few things I have learned during this past year." ...

Categories: Game Theory & Design

Modules Unraveled: 102 Project Management and ERP using ERPAL with Manuel Pistner - Modules Unraveled Podcast

Planet Drupal - 1 April 2014 - 10:00pm
Published: Wed, 04/02/14Download this episodeERPAL
  • What is ERPAL?
  • Why did you guys at Bright Solutions decide to build ERPAL? What did you need that wasn’t already available?
  • What are some of the features of the distro?
    • CRM (contact and activity management)
    • Project management (timetracking, payments, agil and fixed price, expenses, gantt charts, requirement management) with Freelancer support
    • Document management and document creation
    • Contract management with reccuring invoices
    • Employee management (over hours, holidays, costs)
    • Invoice creation and PDF export
    • Calendars
  • Tell me about the mobile app.
  • I noticed that there are some addon modules listed on the project page. Did you want to mention some of those?
    • ERPAL Task Templates
    • ERPAL Repeatable Tasks
    • ERPAL Project Reports
    • ERPAL CRM Reports
    • ERPAL Contacts Importer
    • ERPAL GIT integration
  • Is this basically Basecamp built with Drupal?
    • What features do they have in common?
    • What does ERPAL have that Basecamp doesn’t?
Use Cases
  • Do you know of anybody using ERPAL right now?
  • Who should use this?
    • Large companies?
    • Solo developers?
  • What’s the development status of ERPAL?
  • What’s in the future for ERPAL? What still needs to be done before a 1.0 release can be released?
  • How does Drupal benefit from something like ERPAL?
NodeSquirrel Ad

Have you heard of/used NodeSquirrel?
Use "StartToGrow" it's a 12-month free upgrade from the Start plan to the Grow plan. So, using it means that the Grow plan will cost $5/month for the first year instead of $10. (10 GB storage on up to 5 sites)

Episode Links: Manuel on drupal.orgManuel on TwitterBright Solutions WebsiteERPAL info siteTags: 
Categories: Drupal

Fred Parke | The Web Developer: Creating content types and fields with a custom module in Drupal 7

Planet Drupal - 1 April 2014 - 4:37pm

I was writing a custom module recently which used a custom content type or two. I wanted to make the module as reusable as possible but I also wanted to avoid including a feature inside of the module to add these content types.

Categories: Drupal

Propeople Blog: How to Configure CyberSource Secure Acceptance Web/Mobile in Drupal 7

Planet Drupal - 1 April 2014 - 4:31pm

Drupal is a great platform for ecommerce. If your business needs a Drupal website that accepts payments, a good payment system to use is CyberSource Secure Acceptance Web/Mobile. This tool allows business to accept payments made online, over the phone, and through mobile devices without ever handling toxic payment data. CyberSource is owned by Visa and integrates quite nicely with Drupal Commerce.

It consists of securely managed payment forms or as a single page payment form for processing transactions. This allows you to decrease your Payment Card Industry Data Security Standard (PCI DSS) obligations, thereby reducing any risks associated with handling or storing sensitive payment information.

In order to get this up and running on your Drupal website, you simply need to follow a few steps:

1. Create and configure Secure Acceptance profiles

2. Configure CybeSource profile with Drupal

3. See the results!

 

Creating a Secure Acceptance Profile

Important: For using a Secure Acceptance experience, an active profile is needed.

A Secure Acceptance profile consists of settings that you configure to create a customer checkout experience. In order to create a Secure Acceptance profile, you need to:

1. Log in to Business Center with Merchant ID:

Note: If you don't have a Merchant ID you will need to create one (https://support.cybersource.com/cybskb/index?page=content&id=C887)

2. In the left navigation panel, choose Tools & Settings > Secure Acceptance > Profiles > Create New Profile.

3. Enter Profile information

  • Enter profile name
  • Enter profile ID. The profile ID is case sensitive and must be exactly 7 alphanumeric characters. This field is used in each transaction to identify and display the Secure Acceptance profile.
  • Enter a profile description
  • Check Web/Mobile
  • Enter a company name
  • Check Payment Tokenization, Decision Manager, Enable Verbose Data

4. Click the Create button. The Profile Settings page appears. You must activate a profile in order to use it, and you must configure these required fields before activating a profile:

  • Payment Settings
  • Create a Security Key
  • Display a Customer Response Page

 

Configuring Payment Settings

You must select the card types that you wish to offer to the customer as payment methods. For each card type you select you can also manage currencies, CVNs, and payer authentication options.

The Card Verification Number (CVN) is a three- or four-digit number printed on the back or front of a credit card. This number helps to ensure that the customer has possession of the card at the time of the transaction.

To add a card type and enable the CVN you must:

1. On the “Profile Settings” page, click Payment Settings. The Payment Settings page appears.

2. Click Add/Edit Card Types. The Add/Edit Card Types window appears.

3. Check each card type that you wish to offer to the customer as a payment method.

4. Click Update.

5. Click the pencil icon in the column for each card type. The Edit Card Settings appears.

6. Check CVN Display and CVN Required to display the CVN field on Secure Acceptance.

7. On the “Currencies” section click Select All or select a currency and use arrow to move it from the Disabled list to the Enabled list.

8. Click Update

9. In the Automatic Authorization Reversals section (on the Payment Settings page) check Fails AVS check and Fails CVN check. Authorization is automatically reversed on a transaction that fails an AVS check or a CVN check.

10. Click Save.

 

Creating a Security Key

The security script signs the request fields using the secret key and the HMAC SHA256 algorithm. To verify data, the security script generates a signature to compare with the signature returned from the Secure Acceptance server. You must have an active security key to activate a profile. A security key expires after 2 years. The security key protects each transaction from data tampering.

To create and activate a security key:

1. On the “Profile Settings”page, click Security. The Security Keys page appears.

2. Click Create New Key. The Create New Key page appears.

3. Enter a Key Name (required).

4. Chose signature version Version 1.

5. Choose signature method HMAC-SHA256.

6. Click Generate Key. The Create New Key window expands and displays the new access key and secret key. This window closes after 30 seconds.

7. Copy and save the access key and secret key.

  • Access key: Secure Sockets Layer (SSL) authentication with Secure Acceptance.
  • Secret key: signs the transaction data and is required for each transaction.

By default, the new security key is active.

8. Click Return to Profile home. The “Profile Settings” page appears.

 

Displaying a Customer Response Page

You can choose to have a transaction response page displayed to the customer at the end of the checkout process, and a cancel response page displayed during the checkout process. Enter a URL for your own customer response page or use the CyberSource hosted response pages.

To redirect a customer after Check-out:

1. On the “Profile Settings” page, click Customer Response Pages.

2. Under the Customer Redirect after Check-out heading, enter the URL for the custom page that the customer will be redirected to after checkout.

3. Click Save.

 

Activate Profile

To make your profile active:

1. On the "Profile Settings" page, click Promote to Active

 

2. Your profile is now active!

 

Drupal Site Configuration

1. Install the Commerce CyberSource Secure Acceptance Web/Mobile contrib module.

2. Check that the module Payment UI is enabled.

3. From the Drupal admin menu, choose Store > Configuration > Payment Methods (or access path admin/commerce/config/payment-methods).

4. Select Edit Operation for payment method rule “CyberSource Secure Acceptance Web/Mobile”

5. Edit the rule action “Enable payment method: CyberSource Secure Acceptance Web/Mobile”.

6. In the Payment Settings section enter the Secure Acceptance profile details.

7. Enter Profile ID (configured during Step 3 -  Secure Acceptance Profile)

8. Enter Access Key and Secret key you created (see “Creating a Security Key” above)

9. Select Transaction mode:

10. Set Transaction Type to “Authorize Funds”

11. Locale (ex: English - American)

12. Set Payment method to “Card”

13. Enter text for Payment Submit Button Text.

14. Click Save.

15. On the Payment methods page, enable the rule for CyberSource Secure Acceptance Web/Mobile.


Now, on the completion of order you can select Credit Card as the payment method.

After you click on “Continue to Next Step”you wil berl redirected to the Cybersource site.

After completion, and the display of CyberSource payments details, you will be redirected back to your Drupal site.

And that's it! If you follow all of the steps above, CyberSource Secure Acceptance Web/Mobile should be configured on your Drupal 7 site in no time. Make sure to contact us if you are looking for a technology partner to help you ensure the success of your Drupal business or ecommerce website. 

Good luck. 

Tags: DrupalDevelopmentpayment systemecommerceDrupal for BusinessCyberSourceCheck this option to include this post in Planet Drupal aggregator: planetTopics: Tech & Development
Categories: Drupal

Greater Los Angeles Drupal (GLAD): GLADCamp Rebrands as VLADCamp; Focuses on Drupal for Evil

Planet Drupal - 1 April 2014 - 3:45pm

A new look for the Greater Los Angeles Area Drupal Camp has been unveiled. “VLADCamp” is the new name of the conference, co-organized by Greater Los Angeles Drupal organizing team member Christefano Reyes, who announced the name as it epitomizes the goals for the organization moving forward.

“GLADCamp was originally envisioned as being the Drupal community's marquee event of the year that heavily focuses on the needs of non-profits, education and civic engagement. After trying 'Drupal for Good' this year, we decided that 'Drupal for Evil' would be more fun,” he explained.

This marks a major shift in strategy for the user group, which for nearly 4 years has provided Drupal resources, including its Business Directory and Governance Policy, and events, including this year's inaugural GLADCamp conference.

"It's difficult growing a brand that's known for so many different things, such as meetups, job fairs, coworking days, study group sessions, workshops, code sprints and conferences," he said. "Now we stand for just one thing: Evil. We think our members will appreciate this simplification. Besides, being completely transparent and accountable is too hard."

According to Holly Ross, executive director of the Drupal Association, a non-profit whose mission is to foster and promote the Drupal software and community, "There is currently no other Drupal user group on our radar who is so blatantly dedicated to this behavior. We've been monitoring several user groups that have little transparency, little accountability or little consistency, but this is the first time we've seen a user group without all three," she said in a phone interview. "We're continuing to monitor the situation."

The VLADCamp organizing team is delighted with the impact of its new name and logo, which has been developed in consultation with Acquio, based in Burlington, Massachusetts. "We enjoy working with forward-thinking organizations who can pivot and provide value to underserved markets," said Acquio CMO Tom Wentworth, who featured VLADCamp as a successful launch partner of its content personalization service, Acquio Escalator.

Tags: Planet DrupalApril Fools Day
Categories: Drupal

Cocomore: DrupalDevDays Szeged 2014

Planet Drupal - 1 April 2014 - 1:45pm

The last week three of us from Cocomore went to the little town of Szeged in Hungary around 175km south east of Budapest.

The DevDays were all about developing Drupal 8 further and enhance drupal.org. The only topic was contributing to Drupal in the one way or the other. Whatever you are, either a developer, a themer, a site builder, a devop or a business man, everyone has his/her part in this amazing community and everyone found a spot where he/she could help to foster Drupal further.

read more

Categories: Drupal

DrupalCon Austin News: DrupalCon Austin Sessions are Posted!

Planet Drupal - 1 April 2014 - 1:14pm

How’s this for a session title? “Newfangeldy mobile and front-end crap for people who last touched front-end code back when grunge was a thing.”

Or this one? "Markup Ain't Easy or: How I Learned to Stop Worrying and Love An Object-Oriented RenderAPI"

Categories: Drupal

Morten.dk: fields theming in Drupal8, kill the divitis

Planet Drupal - 1 April 2014 - 12:35pm

I finally got to take a long & hard look at fields and why they have so much divitis + a solution of how to change it for Drupal8. It ended up beeing a ton of markup & css examples on a flat html page
take a look please provide feedback, here or on the issue or at my twitter etc.

read more

Categories: Drupal
Syndicate content


about seo