Feed aggregator

J-P Stacey: Architecting a Drupal 7 module into multiple files

Planet Drupal - Mon, 22/06/2015 - 16:42

In the Drupal modules that I inherit or review, I see a lot of different ways of factoring out into separate files, of what might have begun in the main module file. This can be useful for performance (to a limited extent) and legibility, but depending on how you do it, you might end up ironically spoiling both.

How should you break down your Drupal module files? Well, I'm not here to tell you the perfect file breakdown. Matching the architecture is good, although what "the architecture" means in Drupal 7 isn't clear. Outside of a Drupal 8/Symfony-style architectural model, there's a limit to how much the file breakdown really needs to match the architecture, and a limit to how useful doing so would be.

Read more of "Architecting a Drupal 7 module into multiple files"

Categories: Elsewhere

BlackMesh: Summer Drupal 8 Sprints

Planet Drupal - Mon, 22/06/2015 - 16:03

Sprints are times dedicated to focused work on a project or topic. People in the same location (physical space, IRC, certain issue pages) work together to make progress, remove barriers to completion, and try to get things to "done".

This summer, there are many Drupal 8- focused sprint opportunities before DrupalCon Barcelona.

Some of these are open to everyone, some have mentors or workshops to help new contributors, some have limited space, depending on the event.

Earlier this summer

DrupalCon Los Angeles had very productive extended sprints, and the main sprint on Friday was huge! Since then, many sprints have continued the progress, including: Drupal Camp Spain, DrupalCamp Wroclaw, Moldcamp in Chișinău, Moldova, and Frontend United.

And, we had two sprints (New Hampshire and New Jersey) aided by Drupal 8 Accelerate. If you have more money than time for sprinting or resources for planning or hosting a sprint, and you want to help get Drupal 8 out, giving to D8 Accelerate really helps.

New Hampshire, USA

The Drupal 8 critical meta issue on SafeMarkup was a focus of the New Hampshire, USA sprint.


(photo: @Cottser)

Jersey Shore Sprint, New Jersey, USA
#DrupalCampNJ


crowdcg, kgoel, cilifen, jcloys (who got a first Drupal Core commit mention), akalata, davidhernandez, Ryan Weal.
(photo: pwolanin, cropped)

Continuing from the New Hampshire sprint, a main focus of the Jersey Shore sprint was the Drupal 8 critical meta issue on SafeMarkup. (I was there too.)

Coming soon! Go to one! June 25-28, 2015
Twin Cities Drupal Camp, Minneapolis, Minnesota, USA
@TCDrupal #TCDrupal

Sprints are concurrent with the training day on Thursday, and concurrent with sessions Friday and Saturday. The dedicated sprint day is on Sunday. We are expecting about 10 people on Thursday and 60 people on Sunday. Sunday will have a workshop for new contributors, Core/Contrib sprints, and a Drupal 8 Manual sprint.

See the sprint page on the tcdrupal.org site for details.

June 25-28, 2015
Drupal North, Toronto, Canada
@DrupalNorth

Sunday is a dedicated Drupal 8 sprint day. There will be a small unofficial sprint on Thursday.

The whole 4 day camp is focused on Drupal 8.

June 28, 2015
Antwerp, Belgium

This is a dedicated one day sprint to help get Drupal 8 out.

See the announcement for details.

July 2-8, 2015
D8 Accelerate critical issue sprint, London

This 7 day sprint will be focused on Drupal 8 critical issues and space is limited.

See the groups.drupal.org post for details.

July 4, 2015
DrupalCamp Bristol, United Kingdom
@DrupalCampBris #dsbristol

Sprints will run concurrent with sessions on Saturday.

July 16-19, 2015
NYC Camp, New York, USA
@NYCCamp_org #NYCCamp

Monday to Wednesday are sprint only days, with Drupal 8 Core and Media for Drupal 8 scheduled. Panopoly is scheduled for Tuesday and Wednesday. Sprints will also be concurrent with trainings, summits, and sessions on Thursday through Sunday.

See the sprint page on the nyccamp.org site and the schedule for details.

July 22-26, 2015
DrupalCamp North, Sunderland, United Kingdom
@DrupalCampNorth

Wednesday to Friday are dedicated extended sprint days and there will also be a sprint room at the camp concurrent with sessions on Saturday and Sunday.

July 22-26, 2015
GovCon, Bethesda, Maryland, USA
@DrupalGovCon #DrupalGovCon

GovCon conference is July 22-24 with sprints concurrent with sessions, but there will be two dedicated sprint days following on Saturday and Sunday, July 25 and 26 in Washington, DC at the ForumOne offices.

August 6-9, 2015
Drupalaton, Hungary
@Drupalaton #Drupalaton

