Showcases the most useful Drupal hooks and functions. Demonstrates their powerful and beautiful interactions. Uses a custom chart block to illustrate the synergy of functions.
Discusses how to configure and implement custom CKEditor widgets in Drupal. Includes numerous examples of custom widgets and actual widgets that we use in CNN Travel site.
Note that you could also download the PDF copy of this presentation by clicking the Save/Download button. The PDF copy has far better quality than the one rendered here online.
Presented during the DrupalCamp Cebu 2015. It demonstrates how we handled and integrated multiple, switchable, and extendable map APIs with our Drupal site (CNN Travel). It showcases the modern map APIs particularly the Google Maps, HERE Maps, and MapBox.
Likewise, it will feature the Strategy Design Pattern for easy switching of map objects' context and activating a particular map API. Discussion will include the various entity contexts (node and taxonomy pages), Drupal admin form for inputting API credentials, Drupal.settings' object integration, the template files and other loaded assets, the rendered widgets, as well as the challenges we encountered and their corresponding solutions/workaround.
The session is targeted for those interested in design patterns, web mapping, or implementing switchable JavaScript APIs (multiple chart APIs, map APIs, or any family of 3rd-party APIs).
The Larch - a visual interactive programming environmentPython Ireland
The Larch Environment is a visual interactive programming environment for Jython/Python, that makes programming more visual. Its is designed for the creation of visual interactive programs, and programs that operate as interactive technical literature. To this end, protocols for presenting objects visually have been devised. An active document based programming environment builds on the edit-run-debug cycle of a standard console, allowing a programmer to experiment with ideas, and develop visual programs at the same time. Additionally, a way of embellishing source code with visual content is presented.
http://sites.google.com/site/larchenv
Slides for the talk given at the Berlin PHP user group meetup
How to guarantee consistency of PHP GraphQL implementation to the schema definition with the help of code generation.
Discusses how to configure and implement custom CKEditor widgets in Drupal. Includes numerous examples of custom widgets and actual widgets that we use in CNN Travel site.
Note that you could also download the PDF copy of this presentation by clicking the Save/Download button. The PDF copy has far better quality than the one rendered here online.
Presented during the DrupalCamp Cebu 2015. It demonstrates how we handled and integrated multiple, switchable, and extendable map APIs with our Drupal site (CNN Travel). It showcases the modern map APIs particularly the Google Maps, HERE Maps, and MapBox.
Likewise, it will feature the Strategy Design Pattern for easy switching of map objects' context and activating a particular map API. Discussion will include the various entity contexts (node and taxonomy pages), Drupal admin form for inputting API credentials, Drupal.settings' object integration, the template files and other loaded assets, the rendered widgets, as well as the challenges we encountered and their corresponding solutions/workaround.
The session is targeted for those interested in design patterns, web mapping, or implementing switchable JavaScript APIs (multiple chart APIs, map APIs, or any family of 3rd-party APIs).
The Larch - a visual interactive programming environmentPython Ireland
The Larch Environment is a visual interactive programming environment for Jython/Python, that makes programming more visual. Its is designed for the creation of visual interactive programs, and programs that operate as interactive technical literature. To this end, protocols for presenting objects visually have been devised. An active document based programming environment builds on the edit-run-debug cycle of a standard console, allowing a programmer to experiment with ideas, and develop visual programs at the same time. Additionally, a way of embellishing source code with visual content is presented.
http://sites.google.com/site/larchenv
Slides for the talk given at the Berlin PHP user group meetup
How to guarantee consistency of PHP GraphQL implementation to the schema definition with the help of code generation.
Learning iOS and hunting NSZombies in 3 weeksCalvin Cheng
Language (programming language) wars are overrated.
As a professional/career software engineer, it is our job to learn fast, evolve and continually grow in the context of different languages and software paradigms.
Learning Objective-C and iOS cocoa touch framework isn't as scary as people purport it to be. Ignore the critics, trust in your own abilities and dive into Objective-C if you need to build a mobile app for your company. Today.
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2016.
http://www.ivanomalavolta.com
Netflix's Recommendation ML Pipeline Using Apache Spark: Spark Summit East ta...Spark Summit
Netflix is the world’s largest streaming service, with 80 million members in over 250 countries. Netflix uses machine learning to inform nearly every aspect of the product, from the recommendations you get, to the boxart you see, to the decisions made about which TV shows and movies are created.
Given this scale, we utilized Apache Spark to be the engine of our recommendation pipeline. Apache Spark enables Netflix to use a single, unified framework/API – for ETL, feature generation, model training, and validation. With pipeline framework in Spark ML, each step within the Netflix recommendation pipeline (e.g. label generation, feature encoding, model training, model evaluation) is encapsulated as Transformers, Estimators and Evaluators – enabling modularity, composability and testability. Thus, Netflix engineers can build our own feature engineering logics as Transformers, learning algorithms as Estimators, and customized metrics as Evaluators, and with these building blocks, we can more easily experiment with new pipelines and rapidly deploy them to production.
In this talk, we will discuss how Apache Spark is used as a distributed framework we build our own algorithms on top of to generate personalized recommendations for each of our 80+ million subscribers, specific techniques we use at Netflix to scale, and the various pitfalls we’ve found along the way.
Learning iOS and hunting NSZombies in 3 weeksCalvin Cheng
Language (programming language) wars are overrated.
As a professional/career software engineer, it is our job to learn fast, evolve and continually grow in the context of different languages and software paradigms.
Learning Objective-C and iOS cocoa touch framework isn't as scary as people purport it to be. Ignore the critics, trust in your own abilities and dive into Objective-C if you need to build a mobile app for your company. Today.
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2016.
http://www.ivanomalavolta.com
Netflix's Recommendation ML Pipeline Using Apache Spark: Spark Summit East ta...Spark Summit
Netflix is the world’s largest streaming service, with 80 million members in over 250 countries. Netflix uses machine learning to inform nearly every aspect of the product, from the recommendations you get, to the boxart you see, to the decisions made about which TV shows and movies are created.
Given this scale, we utilized Apache Spark to be the engine of our recommendation pipeline. Apache Spark enables Netflix to use a single, unified framework/API – for ETL, feature generation, model training, and validation. With pipeline framework in Spark ML, each step within the Netflix recommendation pipeline (e.g. label generation, feature encoding, model training, model evaluation) is encapsulated as Transformers, Estimators and Evaluators – enabling modularity, composability and testability. Thus, Netflix engineers can build our own feature engineering logics as Transformers, learning algorithms as Estimators, and customized metrics as Evaluators, and with these building blocks, we can more easily experiment with new pipelines and rapidly deploy them to production.
In this talk, we will discuss how Apache Spark is used as a distributed framework we build our own algorithms on top of to generate personalized recommendations for each of our 80+ million subscribers, specific techniques we use at Netflix to scale, and the various pitfalls we’ve found along the way.
The presentation covers:
*Adding JS to the page, both at module and theme level
*Writing Drupal aware JS code
*Libraries management
*Ajax framework
*Drupal JS functions
*Drupal JS theme functions
SharePoint Framework, Angular and Azure FunctionsSébastien Levert
Things are moving fast. Sometimes you might even feel that you own comfort zone is getting of control. But in a Mobile-First, Cloud-First world, things are changing to a crazy pace and to stay on the top of your game, you need keep up with the latest and greatest technologies that are available out there. By staying up to date, you will give to yourself new options that will let you be more productive, write better code and push you in a more open and more collaborative world.
With the official shipment of Angular 4 and the current release of the SharePoint Framework, it is now the time to start moving towards those new technologies in your SharePoint Solutions.
In this session, we will cover the modern tool belt of the SharePoint developer by covering the SharePoint Framework as the new surface to express yourself, Angular as a Framework to enable you to build complete applications within your SharePoint modern experiences and Azure Function as the perfect server-side companion for all your Office 365 & Azure development.
This very demo-intensive session will make sure that at the end you get those 3 key takeaways :
- Understand the role of the SharePoint Framework, Angular and Azure Functions in this Cloud-First, Mobile-First world
- Have a complete sample where the modern tool belt is relevant and useful in a real-world scenario
- Change the way you will think for your next SharePoint project
Walks through the top 8 improvements coming to Drupal 8, including videos and code samples to demonstrate "before vs. after."
Given to the @DrupalNS meet up in Bedford, Nova Scotia on July 28, 2014.
"Paragraphs are more powerful than you can expect" from Vasily Jaremchuk for ...DrupalCamp Kyiv
Paragraphs is a next step in the evolution of content management tools. The main goal of paragraph approach to make things cleaner to content managers. End-users can now choose on-the-fly between predefined Paragraph Types. We can encapsulate any Drupal functionality into Paragraph Entity, anything you want from a simple text or image to a complex and configurable slideshow, views, contact form or any other feature that exists in Drupal separately.
The presentation will not include complex information for the developers. I’ll cover only some basic ideas in Paragraphs module architecture. After that I’ll mention the most popular and outstanding modules that extend paragraphs functionality (Bootstrap Paragraphs, Paragraphs Edit, Classy paragraphs, Geysir etc.).
There will be several demos and ideas how we can use paragraphs approach.
Everything You Need to Know About the Top Changes in Drupal 8Acquia
<p>Drupal 8 is on the way. And we know you want to know -- what does this mean for me?!</p>
<p>Don't fear, Angie 'webchick' Byron is here! This one hour webinar will provide you with detailed overviews on the major changes in Drupal 8, as well as several short video demos that will give you a glimpse into a few of the newest features and capabilities. Angie will explain what D8 means for:</p>
<ul>
<li>Site Builders: See Views in Core, more (and better) blocks, improved entity and field features...the list goes on!</li>
<li>Front-end Developers: We're talking HTML5, libraries, accessibility enhancements, new themes and UI elements, and faster performance, to name a few.</li>
<li>Back-end Developers: A new configuration management system, a completely rehauled Entity API, improved caching, and new built-in web services features.</li></ul>
This presentation was delivered on 11th May, 2014 in Drupal Camp Pakistan held in DatumSquare IT Services Islamabad. Contents of the presentation contains some basics stuff for designers, themers and coders.
DrupalGap. How to create native application for mobile devices based on Drupa...DrupalCampDN
Рано или поздно каждый сайт нуждается в мобильной версии. Существует несколько способов реализации мобильной версии: адаптивный сайт, нативное приложение для iOS, Android etc.
В создании нативного приложения нам поможет отличная платформа под названием DrupalGap. DrupalGap - это платформа позволяющая создавать приложения для iOS и Android при помощи Drupal, PhoneGap, jQueryMobile, без непосредственного программирования на языке платформы.
DrupalGap. How to create native application for mobile devices based on Drupa...Alex S
Рано или поздно каждый сайт нуждается в мобильной версии. Существует несколько способов реализации мобильной версии: адаптивный сайт, нативное приложение для iOS, Android etc.
В создании нативного приложения нам поможет отличная платформа под названием DrupalGap. DrupalGap - это платформа позволяющая создавать приложения для iOS и Android при помощи Drupal, PhoneGap, jQueryMobile, без непосредственного программирования на языке платформы.
Views Unlimited: Unleashing the Power of Drupal's Views ModuleRanel Padon
Unleashing the power of Views Drupal module. Discusses Display Formats (Map, Chart, Slideshow, Data Export), Fields, Basic Filters, Exposed Filters, Contextual Filters, Relationships, Attachment, and so on. Includes numerous sample use cases and recommendations.
Of Nodes and Maps (Web Mapping with Drupal - Part II)Ranel Padon
Discusses the input, storage, and display mechanisms of spatial fields on nodes: how to utilize Geofield's input widgets and output formatters, how to integrate Geofield with Leaflet and OpenLayers, and how to integrate them with Views.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Connector Corner: Automate dynamic content and events by pushing a button
The Synergy of Drupal Hooks/APIs (Custom Module Development with ChartJS)
1. The Synergy of Drupal Hooks/APIs
Custom Chart Block
Engr. Ranel O. Padon
Drupal Summer Camp PH 2015
2. About Me
• Software Engineer at Kite Systems (Hong Kong-based company)
– full-time Drupal developer for CNN Travel (our client)
• part-time Python lecturer in University of the Philippines
• involved with programming for 9 years (Python, Java, etc)
• involved in Drupal for the last 3 years
• projects: http://github.com/ranelpadon
• plays football/futsal
4. Drupal Hooks/APIs
• There is beauty and synergy in Drupal functions.
• Synergy
the interaction of elements that when combined
produce a total effect that is greater than
the sum of the individual elements, contributions,
etc.
5. Drupal Hooks/APIs
• Individual Drupal functions are boring and
not that useful, but their combinations
are interesting and very powerful.
6. CNN Travel Blocks
• if you go to the CNN Travel site:
http://travel.cnn.com
you’ll notice that we have so many blocks in the
front page
• blocks add valuable information to the site and
creates more visual interest to your page
• recently, we’ve implemented a block that features
our partner hotels
11. Learning Curve
In the beginning of any learning, while you're on the long,
flat part of the curve, you put in great amounts of time
and effort, but see little in the way of results.
Persistent practice helps you move along the learning
curve until you hit that sweet spot—about 80% of the
way into the process—where the curve starts to rise
sharply, and results come easily.
http://bruceelkin.hubpages.com/hub/10-000-Hours--The-Awesome-
Power-of-Practice
12. Learning Curve
in most field of learning (sports, programming, music,
etc), there are many tutorials/exercises about the basic
skills, but relatively few about the ‘intermediate’ skills
this presentation will try to fill the knowledge gap for
Drupal devs by exposing some of the most useful
functions
partner hotels block is an interesting block and a good
Drupal development exercise since its implementation
involves lots of Drupal hooks/functions
13. Learning Curve
• there are 403 hooks in Drupal 7 core alone and
hundreds/thousands of related/utility functions
• but you only need a handful of them to be productive
• knowing 10-20 of the most useful functions could
boost your productivity
• I’ll showcase the value of some of the Drupal
functions/use cases by creating a simpler and related
version of Partner Hotels block
25. Hook_Block_Configure
• to make the block contents editable in Admin UI,
we could use the hook_block_configure().
• but we need a persistent storage/table for its contents
• we could use the handy Variable table built-in
in Drupal
26. Variable table
there are 29 variables
by default in
Drupal 7.37
maintenance_mode is
just inserted for demo
of this presentation
27. Variable table
• we could easily manipulate values in
the Variable table, without using SQL directly:
OPERATION
DRUPAL FUNCTION
Create/Update
variable_set()
Read
variable_get()
Delete
variable_del()
35. Charts
• we’ll use the ChartJS since it’s open-source,
simple to use, has clean syntax, and mobile-friendly:
http://www.chartjs.org/
36. ChartJS Page
• include the ChartJS script
• create a CANVAS element in a page
• set the input data
• convert the CANVAS element to a chart object
against the input data
37. ChartJS Page
• include the ChartJS script
• select version from here:
• https://cdnjs.com/libraries/chart.js
• latest version:
• https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.js
44. Chart Block
• how do we display a chart in a Drupal block?
• we need to satisfy these conditions again:
• include the ChartJS script
• create a CANVAS element in a page
• set the input data
• convert the CANVAS element to a chart object
against the input data
45. Chart Block
• we’ll focus first on the input data
• we need a JSON data from Drupal
• we’ll create 3 articles and broadcast them as
JSON objects
46. Data Source: Create 3 Articles
• Article 1
– Tags: ‘alpha’
– Body: ‘Lorem Ipsum 1’
• Article 2
– Tags: ‘beta’
– Body: ‘Lorem Ipsum 2’
• Article 3
– Tags: ‘alpha’
– Body: ‘Lorem Ipsum 3’
47. EntityFieldQuery API
• create a helper function to retrieve the articles
• we’ll use the powerful and flexible EFQ API
49. Hook_Menu | JSON Output
• bind the function to a menu
• encode the _get_articles() output to JSON
• set the access permission to use
50. Hook_Menu
• Make sure to clear the Drupal cache to register
and activate the newly created menu
51. • the JSON data will
now be accessible
• you might want to
use Chrome’s
JSON Formatter
52. Hook_Block_View | #Markup
• insert a CANVAS element
• convert ‘content’ to array structure
• insert a ‘#markup’ property/array key
• set the block markup
53. Hook_Block_View | #Attached
• insert the ChartJS script
• attach a new JS file to the ‘content’
• set the JS data/src
• set the data as external script
54. Drupal Behaviors | Driver File
• implement the ChartJS driver file
• create a new Drupal behavior,
define the ‘attach’-mode function
• let’s use first the previous, non-Drupal
sample chart codes
55. • implement the ChartJS driver file
• attach a new JS file to the ‘content’
• set the JS data/src
• set the data as a local file
56. Hook_Block_View | #Attached
• insert the ChartJS driver
• attach a new JS file to the ‘content’
• set the JS data/src
• set the data as a local file
58. Drupal Behaviors | Driver File
• adjust the ChartJS driver
• fetch the Articles JSON as the input data
• convert the chart renderer to a function
• will be used in a JSON function callback
59.
60.
61. Chart Block | Articles
• the articles’ JSON data will now be rendered
62. Injecting JS | #Attach
• note that the main advantage of #attach compared
to drupal_add_js() is that they are ‘alterable’
since they are inserted as array elements
• same justification applies for drupal_add_css()
• #attach is also used in Drupal 8.
• you could alter the #attached JS/CSS files
using hook_js_alter() and hook_css_alter()
63.
64. Creating an Admin Page
• there are times you’ll need to have some admin page
for inputting custom site settings/configurations
• for instance, you’ll like to control if you would like
to show the chart labels, have an text field entry for
the chart colors or highlight colors, a way to select
the chart type, a way to use other chart script, and
so on.
65. Creating an Admin Page
• use case: we want to select the chart type to display
• the user could choose to display a Pie or Doughnut
chart
66. Creating an Admin Page
• requires a hook_menu that will call a page element
generated using Form API
• input site/form data could be saved in the Variable
table using the handy system_settings_form().
79. SummerCamp Module Repo
• I’ve already implemented the repo in GitHub and
added more blocks and features:
• https://github.com/ranelpadon/summercamp
• showcases ChartJS, Panoramio API, and GitHub’s
Gist API.
• implements blocks using theme function and
template file
• demonstrates processing JSON data in back-end
and front-end
• and more..
82. Recommendations
• Drupal Development Books
• Master Drupal 7 Module Development by Wadman
• http://befused.com/master-drupal/
• Drupal 7 Module Development
by Butcher, et al.
83. Special Thanks
• CNN Travel (http://travel.cnn.com) for the
ideas and inspiration for this presentation.