Sprints will be concurrent with the camp all days.

Last year was super focused and relaxing.

August 12-15, 2015
MidWest Developers Summit (MWDS), Chicago, Illinois, USA
#MWDS2015

4 days of only sprinting, hosted in the Palantir.net offices.

Details still to be announced. See the groups.drupal.org event page for more details.

September 11-18, 2015
Montréal to Barcelona Sprint, Montréal, Canada

For some people in North America, Montréal could be on the way to Barcelona, where DrupalCon extended sprints start September 19.

See the groups.drupal.org event page for more details.

P.S.

I will be at Twin Cities, GovCon, and MWDS.

Thanks to @klobutschar for fast changes to http://www.drupical.com to show the sprints even better.

Thanks to @mparker_17, @da_wehner, @ievauzule, @zsofimajor, @royscholten, @adshill, @ryan_weal, @kristen_pol, @emma_maria88, @opdavies, and @davidnarrabilis for helping me find more events.

Drupal PlanetDrupalSprints
Categories: Elsewhere

InternetDevels: DrupalTour siteseeing

Planet Drupal - Mon, 22/06/2015 - 15:38

If you want pizza you can either go to cafe or order delivery, right? So why should Drupal be different? :) We made Drupal delivery possible to any Ukrainian city with DrupalTour!

Read more
Categories: Elsewhere

Annertech: Tough at the top (of Google) - Content Strategy, SEO, and Low Bounce Rates

Planet Drupal - Mon, 22/06/2015 - 12:44
Tough at the top (of Google) - Content Strategy, SEO, and Low Bounce Rates

Annertech is #1 on Google for a number of key search phrases and when we're not, we're usually only beaten by the Drupal Ireland page from g.d.o. (groups.drupal.org/ireland). How did we get to the top of Google? How do we stay there? Two words: hard work - but it really revolves around two other words: content strategy. Let's get down to the details.

Categories: Elsewhere

LevelTen Interactive: DrupalCon LA 2015 Video: Mediacurrent Interview

Planet Drupal - Mon, 22/06/2015 - 07:00

In last weeks' DrupalCon interview, we featured Percona.... Read more

Categories: Elsewhere

Midwestern Mac, LLC: DrupalCamp St. Louis 2015 finished, session videos available online!

Planet Drupal - Sun, 21/06/2015 - 20:28

DrupalCamp St. Louis 2015 was held this past weekend, June 20-21, 2015, at SLU LAW in downtown St. Louis. We had nine sessions and a great keynote on Saturday, and a full sprint day on Sunday.


The view coming off the elevators at SLU LAW.

Every session was recorded (slides + audio), and you can view all the sessions online:

The Camp went very well, with almost sixty participants this year! We had a great time, learned a lot together, and enjoyed some great views of downtown St. Louis (check out the picture below!), and we can't wait until next year's DrupalCamp St. Louis (to be announced)!

Categories: Elsewhere

Wim Leers: Eaton & Urbina: structured, intelligent and adaptive content

Planet Drupal - Sun, 21/06/2015 - 20:08

While walking, I started listening to Jeff Eaton’s Insert Content Here podcast episode 25: Noz Urbina Explains Adaptive Content. People must’ve looked strangely at me because I was smiling and nodding — while walking :) Thanks Jeff & Noz!

Jeff Eaton explained how the web world looks at and defines the term WYSIWYG. Turns out that in the semi-structured, non-web world that Noz comes from, WYSIWYG has a totally different interpretation. And they ended renaming it to what it really was: WYSIWOO.

Jeff also asked Noz what “adaptive content” is exactly. Adaptive content is a more specialized/advanced form of structured content, and in fact “structured content”, “intelligent content” and “adaptive content” form a hierarchy:

  • structured content
    • intelligent content
      • adaptive content

In other words, adaptive content is also intelligent and structured; intelligent content is also structured, but not all structured content is also intelligent or adaptive, nor is all intelligent content also adaptive.

Basically, intelligent content better captures the precise semantics (e.g. not a section, but a product description). Adaptive content is about using those semantics, plus additional metadata (“hints”) that content editors specify, to adapt the content to the context it is being viewed in. E.g. different messaging for authenticated versus anonymous users, or different nuances depending on how the visitor ended up on the current page (in other words: personalization).

Noz gave an excellent example of how adaptive content can be put to good use: he described how we he had arrived in Utrecht in the Netherlands after a long flight, “checked in” to Utrecht on Facebook, and then Facebook suggested to him 3 open restaurants, including cuisine type and walking distance relative to his current position. He felt like thanking Facebook for these ads — which obviously is a rare thing, to be grateful for ads!

Finally, a wonderful quote from Noz Urbina that captures the essence of content modeling:

How descriptive do we make it without making it restrictive?

If it isn’t clear by now — go listen to that podcast! It’s well worth the 38 minutes of listening. I only captured a few of the interesting points, to get more people interested and excited.1

What about adaptive & intelligent content in Drupal 8?

First, see my closely related article Drupal 8: best authoring experience for structured content?.

Second, while listening, I thought of many ways that Drupal 8 is well-prepared for intelligent & adaptive content. (Drupal already does structured content by means of Field API and the HTML tag restrictions in the body field.) Implementing intelligent & adaptive will surely require experimentation, and different sites/use cases will prefer different solutions, but:

  • An intelligent_content module for Drupal 8: allow site builders/content strategists to define custom HTML tags (e.g. <product_description>) to capture site-specific semantics. A CKEditor Widget could hugely simplify the authoring experience for creating intelligent content, by showing a specific HTML representation while editing (WYSIWOO!), thanks to HTML (Twig) templates associated with those custom HTML tags.
  • An adaptive_content module for Drupal 8: a text filter that allows any tag to be wrapped in a <adaptive_content> tag, which specifies the context in which the wrapped content should be shown/hidden.
  • The latter leads to cacheability problems, because the same content may be rendered in a multitude of different ways, but thanks to cache contexts in Drupal 8 and the fact that text filters can specify cache contexts means adaptive content that is still cacheable is perfectly possible. (This is in fact exactly what it was intended for!) cache contexts

I think that those two modules would be very interesting, useful additions to the Drupal ecosystem. If you are working on this, please let me know — I would love to help!

  1. That’s right, this is basically voluntary marketing for Jeff Eaton — you’re welcome, Jeff! 

  • Drupal
  • WYSIWYG
  • structured content
Categories: Elsewhere

Blue Drop Shop: Camp Record Beta Test Four: DrupalCamp STL 2015

Planet Drupal - Sun, 21/06/2015 - 17:58

Following a successful MidCamp and with some new ideas how to improve the kit, I was eager to hit the road for more testing. Problem is, I'm a freelancer with a limited budget, and getting to camps comes out of my own pocket. On a lark, I tweeted the following:

Planning a #drupalcamp and need your sessions recorded? Sponsor me & I will record your sessions. Ping me! #drupal /cc @drupalstl @tcdrupal

— Kevin Thull (@kevinjthull) April 8, 2015

To my delight, both Twin Cities and St. Louis camps took me up on my offer. Of course, the stakes are even higher now, because it's no longer my own money on the line.

But I'm also feeling more confident about this solution and improve on the process with each camp. Connecting to non-HDMI-capable laptops remains the biggest challenge overall. I've added in a couple (full) DisplayPort to HDMI converters and even successfully tested a new VGA to HDMI converter that got my ancient Sony VAIO to display on my home flatscreen:

The new VGA to HDMI converter shows promise. My ancient Sony Vaio WinXP laptop just connected! #drupalcamp pic.twitter.com/PXb0kBvsCl

— Kevin Thull (@kevinjthull) June 16, 2015

And at DrupalCamp STL I finally got the 100% success rate that I've been shooting for! Three sessions needed fixing in post, but overall, this camp went very smoothly. A huge bonus was the fact that the two rooms were next to each other, minimizing the distance to cover when trying to coordinate laptop hookups and verify timely starts and stops of the records.

Twin Cities is next week, with a much more challenging schedule: five concurrent sessions across two buildings and multiple floors. My Fitbit will likely hit a new high. That, and I need to finally get down to some documentation and podium signage. It's time to share the knowledge I've gained and get more hands and minds involved.

And now for the learnings from DCSTL:

  • swapping thumb drives throughout the day means recordings can be posted during camp
  • well-timed presenter starts/stops means no trimming, which means more recordings can be posted during camp
  • one room had screen flicker and setting the PVR resolution to 1080 helped (typically, the resolution needs to come down to 720 for this, as well as fixing color shifts)
  • having extra SD cards means bad audio can be fixed during down times, which means more recordings can be posted during camp
  • power strips at the podium shouldn't be assumed, and the powered USB hub and voice recorder both have short plugs
  • never plug the powered usb into the laptop, because that can kill your record if resolution changes or the laptop goes to sleep
  • taping down individual components means less cord chaos throughout the day
  • access to ethernet port with a reasonably large pipe going up will get videos posted faster
Tags:
Categories: Elsewhere

Drupal core announcements: Requiring hook_update_N() for Drupal 8 core patches beginning June 24

Planet Drupal - Sat, 20/06/2015 - 02:58

In [policy, no patch] Require hook_update_N() for Drupal 8 core patches beginning June 24, the Drupal 8 release managers outline a policy to begin requiring hook_update_N() implementations for core patches that introduce data model changes starting after the next beta release. The goal of this policy change is to start identifying common update use-cases, to uncover any limitations we have for providing update functions in core, and to prepare core developers for considering upgrade path issues as we create the last few betas and first release candidates of Drupal 8. We need your help reviewing and communicating about this proposed policy, as well as identifying core issues that will be affected. Read the issue for more details.

Categories: Elsewhere

Drupal Association News: Updates to our 2015 Financial Plan

Planet Drupal - Fri, 19/06/2015 - 20:41

I want to share today that the Association is implementing a new financial plan to address lower than anticipated revenues in 2015. To align our spending more closely with our revenue, we are implementing expense cuts that I’m very sorry to say include staffing. Regrettably, we are losing three staff people today from operations, engineering and our community teams. This was not a decision we came to lightly, and we’re committed to helping those staff through their transition as best we can. In this post I want to share some information about how we got here, and our revised plan.

A Brief history

This is a really hard post to write because we delivered a plan to the community at the beginning of 2015, and it’s clear that we are not going to be able to fully execute to that plan. I take responsibility for that.

I started at the Association two and half years ago, at a very different time for the organization. At that point in early 2013, the Association was a handful of staff, mostly focused on the DrupalCons. The D7 upgrade of Drupal.org had been halted. Not without some good reason, community trust in the Association was low, and that’s among the people who even knew the Association existed.

When I joined, the message I heard from the board and from the many community members I talked to was that the Association had to learn to implement consistently and communicate more. In other words, we needed to build our credibility in the community by executing our work well and making sure the community knew what we were up to and how to get involved.

One thing that was clear from the outset was that Drupal.org was key to our success. If we could not begin to make visible improvements to Drupal.org with the community, we would fail. With support from the board, we decided to invest our healthy reserve in ourselves and build a team that could improve Drupal.org. As our CTO Josh Mitchel pointed out in his anniversary blog post, we’ve done a LOT on Drupal.org. We’ve also made great strides in DrupalCons, introducing more first-time attendee support, providing more resources to all the sprints, and adding the third Con in global communities that are so eager to have us there. Our marketing team has helped create some key content for Drupal 8 and we’ve even raised over $210,000 to help fund the completion of D8 release blockers, The revenue we generate to do this work has also increased, and diversified. We've grown the Drupal Jobs, and rolled out Try Drupal. You can see, even with our revised expectations for 2015, that things are still growing. One of our key programs, Supporting Partners, is up 26% over this same time period last year, for example. Growth of this program was only 4% in 2014.

 

So lots of amazing things are happening, but we have to address that we overestimated what was possible for revenue. We have to adjust our plan to meet reality.

Changing the Plan

Addressing our situation is not work we took lightly. We set several goals for the process that guided our thinking throughout:

  • Solve for short-term revenue shortfalls while retaining resources we need to succeed long-term
  • Minimize staff impact
  • Do this once - find the scenario we can truly sustain, and then grow out of
  • Retaining credibility with staff and ensuring we communicate how valuable they are for our future
  • Maintain community confidence

The strategy we used was two-fold. First, we strove to preserve our core services to the community and our ability to fund our own work. Second, we decided to take action as quickly as possible because the sooner we made changes to the plan, the greater the long-term benefit to the organization. We know that this second strategy makes some of this seem like it's out of the blue, but it means that we impact as few people as possible.

Our leadership team looked at three approaches to addressing our cash flow issues:

  • Incremental revenue: Our new forecast extends actuals from the beginning of 2015 out through the end of the year. We believe that it is possible for us to improve upon this forecast slightly because, although our primary mistake was overestimating revenue, we also had some staffing change-ups (a retirement, hiring new reps) on the team at the beginning of the year that adversely affected the numbers. There is some room to modestly improve our revenue from the forecast.
  • Non-labor expense: We looked at travel, consulting fees, hardware and software, among other places in the budget where we had built in buffers or non-essential expenses. Eliminating these now, and not carrying them into 2016 was a key part of our process.
  • Labor expense: This was the last option we looked at because at the end of the day, not only do all our staff give the community everything they’ve got, we really like each other here. I care deeply for the well-being of everyone at the Association. There is also lot of discussion in the business community about the long-term negative impacts of layoffs on organizations. We looked at lots of ways to reduce labor expense, but were not able to find a solution that did not include some layoffs.

Using this process, we were able to identify $450,000 in non-labor expense savings, and increase revenue projections $250,000 from July 1 2015 through December 31 2016. That was enough to solve our 2015 revenue shortfalls, but it did not address the issues long-term. We needed to reach deeper to ensure our long-term success. We had to consider labor reductions.

Prior to looking at any other staff, the leadership team at the Association decided that the first staff cut had to come from us. As a team, Megan, Joe, Josh, and Matt volunteered a 10% reduction, and I volunteered a 15% reduction. But we still weren’t there. Looking at the remaining labor cuts, we wanted to use our values as our guide. We know that our team believes in our teamwork value above all else, and would want to minimize layoffs as much as possible. With that in mind, we experimented with the model and determined that we could limit layoffs to three if we asked remaining staff to take a 5% pay cut across the board.

All told, here’s what measures look like:

 

We believe this approach meets our goals and puts us in the best position possible to continue the great work we’ve been doing.

What Happens Next?

On the financial front, we’ll be managing to our cash flow for the next 18 months, as well as modernizing our budgeting and forecasting tools to reflect an Agile methodology. This will let us see further into the future more often, and give us more opportunities to update our plans based on what’s actually happening. And, if we find we are performing favorably to our plan, our first action will be to restore salaries for our staff.

Most importantly, we’re going to be focused on our team. They all got the news earlier today, and we’re taking this time to talk things through all together, in our teams, and one on one. I am here to answer questions and hear concerns for every one of them. We’ll also implement monthly internal review of our progress to the new plan with staff so that they have transparency on a monthly basis about what’s happening. These people are the best thing we have going for us, and I won’t ever be able to make this up to any of them, but I am committed to helping them find the best path forward they can.

Thank you

Sharing this is not easy. The only thing that makes it better is knowing that the Association, like Drupal itself, has so much potential. I want to thank our Supporters, partners, sponsors, members, and the general community for everything you’ve given us so far. The only way we will realize our potential and move forward is together, and we are so happy that we get to do that with you.

Categories: Elsewhere

LevelTen Interactive: Drupal 8: Marketer Friendly

Planet Drupal - Fri, 19/06/2015 - 19:12

The digital marketing world keeps changing, basically every day, or whenever Google decides it’s time to change their algorithm. As a person who practices digital marketing, I know the challenges of working with a CMS and the need to for it to allow me to publish blog posts (like this one) easily and have it be mobile responsive, because who uses actual computers these days?... Read more

Categories: Elsewhere

Vasily Yaremchuk: Anchors Panels Navigation Module as an Excellent Alternative to Single Page Website Module

Planet Drupal - Fri, 19/06/2015 - 18:30
Background

Several years ago I was working on my personal Web site. Even in that time One Page solutions were very popular for some presentation, personal or CV pages.

The main idea of such approach to put all information on one long page with several link anchors corresponding some separate sub-sections of this page.

In 2011 Single Page Website module was created. Initially my home page was done on the base of this module.

Single Page Website module is good out of box solution for Drupal beginners but it has a lot of weak points connected with it's architectural solution. Some more information about this module you can see in my report on Kiev Drupal Camp 2011.

Frustration due to Single Page Website module

It was my fault to build single page on the base of my custom solution without some prepared and ready to use approaches (Views or Panels for example) that can put several nodes or other content entities together on one page. And according incorrect architecture Single Page Website module has a lot of restrictions. The most significant one is theme restriction. Module works with limited number of themes. Also on the module there is out of box ability to have only one page with anchor navigation from menu.

So we should have only one language One Page Website. And the last frustrated feature of the module we should have anchors links in menu only without links to some internal or external pages.

New Approach based on Panels

I'm start working on the other solution about one year ago, see my post Anchors Panels Navigation Module. And now I have some stable version of Anchors Panels Navigation Module with no theme restriction and with manual anchor name management.

Of course, new approach is Panel based and it require several modules to be installed. Also to set One page website driven on Anchors Panels Navigation module takes more time than on the base Of Single Page Website one. But this solution more flexible. You can use several menus, and links in blocks and content for one page navigation. Also you can use this module to set on your site several Landing Pages and the number of such pages is not limited!

If you would like to set Landing Page solution on the base of Anchors Panels Navigation module you should do a lot of manual work in Drupal admin area.

  1. In addition to setup this module you should create node with type Panel and put several pieces of content in the panes.
  2. Set CSS IDs to each pane that should have #anchors. The name of #anchors will be equal to the names of CSS IDs.
  3. To set links in menu with #hashes. You can use absolute links to your site (like I use on my personal site) or use Void Menu Module (I think it is overkill approach).
  4. To make this menu fixed in the browser window. You can use Code per Node module or Floating Block module or, of course, put required CSS code directly in your theme.

After this steps Anchors Panels Navigation module module will take care about scroll to you anchors when visitors will click to the links and about #hash changing in browser address string. By the fact this new approach less complex than Single Page Website module. It has less PHP and JS code and cause less problems to the site developers I hope :-)

What will be the next step?

After one year of developing and using this module I find out that "Anchors Panels Navigation" is not good name for this module according marketing view. It reflects some architectural semantic core of the module but there is no any ideas about module applying in the name of the module. So I would like to ask Drupal community about better name for this module.

Other solutions

It is fair to mention some other solutions belong to the other developers.

There is Drupal Distribution One Page CV created by Ukrainian Drupal Developer Artem Shymko.

There is Single Page Site module developed by Belgium Drupal Developer Robin Ingelbrecht. This module has no theme restriction such as Single Page Website module but there is no ability do more than one Landing Page into one Drupal site also there is no anchors in address line that does not allow to send link on separate block in the One Page site. But in this module there is beautiful Next Page submodule, and it works perfect, see http://www.starfisk.com.

Please let me know is there are some other Drupal based solutions that I should mention here.

Blog tags: Planet Drupal
Categories: Elsewhere

Acquia: Drupal: Helping NGOs & Civil Society in Myanmar and beyond

Planet Drupal - Fri, 19/06/2015 - 16:11
Language Undefined

When Tom Feichter told me he only gets to one Drupal event a year, I wanted to know why. When he told me it's because he runs a Drupal shop–mspiral creative media–in Yangon, Myanmar, I had to know more! We talked about Tom's history in Drupal, how Drupal's multilingual capabilities have helped him, how excited he is about Drupal 8's architecture, his history working with NGOs on the Thai/Burmese border and how that has flowed into ethical digital agency work, and more.

Categories: Elsewhere

Blink Reaction: Building Native Apps - Part 4

Planet Drupal - Fri, 19/06/2015 - 15:00
Building native mobile apps with Ionic Framework and Drupal back-end: request data from Drupal Define app constants

Now we have a REST server from which we will get all required data for our application. First of all let’s define an Angular constant and store some configuration variables in it - for example, where we’ll we set the base url for services requests. In the app.js file, add a new constant method with that value.

gist link

Ionic Framework comes with a couple of useful directives that can help in app building. I decided to make one small user experience improvement: when categories list our article details page as loading, we should show a loading overlay to indicate progress. To do this, we will use the $ionicLoading service. To change its default options you must add another constant - $ionicLoadingConfig - to the app.js file.

gist link

Configure services

Previously, we had defined factories for categories and articles in the services.js file, but the endpoints were empty. Now we can set them. First of all, we have to transfer newly created config objects to the factories and prefix url property value in $http options object with config.serviceBaseUrl. We should also pass the page parameter to Categories get and Articles all methods to handle pagination. And finally we set endpoint variables. Here is the final services.js:

gist link

Complete templates

Now we should create templates for each tab using Ionic directives. Let’s look closer at the index.html file. Here we have a main Angular directive ng-app, which defines our app on a global scope; inside it we can see ion-nav-bar, the global dynamic navigation bar. Next to it there is the ion-nav-view directive; this helps to handle application routing according to the UI Router config in app.js. All template content should render inside this directive.

The first screen of our app is a tab with an all articles list, using the tab-articles template. Here we use ion-view to define the tab controller scope and set the title of this page with the view-title directive. Inside this view we set the container for content with ion-content. Inside it we set ion-list with an ion-item child. Also, we set the ng-repeat directive in ion-item. Angular should walk though all articles data and render each article with title and image; for image, we use ng-src directive instead of src attribute. At the bottom of ion-content we add ion-infiniteiscroll - it gives us an opportunity to portionally load more articles.

gist link

The template for the single category is very similar to the articles tab; the changes are in the link structure to the article details pages, and the view title, which in this case will be the name of the current category.

gist link

On the categories tab we should show the list of categories with the number of articles in each; the list item should be linked to a single category page.

gist link

The last template that we need is an article-details.html. Here, we will show the article image, title and body text. We use the ng-bind-html directive to render the body with its html markup, for example: paragraphs, lists, links etc..

gist link

Controllers

Previously we have created empty controllers for all templates, so we will add the code for them now. We should start from more simple controllers: CategoriesCtrl and ArticleDetailCtrl. CategoriesCtrl are attached to the tab-categories template; we will pass the $ionicLoading service to it, to show data loading progress to user. Inside this controller we show a loading overlay calling the show method on $ionicLoading, and load categories list with Categories factory. All of our factories return promises, so after the call it method we then add the method in which we pass 2 functions: first will run on success, second on error. In this tutorial I route all error messages to the browser console.

gist link

ArticleDetailCtrl is the same, but here we get an article data by its id, which we get from the state parameter.

gist link

CategoryCtrl and ArticlesCtrl are similar so we define a loadMore function in them, that will try to load more articles on scrolling the page down and concatenating them with articles that have been already loaded. Then it will broadcast that the infinite scroll process was completed, and there are no additional results.

gist link

gist link

You can clone and try all this code from my github repository; to get code for this part, checkout the part4 branch(just run “git checkout -f part4”).

Test, build and compile

Before compiling and testing an app on an emulator or real device you may run it in the browser with command “ionic serve” from you project directory.

If the application worked fine in your browser you can test it in emulators, but first let’s add a platform to our project with command “ionic platform add android”, if you are using a Mac you can also add iOS platform with the command “ionic platform add ios”. Before running the app in emulator you must build it and run “ionic build android” (“ionic build ios” for iOS app). Then you can try the application in emulator by running “ionic emulate android” to emulate it in the native Android emulator that comes with Android SDK, or by running “ionic run android” to use the Genymotion emulator (it is faster and has a lot of device settings), which you can get here.

To emulate iOS you must work on Mac OS and run “ionic emulate ios”.

To build apps for production you must run

“cordova build --release android”

then navigate to project folder platforms/android/ant-build/ and generate a key to sign app -

“keytool -genkey -v -keystore starter-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000”

and sign your application -

“jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore starter-release-key.keystore CordovaApp-release-unsigned.apk alias_name”.

To optimize your apk you should run

“zipalign -v 4 CordovaApp-release-unsigned.apk TutorialApp.apk”

and you will be ready for publishing the file TutorialApp.apk in Google Play. You can find more information about publishing available here.

 

In the next part of this series I will show how to integrate user authentication in your app with Drupal session login.

DrupalBest PracticesDrupal How toDrupal PlanetDrupal TrainingLearning SeriesPost tags: AppsIonic
Categories: Elsewhere

Drupal core announcements: Recording from June 19th 2015 Drupal 8 critical issues discussion

Planet Drupal - Fri, 19/06/2015 - 12:37

This was our fourth critical issues discussion meeting to be publicly recorded in a row. (See all prior recordings). This time to make discussions easier to follow for all of us, we switched to #drupal-contribute in IRC to post links, so those following real time can follow the links and we can just paste the meeting log here as well. Here is the recording of the meeting from today in the hope that it helps more than just those who were on the meeting:

Unfortunately not all people invited made it this time. If you also have significant time to work on critical issues in Drupal 8 and we did not include you, let me know as soon as possible.

The meeting log is as follows (all times are CEST real time at the meeting):


[11:07am] plach: https://www.drupal.org/node/2478459
[11:07am] Druplicon: https://www.drupal.org/node/2478459 => FieldItemInterface methods are only invoked for SQL storage and are inconsistent with hooks [#2478459] => 93 comments, 19 IRC mentions
[11:07am] dawehner: https://www.drupal.org/node/2500527
[11:07am] Druplicon: https://www.drupal.org/node/2500527 => Rewrite \Drupal\file\Controller\FileWidgetAjaxController::upload() to not rely on form cache [#2500527] => 34 comments, 6 IRC mentions
[11:08am] plach: https://www.drupal.org/node/2453153
[11:08am] Druplicon: https://www.drupal.org/node/2453153 => Node revisions cannot be reverted per translation [#2453153] => 107 comments, 31 IRC mentions
[11:09am] jibran: https://www.drupal.org/node/2263569#comment-10039344
[11:10am] Druplicon: https://www.drupal.org/node/2263569 => Bypass form caching by default for forms using #ajax. [#2263569] => 219 comments, 35 IRC mentions
[11:11am] Fabianx-screen: https://www.drupal.org/node/2354889
[11:11am] Druplicon: https://www.drupal.org/node/2354889 => Make block context faster by removing onBlock event and replace it with loading from a BlockContextManager [#2354889] => 66 comments, 13 IRC mentions
[11:11am] WimLeers: https://www.drupal.org/node/2375695
[11:11am] Druplicon: https://www.drupal.org/node/2375695 => Condition plugins should provide cache contexts AND cacheability metadata needs to be exposed [#2375695] => 75 comments, 25 IRC mentions
[11:13am] GaborHojtsy: Fabianx-screen is talking about https://www.drupal.org/node/2354889
[11:13am] Druplicon: https://www.drupal.org/node/2354889 => Make block context faster by removing onBlock event and replace it with loading from a BlockContextManager [#2354889] => 66 comments, 14 IRC mentions
[11:14am] WimLeers: No, he was talking about https://www.drupal.org/node/2501989
[11:14am] Druplicon: https://www.drupal.org/node/2501989 => [meta] Page Cache Performance [#2501989] => 24 comments, 5 IRC mentions
[11:14am] WimLeers: (i.e. the very first part of what he said)
[11:14am] GaborHojtsy: (I directly copied the link he posted in hangouts :D)
[11:14am] WimLeers: lol ok :P
[11:16am] WimLeers: https://www.drupal.org/node/2429287
[11:16am] Druplicon: https://www.drupal.org/node/2429287 => [meta] Finalize the cache contexts API & DX/usage, enable a leap forward in performance [#2429287] => 102 comments, 7 IRC mentions
[11:17am] WimLeers: https://www.drupal.org/node/2450993
[11:17am] Druplicon: https://www.drupal.org/node/2450993 => Rendered Cache Metadata created during the main controller request gets lost [#2450993] => 35 comments, 14 IRC mentions
[11:18am] larowlan: GaborHojtsy: still working sorry, sent apology to dawehne_r this morning with my update
[11:18am] GaborHojtsy: larowlan: yeah jibran relayed that :)
[11:19am] GaborHojtsy: https://www.drupal.org/node/2495179
[11:19am] Druplicon: https://www.drupal.org/node/2495179 => Twig placeholder filter should not map to raw filter [#2495179] => 53 comments, 7 IRC mentions
[11:20am] GaborHojtsy: https://www.drupal.org/node/2487972
[11:20am] Druplicon: https://www.drupal.org/node/2487972 => [META] Results of testing localize.drupal.org on Drupal 7 in June 2015 [#2487972] => 18 comments, 5 IRC mentions
[11:21am] jibran: https://www.drupal.org/node/2453153
[11:21am] Druplicon: https://www.drupal.org/node/2453153 => Node revisions cannot be reverted per translation [#2453153] => 107 comments, 32 IRC mentions
[11:31am] larowlan: jibran++
[11:31am] larowlan: GaborHojtsy++
[11:31am] GaborHojtsy: Fabianx-screen: what’s the issue link?
[11:33am] jibran: https://www.drupal.org/node/2489024
[11:33am] dawehner: https://www.drupal.org/node/2508591
[11:33am] Druplicon: https://www.drupal.org/node/2489024 => Arbitrary code execution via 'trans' extension for dynamic twig templates (when debug output is on) [#2489024] => 18 comments, 7 IRC mentions
[11:33am] Druplicon: https://www.drupal.org/node/2508591 => Move Drupal into subdirectory and get external dependencies/libraries out of the web-accessible path [#2508591] => 8 comments, 3 IRC mentions
[11:42am] dawehner: https://www.drupal.org/node/2508654#comment-10039315
[11:42am] Druplicon: https://www.drupal.org/node/2508654 => File inclusion in transliteration service [#2508654] => 17 comments, 2 IRC mentions
[11:43am] GaborHojtsy: dawehner: that one yeah
[11:43am] GaborHojtsy: https://www.drupal.org/drupal8-security-bounty running for 2 more months
[11:43am] jibran: https://www.drupal.org/node/1305882
[11:43am] Druplicon: https://www.drupal.org/node/1305882 => drupal_html_id() considered harmful; remove ajax_html_ids to use GET (not POST) AJAX requests [#1305882] => 153 comments, 22 IRC mentions
[11:48am] dawehner: https://www.drupal.org/node/2500523
[11:48am] Druplicon: https://www.drupal.org/node/2500523 => Rewrite views_ui_add_ajax_trigger() to not rely on /system/ajax. [#2500523] => 6 comments, 2 IRC mentions

Categories: Elsewhere

Tyler Frankenstein: Headless Drupal with Angular JS and Bootstrap - Hello World

Planet Drupal - Fri, 19/06/2015 - 08:50

This tutorial describes how to build a very simple de-coupled Drupal web application powered by Angular JS and Bootstrap. The inspiration for writing this tutorial came after completing my first Angular JS module (angular-drupal), which of course is for Drupal!

To keep things simple, and in the spirit of "Hello World", the application will let us login using credentials from the Drupal website.

The complete code for this example app is available here: https://github.com/signalpoint/headless-drupal-angular-bootstrap-hello-w...

Ready? Alright, let's go headless...

Categories: Elsewhere

Lullabot: Project Management

Planet Drupal - Thu, 18/06/2015 - 21:56

In this week's Drupalize.Me podcast, hostess Amber Matz chats about all things Project Management with Seth Brown (COO at Lullabot) and Lullabot Technical Project Managers Jessica Mokrzecki and Jerad Bitner. To continue the conversation, check out Drupalize.Me's series on Project Management featuring interviews and insights from these fine folks and others at Lullabot.

Categories: Elsewhere

DrupalCon News: Register for DrupalCon Barcelona

Planet Drupal - Thu, 18/06/2015 - 21:42

Registration is live! For those of you have been waiting to purchase your ticket to DrupalCon Barcelona, the time has come!

Categories: Elsewhere

Pages

Subscribe to jfhovinne aggregator