Spaces
This commit is contained in:
parent
1f815ba7bc
commit
eb3dbc40bb
|
@ -3,40 +3,40 @@
|
||||||
<!--[if IE 9]> <html class="ie ie9 lte9"> <![endif]-->
|
<!--[if IE 9]> <html class="ie ie9 lte9"> <![endif]-->
|
||||||
<!--[if gt IE 9]> <html> <![endif]-->
|
<!--[if gt IE 9]> <html> <![endif]-->
|
||||||
<!--[if !IE]><!--> <html> <!--<![endif]-->
|
<!--[if !IE]><!--> <html> <!--<![endif]-->
|
||||||
<head>
|
<head>
|
||||||
<meta lang="en-GB" charset="utf-8">
|
<meta lang="en-GB" charset="utf-8">
|
||||||
{% include 'title' %}
|
{% include 'title' %}
|
||||||
|
|
||||||
{% if page.meta.description %}
|
{% if page.meta.description %}
|
||||||
<meta name="description" content="{{ page.meta.description|e('html') }}">
|
<meta name="description" content="{{ page.meta.description|e('html') }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if page.meta.og %}{% include "og" with {og: page.meta.og} %}{% endif %}
|
{% if page.meta.og %}{% include "og" with {og: page.meta.og} %}{% endif %}
|
||||||
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="author" href="{{ site.url }}/humans.txt" />
|
<link rel="author" href="{{ site.url }}/humans.txt" />
|
||||||
<link rel="stylesheet" href="{{ site.url }}/assets/css/styles.css">
|
<link rel="stylesheet" href="{{ site.url }}/assets/css/styles.css">
|
||||||
</head>
|
</head>
|
||||||
<body{% if page.body_class %} class="{{ page.body_class }}"{% endif %}>
|
<body{% if page.body_class %} class="{{ page.body_class }}"{% endif %}>
|
||||||
{% include 'navbar' %}
|
{% include 'navbar' %}
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% block content_wrapper %}
|
{% block content_wrapper %}
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% include 'sidebar' %}
|
{% include 'sidebar' %}
|
||||||
</div>{# .row #}
|
</div>{# .row #}
|
||||||
</div>{# .container #}
|
</div>{# .container #}
|
||||||
|
|
||||||
<footer class="container" role="contentinfo">
|
<footer class="container" role="contentinfo">
|
||||||
<p class="copyright">© {{ site.start_date }}-{{ 'now' | date('Y') }} {{ site.title }}.</p>
|
<p class="copyright">© {{ site.start_date }}-{{ 'now' | date('Y') }} {{ site.title }}.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
{% include 'footer-scripts' %}
|
{% include 'footer-scripts' %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
{% extends 'default' %}
|
{% extends 'default' %}
|
||||||
|
|
||||||
{% block content_wrapper %}
|
{% block content_wrapper %}
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
|
|
||||||
{% include 'post-header' %}
|
{% include 'post-header' %}
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
|
|
||||||
{% if page.tags %}
|
{% if page.tags %}
|
||||||
<p class="tags">
|
<p class="tags">
|
||||||
Tags:
|
Tags:
|
||||||
{% for tag in page.tags %}
|
{% for tag in page.tags %}
|
||||||
<a href="{{ site.url }}/blog/tags/{{ tag|url_encode(true) }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}
|
<a href="{{ site.url }}/blog/tags/{{ tag|url_encode(true) }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% include 'about-author' %}
|
{% include 'about-author' %}
|
||||||
|
|
||||||
{% if page.next_post or page.previous_post %}
|
{% if page.next_post or page.previous_post %}
|
||||||
<ul>
|
<ul>
|
||||||
{% if page.next_post %}<li>Next post: <a href="{{ page.next_post.url }}">{{ page.next_post.title }}</a></li>{% endif %}
|
{% if page.next_post %}<li>Next post: <a href="{{ page.next_post.url }}">{{ page.next_post.title }}</a></li>{% endif %}
|
||||||
{% if page.previous_post %}<li>Previous post: <a href="{{ page.previous_post.url }}">{{ page.previous_post.title }}</a></li>{% endif %}
|
{% if page.previous_post %}<li>Previous post: <a href="{{ page.previous_post.url }}">{{ page.previous_post.title }}</a></li>{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
{% extends 'default' %}
|
{% extends 'default' %}
|
||||||
|
|
||||||
{% block content_wrapper %}
|
{% block content_wrapper %}
|
||||||
<h1>{{ page.title }}</h1>
|
<h1>{{ page.title }}</h1>
|
||||||
|
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
|
|
||||||
{% if page.slides_embed %}
|
{% if page.slides_embed %}
|
||||||
<div class="slides">
|
<div class="slides">
|
||||||
{{ page.slides_embed|raw }}
|
{{ page.slides_embed|raw }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="about-author">
|
<div class="about-author">
|
||||||
<h2>About the Author</h2>
|
<h2>About the Author</h2>
|
||||||
<img src="{{ site.gravatar_url }}?s=50" alt="Picture of Oliver" class="img-circle">
|
<img src="{{ site.gravatar_url }}?s=50" alt="Picture of Oliver" class="img-circle">
|
||||||
<p>{{ site.bio|raw }}</p>
|
<p>{{ site.bio|raw }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,17 +4,17 @@
|
||||||
{% block scripts %}{% endblock %}
|
{% block scripts %}{% endblock %}
|
||||||
|
|
||||||
{% if page.tweets == true %}
|
{% if page.tweets == true %}
|
||||||
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
|
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if site.google_analytics_tracking_id %}
|
{% if site.google_analytics_tracking_id %}
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
|
|
||||||
ga('create', '{{ site.google_analytics_tracking_id }}', 'auto');
|
ga('create', '{{ site.google_analytics_tracking_id }}', 'auto');
|
||||||
ga('send', 'pageview');
|
ga('send', 'pageview');
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{% if data.posts %}
|
{% if data.posts %}
|
||||||
<section class="latest-posts">
|
<section class="latest-posts">
|
||||||
<h2>Latest Posts</h2>
|
<h2>Latest Posts</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{% for post in data.posts | slice(0,5) %}
|
{% for post in data.posts | slice(0,5) %}
|
||||||
<li{% if page.url == post.url %} class="active"{% endif %}><a href="{{ post.url }}">{{ post.title }}</a></li>
|
<li{% if page.url == post.url %} class="active"{% endif %}><a href="{{ post.url }}">{{ post.title }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
<nav class="navbar navbar-inverse navbar-fixed-top">
|
<nav class="navbar navbar-inverse navbar-fixed-top">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
||||||
<span class="sr-only">Toggle navigation</span>
|
<span class="sr-only">Toggle navigation</span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
<a class="navbar-brand" href="{{ site.url }}">{{ site.title }}</a>
|
<a class="navbar-brand" href="{{ site.url }}">{{ site.title }}</a>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="navbar" class="collapse navbar-collapse">
|
|
||||||
<ul class="nav navbar-nav">
|
|
||||||
<li{% if page.nav == 'about' %} class="active"{% endif %}><a href="{{ site.url }}">About</a></li>
|
|
||||||
{% for item in [ 'work', 'services', 'talks', 'blog', 'contact' ] %}
|
|
||||||
<li{% if page.nav == item %} class="active"{% endif %}><a href="{{ site.url }}/{{ item }}">{{ item|title }}</a></li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</div>{# .nav-collapse #}
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
|
||||||
|
<div id="navbar" class="collapse navbar-collapse">
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
<li{% if page.nav == 'about' %} class="active"{% endif %}><a href="{{ site.url }}">About</a></li>
|
||||||
|
{% for item in [ 'work', 'services', 'talks', 'blog', 'contact' ] %}
|
||||||
|
<li{% if page.nav == item %} class="active"{% endif %}><a href="{{ site.url }}/{{ item }}">{{ item|title }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>{# .nav-collapse #}
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
|
@ -1,37 +1,37 @@
|
||||||
{% if og.title %}
|
{% if og.title %}
|
||||||
<meta property="og:title" content="{{ og.title|raw }}"/>
|
<meta property="og:title" content="{{ og.title|raw }}"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if og.description %}
|
{% if og.description %}
|
||||||
<meta property="og:description" content="{{ og.description|raw }}"/>
|
<meta property="og:description" content="{{ og.description|raw }}"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if og.type %}
|
{% if og.type %}
|
||||||
<meta property="og:type" content="{{ og.type }}"/>
|
<meta property="og:type" content="{{ og.type }}"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if og.image and og.image.url %}
|
{% if og.image and og.image.url %}
|
||||||
<meta property="og:image" content="{{ og.image.url }}"/>
|
<meta property="og:image" content="{{ og.image.url }}"/>
|
||||||
{% if og.image.type %}
|
{% if og.image.type %}
|
||||||
<meta property="og:image:type" content="{{ og.image.type }}"/>
|
<meta property="og:image:type" content="{{ og.image.type }}"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if og.image.width %}
|
{% if og.image.width %}
|
||||||
<meta property="og:image:width" content="{{ og.image.width }}"/>
|
<meta property="og:image:width" content="{{ og.image.width }}"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if og.image.height %}
|
{% if og.image.height %}
|
||||||
<meta property="og:image:height" content="{{ og.image.height }}"/>
|
<meta property="og:image:height" content="{{ og.image.height }}"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if og.title %}
|
{% if og.title %}
|
||||||
{% if og.image %}
|
{% if og.image %}
|
||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta name="twitter:image:src" content="{{ og.image.url }}">
|
<meta name="twitter:image:src" content="{{ og.image.url }}">
|
||||||
<meta name="twitter:creator" content="@opdavies" />
|
<meta name="twitter:creator" content="@opdavies" />
|
||||||
{% else %}
|
{% else %}
|
||||||
<meta name="twitter:card" content="summary" />
|
<meta name="twitter:card" content="summary" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<meta name="twitter:title" content="{{ og.title|raw }}" />
|
<meta name="twitter:title" content="{{ og.title|raw }}" />
|
||||||
<meta name="twitter:description" content="{{ og.description|raw }}" />
|
<meta name="twitter:description" content="{{ og.description|raw }}" />
|
||||||
<meta name="twitter:site" content="@opdavies" />
|
<meta name="twitter:site" content="@opdavies" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
<p class="posted">Posted: {{ page.date | date('jS F Y') }}</p>
|
<p class="posted">Posted: {{ page.date | date('jS F Y') }}</p>
|
||||||
{#
|
{#
|
||||||
{% if page.tags %}
|
{% if page.tags %}
|
||||||
Tags:
|
Tags:
|
||||||
{% for tag in page.tags %}
|
{% for tag in page.tags %}
|
||||||
{{ tag }}{% if not loop.last %},{% else %}.{% endif %}
|
{{ tag }}{% if not loop.last %},{% else %}.{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
#}
|
#}
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<section class="block block--da_member">
|
<section class="block block--da_member">
|
||||||
<h2>Drupal Association</h2>
|
<h2>Drupal Association</h2>
|
||||||
<a href="https://assoc.drupal.org/membership" title="Become a Drupal Association member">
|
<a href="https://assoc.drupal.org/membership" title="Become a Drupal Association member">
|
||||||
<img src="/assets/images/da-individual-member.png" alt="Drupal Association Individual Member">
|
<img src="/assets/images/da-individual-member.png" alt="Drupal Association Individual Member">
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<section class="block block__drupalcon_la">
|
<section class="block block__drupalcon_la">
|
||||||
<h2>DrupalCon LA</h2>
|
<h2>DrupalCon LA</h2>
|
||||||
<img src="/assets/images/drupalcon-la-attending.png" alt="">
|
<img src="/assets/images/drupalcon-la-attending.png" alt="">
|
||||||
<img src="/assets/images/drupalcon-la-sprinter.png" alt="">
|
<img src="/assets/images/drupalcon-la-sprinter.png" alt="">
|
||||||
</section>
|
</section>
|
||||||
-->
|
-->
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
{% set separator = '|' %}
|
{% set separator = '|' %}
|
||||||
{% spaceless %}<title>
|
{% spaceless %}<title>
|
||||||
{% if page.full_title %}
|
{% if page.full_title %}
|
||||||
{{ page.full_title }}
|
{{ page.full_title }}
|
||||||
{% elseif page.title and site.title %}
|
{% elseif page.title and site.title %}
|
||||||
{{ page.title }} {{ separator }} {{ site.title }}
|
{{ page.title }} {{ separator }} {{ site.title }}
|
||||||
{% elseif site.title %}
|
{% elseif site.title %}
|
||||||
{% if site.subtitle %}
|
{% if site.subtitle %}
|
||||||
{{ site.subtitle }} {{ separator }} {{ site.title }}
|
{{ site.subtitle }} {{ separator }} {{ site.title }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ site.title }}
|
{{ site.title }}
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</title>{% endspaceless %}
|
{% endif %}
|
||||||
|
</title>{% endspaceless %}
|
||||||
|
|
|
@ -3,10 +3,10 @@ title: Style Drupal 6's Taxonomy Lists with PHP, CSS and jQuery
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: style-drupal-6s-taxonomy-lists-php-css-and-jquery
|
slug: style-drupal-6s-taxonomy-lists-php-css-and-jquery
|
||||||
tags:
|
tags:
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-theming
|
- drupal-theming
|
||||||
- taxonomy
|
- taxonomy
|
||||||
---
|
---
|
||||||
Whilst developing this, and other Drupal websites for clients, I decided that I wanted to categorise content using the taxonomy system. However, I wasn't happy with the way that Drupal displayed the terms lists by default, and I started comparing this to other websites that I look at.
|
Whilst developing this, and other Drupal websites for clients, I decided that I wanted to categorise content using the taxonomy system. However, I wasn't happy with the way that Drupal displayed the terms lists by default, and I started comparing this to other websites that I look at.
|
||||||
|
|
||||||
|
@ -16,9 +16,9 @@ I scrolled down until I found the piece of code that displayed the terms list:
|
||||||
|
|
||||||
~~~php
|
~~~php
|
||||||
<?php if ($terms): ?>
|
<?php if ($terms): ?>
|
||||||
<div class="terms terms-inline">
|
<div class="terms terms-inline">
|
||||||
<?php print t('Posted in') . $terms; ?>
|
<?php print t('Posted in') . $terms; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
@ -28,16 +28,16 @@ I then added some CSS to re-size the spacing between the items, and then add the
|
||||||
|
|
||||||
~~~css
|
~~~css
|
||||||
.terms ul.links li {
|
.terms ul.links li {
|
||||||
margin-right: 1px;
|
margin-right: 1px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.terms ul.links li:after {
|
.terms ul.links li:after {
|
||||||
content: ",";
|
content: ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
.terms ul.links li.last:after {
|
.terms ul.links li.last:after {
|
||||||
content: ".";
|
content: ".";
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
@ -45,9 +45,9 @@ I created a file named **script.js** in my theme folder with the following code
|
||||||
|
|
||||||
~~~js
|
~~~js
|
||||||
if (Drupal.jsEnabled) {
|
if (Drupal.jsEnabled) {
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('.terms ul.links li.last').prev().addClass('test');
|
$('.terms ul.links li.last').prev().addClass('test');
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
@ -55,6 +55,6 @@ This code finds the last item in the list, uses **.prev** to select the one befo
|
||||||
|
|
||||||
~~~css
|
~~~css
|
||||||
.terms ul.links li.test:after {
|
.terms ul.links li.test:after {
|
||||||
content: " and";
|
content: " and";
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
|
@ -3,12 +3,12 @@ title: Using ImageCache and ImageCrop for my Portfolio
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: using-imagecache-and-imagecrop-my-portfolio
|
slug: using-imagecache-and-imagecrop-my-portfolio
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- cck
|
- cck
|
||||||
- imagecache
|
- imagecache
|
||||||
- imagecrop
|
- imagecrop
|
||||||
- imagefield
|
- imagefield
|
||||||
---
|
---
|
||||||
Whilst working on my own portfolio/testimonial website, I decided to have a portfolio page displaying the name of each site and a thumbnail image. For this Blog post, I'll be using a site called [Popcorn Strips](http://popcornstrips.com) which I built for a friend earlier this year as an example.
|
Whilst working on my own portfolio/testimonial website, I decided to have a portfolio page displaying the name of each site and a thumbnail image. For this Blog post, I'll be using a site called [Popcorn Strips](http://popcornstrips.com) which I built for a friend earlier this year as an example.
|
||||||
|
|
||||||
|
@ -27,4 +27,4 @@ I then added a new 'Javascript crop' action with the following settings:
|
||||||
* Width: 200px
|
* Width: 200px
|
||||||
* Height: 100px
|
* Height: 100px
|
||||||
* xoffset: Left
|
* xoffset: Left
|
||||||
* yoffset: Top
|
* yoffset: Top
|
||||||
|
|
|
@ -3,15 +3,15 @@ title: Conditional Email Addresses in a Webform
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: conditional-email-addresses-webform
|
slug: conditional-email-addresses-webform
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- conditional-email
|
- conditional-email
|
||||||
- webform
|
- webform
|
||||||
---
|
---
|
||||||
I created a new Webform to serve as a simple Contact form, but left the main configuration until after I created the form components. I added 'Name', 'Email', 'Subject' and 'Message' fields, as well as a 'Category' select list. Below 'Options', I entered each of my desired options in the following format:
|
I created a new Webform to serve as a simple Contact form, but left the main configuration until after I created the form components. I added 'Name', 'Email', 'Subject' and 'Message' fields, as well as a 'Category' select list. Below 'Options', I entered each of my desired options in the following format:
|
||||||
|
|
||||||
Email address|Visible name
|
Email address|Visible name
|
||||||
|
|
||||||
I went back to the form configuration page and expanded 'Conditional Email Recipients', and selected my Category. Note that the standard 'Email To' field above it needs to be empty. Originally, I made the mistake of leaving addresses in that field which resulted in people being sent emails regardles of which category was selected. I then configured the rest of the form.
|
I went back to the form configuration page and expanded 'Conditional Email Recipients', and selected my Category. Note that the standard 'Email To' field above it needs to be empty. Originally, I made the mistake of leaving addresses in that field which resulted in people being sent emails regardles of which category was selected. I then configured the rest of the form.
|
||||||
|
|
||||||
Then, when I went to the finished form, the category selection was available.
|
Then, when I went to the finished form, the category selection was available.
|
||||||
|
|
|
@ -2,15 +2,15 @@
|
||||||
title: Quickly Create Zen Subthemes Using Zenophile
|
title: Quickly Create Zen Subthemes Using Zenophile
|
||||||
nav: blog
|
nav: blog
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- drupal-modules
|
- drupal-modules
|
||||||
- drupal-theming
|
- drupal-theming
|
||||||
- zen
|
- zen
|
||||||
- zenophile
|
- zenophile
|
||||||
---
|
---
|
||||||
If you use the [Zen](http://drupal.org/project/zen) theme, then you should also be using the [Zenophile](http://drupal.org/project/zenophile) module!
|
If you use the [Zen](http://drupal.org/project/zen) theme, then you should also be using the [Zenophile](http://drupal.org/project/zenophile) module!
|
||||||
|
|
||||||
The Zenophile module allows you to very quickly create Zen subthemes from within your web browser, as well as editing options such as the site directory where it should be placed, the layout type (fixed or fluid), page wrapper and sidebar widths, and the placement of the sidebars.
|
The Zenophile module allows you to very quickly create Zen subthemes from within your web browser, as well as editing options such as the site directory where it should be placed, the layout type (fixed or fluid), page wrapper and sidebar widths, and the placement of the sidebars.
|
||||||
|
|
||||||
For more information about the Zenophile module, check out [this video](http://blip.tv/file/2427703) by [Elliott Rothman](http://elliottrothman.com).
|
For more information about the Zenophile module, check out [this video](http://blip.tv/file/2427703) by [Elliott Rothman](http://elliottrothman.com).
|
||||||
|
|
|
@ -3,11 +3,11 @@ title: Create a Slideshow of Multiple Images Using Fancy Slide
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: create-slideshow-multiple-images-using-fancy-slide
|
slug: create-slideshow-multiple-images-using-fancy-slide
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- fancy-slide
|
- fancy-slide
|
||||||
- slideshow
|
- slideshow
|
||||||
---
|
---
|
||||||
Whilst updating my About page, I thought about creating a slideshow of several images instead of just the one static image. When I looking on Drupal.org, the only slideshow modules were to create slideshows of images that were attached to different nodes - not multiple images attached to one node. Then, I found the [Fancy Slide](http://drupal.org/project/fancy_slide) module. It's a jQuery Slideshow module with features that include integration with the [CCK](http://drupal.org/project/cck), [ImageCache](http://drupal.org/project/imagecache) and [Nodequeue](http://drupal.org/project/nodequeue) modules.
|
Whilst updating my About page, I thought about creating a slideshow of several images instead of just the one static image. When I looking on Drupal.org, the only slideshow modules were to create slideshows of images that were attached to different nodes - not multiple images attached to one node. Then, I found the [Fancy Slide](http://drupal.org/project/fancy_slide) module. It's a jQuery Slideshow module with features that include integration with the [CCK](http://drupal.org/project/cck), [ImageCache](http://drupal.org/project/imagecache) and [Nodequeue](http://drupal.org/project/nodequeue) modules.
|
||||||
|
|
||||||
|
@ -23,4 +23,4 @@ I added the following code into my About page, as described in the Fancy Slide r
|
||||||
<?php print theme('fancy_slide', 1); ?>
|
<?php print theme('fancy_slide', 1); ?>
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
In my opinion, this adds a nice effect to the About page. I like it because it's easy to set up, and easy to add additional images later on if required.
|
In my opinion, this adds a nice effect to the About page. I like it because it's easy to set up, and easy to add additional images later on if required.
|
||||||
|
|
|
@ -3,13 +3,13 @@ title: Quickly Import Multiples Images Using the Imagefield_Import Module
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: quickly-import-multiples-images-using-imagefieldimport-module
|
slug: quickly-import-multiples-images-using-imagefieldimport-module
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- imagefield-import
|
- imagefield-import
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- photo-gallery
|
- photo-gallery
|
||||||
- cck
|
- cck
|
||||||
- imagefield
|
- imagefield
|
||||||
---
|
---
|
||||||
**Thanks to Bob at [Mustardseed Media](http://mustardseedmedia.com) for [tweeting](http://twitter.com/mustardseedinc/status/14713096905) about this module. It's undoubtedly saved me hours of work today alone!**
|
**Thanks to Bob at [Mustardseed Media](http://mustardseedmedia.com) for [tweeting](http://twitter.com/mustardseedinc/status/14713096905) about this module. It's undoubtedly saved me hours of work today alone!**
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@ title: Improve JPG Quality in Imagecache and ImageAPI
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: improve-jpg-quality-imagecache-and-imageapi
|
slug: improve-jpg-quality-imagecache-and-imageapi
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- imagecache
|
- imagecache
|
||||||
---
|
---
|
||||||
Whilst uploading images for my Projects and Testimonials sections, I noticed that the Imagecache-scaled images weren't as high a quality the originals on my Mac. I did some searching online and found out that, by default, Drupal resamples uploaded jpgs to 75% of their original quality.
|
Whilst uploading images for my Projects and Testimonials sections, I noticed that the Imagecache-scaled images weren't as high a quality the originals on my Mac. I did some searching online and found out that, by default, Drupal resamples uploaded jpgs to 75% of their original quality.
|
||||||
|
|
||||||
|
@ -14,4 +14,4 @@ To increase the quality of your images, change the setting in the two following
|
||||||
* admin/settings/imageapi/config
|
* admin/settings/imageapi/config
|
||||||
* admin/settings/image-toolkit
|
* admin/settings/image-toolkit
|
||||||
|
|
||||||
The first one is for ImageAPI. Primarily, this means Imagecache presets. The second one is for core's image.inc. This is used for resizing profile pictures in core, and some contrib modules. Once changed, I did have to flush each of the Imagecache presets (admin/build/imagecache) for the changes to take effect.
|
The first one is for ImageAPI. Primarily, this means Imagecache presets. The second one is for core's image.inc. This is used for resizing profile pictures in core, and some contrib modules. Once changed, I did have to flush each of the Imagecache presets (admin/build/imagecache) for the changes to take effect.
|
||||||
|
|
|
@ -3,12 +3,12 @@ title: Create a Block of Social Media Icons using CCK, Views and Nodequeue
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: create-block-social-media-icons-using-cck-views-and-nodequeue
|
slug: create-block-social-media-icons-using-cck-views-and-nodequeue
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- drupal
|
- drupal
|
||||||
- views
|
- views
|
||||||
- nodequeue
|
- nodequeue
|
||||||
- oliverdavies.co.uk
|
- oliverdavies.co.uk
|
||||||
---
|
---
|
||||||
I recently decided that I wanted to have a block displayed in a sidebar on my site containing icons and links to my social media profiles - [Twitter](http://twitter.com/opdavies), [Facebook](http://facebook.com/opdavies) etc. I tried the [Follow](http://drupal.org/project/follow) module, but it lacked the option to add extra networks such my [Drupal.org](http://drupal.org/user/381388) account, and my [RSS feed](http://oliverdavies.co.uk/rss.xml). I started to create my own version, and then found [this Blog post](http://www.hankpalan.com/blog/drupal-themes/add-your-social-connections-drupal-icons) by Hank Palan.
|
I recently decided that I wanted to have a block displayed in a sidebar on my site containing icons and links to my social media profiles - [Twitter](http://twitter.com/opdavies), [Facebook](http://facebook.com/opdavies) etc. I tried the [Follow](http://drupal.org/project/follow) module, but it lacked the option to add extra networks such my [Drupal.org](http://drupal.org/user/381388) account, and my [RSS feed](http://oliverdavies.co.uk/rss.xml). I started to create my own version, and then found [this Blog post](http://www.hankpalan.com/blog/drupal-themes/add-your-social-connections-drupal-icons) by Hank Palan.
|
||||||
|
|
||||||
|
@ -20,4 +20,4 @@ I added fields for the node titles, and the link from the node's content. Both o
|
||||||
|
|
||||||
I also used the [Nodequeue](http://drupal.org/project/nodequeue) module to create a nodequeue and arrange the icons in the order that I wanted them to be displayed. Once this was added as a relationship within my View, I was able to use node's position in the nodequeue as the sort criteria.
|
I also used the [Nodequeue](http://drupal.org/project/nodequeue) module to create a nodequeue and arrange the icons in the order that I wanted them to be displayed. Once this was added as a relationship within my View, I was able to use node's position in the nodequeue as the sort criteria.
|
||||||
|
|
||||||
To complete the process, I used the [CSS Injector](http://drupal.org/project/css_injector) module to add some additional CSS styling to position and space out the icons.
|
To complete the process, I used the [CSS Injector](http://drupal.org/project/css_injector) module to add some additional CSS styling to position and space out the icons.
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
title: 10 Useful Drupal 6 Modules
|
title: 10 Useful Drupal 6 Modules
|
||||||
nav: blog
|
nav: blog
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-modules
|
- drupal-modules
|
||||||
---
|
---
|
||||||
Aside from the obvious candidates such as Views, CCK etc, here are a list of 10 contributed modules that I currently use on each Drupal project.
|
Aside from the obvious candidates such as Views, CCK etc, here are a list of 10 contributed modules that I currently use on each Drupal project.
|
||||||
|
|
||||||
|
@ -20,4 +20,4 @@ So, in no particular order:
|
||||||
* **[Node Picker](http://drupal.org/project/nodepicker):**<br>A rewrite of the module [TinyMCE Node Picker](http://drupal.org/project/tinymce_node_picker). Allows you to easily create links to internal nodes.
|
* **[Node Picker](http://drupal.org/project/nodepicker):**<br>A rewrite of the module [TinyMCE Node Picker](http://drupal.org/project/tinymce_node_picker). Allows you to easily create links to internal nodes.
|
||||||
* **[Module Filter](http://drupal.org/project/module_filter):**<br>What this module aims to accomplish is the ability to quickly find the module you are looking for without having to rely on the browsers search feature which more times than not shows you the module name in the 'Required by' or 'Depends on' sections of the various modules or even some other location on the page like a menu item.
|
* **[Module Filter](http://drupal.org/project/module_filter):**<br>What this module aims to accomplish is the ability to quickly find the module you are looking for without having to rely on the browsers search feature which more times than not shows you the module name in the 'Required by' or 'Depends on' sections of the various modules or even some other location on the page like a menu item.
|
||||||
* **[Zenophile](http://drupal.org/project/zenophile):**<br>Quickly create Zen subthemes.
|
* **[Zenophile](http://drupal.org/project/zenophile):**<br>Quickly create Zen subthemes.
|
||||||
* **[Add Another](http://drupal.org/project/addanother):**<br>Add another displays a message after a user creates a node, and/or displays an "Add another" tab on nodes allowing them to make another node of the same type. You can control what roles and node types see this feature.
|
* **[Add Another](http://drupal.org/project/addanother):**<br>Add another displays a message after a user creates a node, and/or displays an "Add another" tab on nodes allowing them to make another node of the same type. You can control what roles and node types see this feature.
|
||||||
|
|
|
@ -3,16 +3,16 @@ title: Create a Flickr Photo Gallery Using Feeds, CCK and Views
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: create-flickr-photo-gallery-using-feeds-cck-and-views
|
slug: create-flickr-photo-gallery-using-feeds-cck-and-views
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- photo-gallery
|
- photo-gallery
|
||||||
- views
|
- views
|
||||||
- cck
|
- cck
|
||||||
- imagecache
|
- imagecache
|
||||||
- feeds
|
- feeds
|
||||||
- filefield
|
- filefield
|
||||||
- flickr
|
- flickr
|
||||||
- imagefield
|
- imagefield
|
||||||
---
|
---
|
||||||
In this tutorial, I'll show you how to create a photo gallery which uses photos imported from [Flickr](http://www.flickr.com).
|
In this tutorial, I'll show you how to create a photo gallery which uses photos imported from [Flickr](http://www.flickr.com).
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ Next, I installed and configured the Feeds and Image Grabber module. I used an o
|
||||||
* **Processor settings:** I changed the content type to 'Photo', and the author's name from 'anonymous'.
|
* **Processor settings:** I changed the content type to 'Photo', and the author's name from 'anonymous'.
|
||||||
* **Processor mapping:** I added a new mapping from 'Item URL (link)' to 'Photo (FIG)'. The Photo FIG target is added by the Image Grabber module.
|
* **Processor mapping:** I added a new mapping from 'Item URL (link)' to 'Photo (FIG)'. The Photo FIG target is added by the Image Grabber module.
|
||||||
|
|
||||||
Next, I needed to create the actual Feed, which I did by clicking 'Import' within the Navigation menu, and clicking 'Feed'. I gave it a title, entered the URL to my RSS feed from Flickr, and enabled the Image Grabber for this feed.
|
Next, I needed to create the actual Feed, which I did by clicking 'Import' within the Navigation menu, and clicking 'Feed'. I gave it a title, entered the URL to my RSS feed from Flickr, and enabled the Image Grabber for this feed.
|
||||||
|
|
||||||
Once the Feed is created, the latest 20 images from the RSS feed are imported and 20 new Photos nodes are created. In the example below, the image with the 'Photo' label is the Image field mapped by the Image Grabber module. It is this image that I'll be displaying within my Gallery.
|
Once the Feed is created, the latest 20 images from the RSS feed are imported and 20 new Photos nodes are created. In the example below, the image with the 'Photo' label is the Image field mapped by the Image Grabber module. It is this image that I'll be displaying within my Gallery.
|
||||||
|
|
||||||
|
@ -43,4 +43,4 @@ With the new Photo nodes created, I then created the View to display them.
|
||||||
|
|
||||||
The View selects the image within the Photo content type, and displays in it a grid using an ImageCache preset. The View is limited to 20 nodes per page, and uses a full pager if this is exceeded. The nodes are sorted by the descending post date, and filtered by whether or not they are published, and only to include Photo nodes.
|
The View selects the image within the Photo content type, and displays in it a grid using an ImageCache preset. The View is limited to 20 nodes per page, and uses a full pager if this is exceeded. The nodes are sorted by the descending post date, and filtered by whether or not they are published, and only to include Photo nodes.
|
||||||
|
|
||||||
As an additional effect, I also included the 'Feeds Item - Item Link' field, which is basically the original link from the RSS feed. By checking the box the exclude the item from the display, it is not shown, but makes the link available to be used elsewhere. By checking the box 'Re-write the output for this field' on the 'Content: Photo' field, I was able to add the replacement token (in this case, [url]) as the path for a link around each image. This meant that when someone clicked a thumbnail of a photo, they were directed to the Flickr website instead of the node within my Drupal site.
|
As an additional effect, I also included the 'Feeds Item - Item Link' field, which is basically the original link from the RSS feed. By checking the box the exclude the item from the display, it is not shown, but makes the link available to be used elsewhere. By checking the box 'Re-write the output for this field' on the 'Content: Photo' field, I was able to add the replacement token (in this case, [url]) as the path for a link around each image. This meant that when someone clicked a thumbnail of a photo, they were directed to the Flickr website instead of the node within my Drupal site.
|
||||||
|
|
|
@ -3,13 +3,13 @@ title: Change the Content Type of Multiple Nodes Using SQL
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: change-content-type-multiple-nodes-using-sql
|
slug: change-content-type-multiple-nodes-using-sql
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- drupal
|
- drupal
|
||||||
- sql
|
- sql
|
||||||
- sequel-pro
|
- sequel-pro
|
||||||
- database
|
- database
|
||||||
- content-types
|
- content-types
|
||||||
---
|
---
|
||||||
In this post, I will be changing values within my Drupal 6 site's database to quickly change the content type of multiple nodes. I will be using a test development site with the core Blog module installed, and converting Blog posts to a custom content type called 'News article'.
|
In this post, I will be changing values within my Drupal 6 site's database to quickly change the content type of multiple nodes. I will be using a test development site with the core Blog module installed, and converting Blog posts to a custom content type called 'News article'.
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,11 @@ title: Create Virtual Hosts on Mac OS X Using VirtualHostX
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: create-virtual-hosts-mac-os-x-using-virtualhostx
|
slug: create-virtual-hosts-mac-os-x-using-virtualhostx
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- mamp
|
- mamp
|
||||||
- virtual-hosts
|
- virtual-hosts
|
||||||
- virtualhostx
|
- virtualhostx
|
||||||
---
|
---
|
||||||
This isn't a Drupal related topic per se, but it is a walk-through of one of the applications that I use whilst doing Drupal development work. I assume, like most Mac OS X users, I use [MAMP](http://www.mamp.info/en/index.html) to run Apache, MySQL and PHP locally whilst developing. I also use virtual hosts in Apache to create local .dev domains which are as close as possible to the actual live domains. For example, if I was developing a site called mysite.com, my local development version would be mysite.dev.
|
This isn't a Drupal related topic per se, but it is a walk-through of one of the applications that I use whilst doing Drupal development work. I assume, like most Mac OS X users, I use [MAMP](http://www.mamp.info/en/index.html) to run Apache, MySQL and PHP locally whilst developing. I also use virtual hosts in Apache to create local .dev domains which are as close as possible to the actual live domains. For example, if I was developing a site called mysite.com, my local development version would be mysite.dev.
|
||||||
|
|
||||||
|
@ -21,4 +21,4 @@ I ensured that my Apache configuration within MAMP was set to port 80, and that
|
||||||
|
|
||||||
After some troubleshooting, I found out that Web Sharing on my Mac had become enabled (I don't know why, I've never enabled it), and that this was causing a conflict with Apache. Once I opened my System Preferences and disabled it, everything worked fine!
|
After some troubleshooting, I found out that Web Sharing on my Mac had become enabled (I don't know why, I've never enabled it), and that this was causing a conflict with Apache. Once I opened my System Preferences and disabled it, everything worked fine!
|
||||||
|
|
||||||
This, along with [MAMP](http://www.mamp.info/en/index.html), [Coda](http://www.panic.com/coda), [Sequel Pro](http://www.sequelpro.com), and [Transmit](http://www.panic.com/transmit), has become an essential tool within my development environment.
|
This, along with [MAMP](http://www.mamp.info/en/index.html), [Coda](http://www.panic.com/coda), [Sequel Pro](http://www.sequelpro.com), and [Transmit](http://www.panic.com/transmit), has become an essential tool within my development environment.
|
||||||
|
|
|
@ -3,12 +3,12 @@ title: Add a Taxonomy Term to Multiple Nodes Using SQL
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: add-taxonomy-term-multiple-nodes-using-sql
|
slug: add-taxonomy-term-multiple-nodes-using-sql
|
||||||
tags:
|
tags:
|
||||||
- taxonomy
|
- taxonomy
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- sql
|
- sql
|
||||||
- sequal-pro
|
- sequal-pro
|
||||||
- database
|
- database
|
||||||
---
|
---
|
||||||
**Update:** This can also be done using the [Views Bulk Operations](http://drupal.org/project/views_bulk_operations) module.
|
**Update:** This can also be done using the [Views Bulk Operations](http://drupal.org/project/views_bulk_operations) module.
|
||||||
|
|
||||||
|
@ -48,4 +48,4 @@ SELECT nid, tid FROM term_node WHERE nid = 216;
|
||||||
|
|
||||||
Once the query had confirmed the correct tid value, I began to write the SQL Insert statement that would be needed to add the new term to the required nodes. The nid and vid values were the same on each node, and the value of my taxonomy term would need to be 84.
|
Once the query had confirmed the correct tid value, I began to write the SQL Insert statement that would be needed to add the new term to the required nodes. The nid and vid values were the same on each node, and the value of my taxonomy term would need to be 84.
|
||||||
|
|
||||||
Once this had completed with no errors, I returned to the administration area of my Drupal site to confirm whether or not the nodes had been assigned the new term.
|
Once this had completed with no errors, I returned to the administration area of my Drupal site to confirm whether or not the nodes had been assigned the new term.
|
||||||
|
|
|
@ -3,10 +3,10 @@ title: Review of the Teleport Module
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: review-teleport-module
|
slug: review-teleport-module
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- drupal-modules
|
- drupal-modules
|
||||||
- teleport
|
- teleport
|
||||||
---
|
---
|
||||||
As a heavily-reliant [Quicksilver](http://en.wikipedia.org/wiki/Quicksilver_%28software%29) user on my MacBook Pro, I was glad when I found the [Teleport](http://drupal.org/project/teleport) module for [Drupal](http://drupal.org) *(due to Elliott Rothman's [tweet](http://twitter.com/elliotttt/status/18044234238))*.
|
As a heavily-reliant [Quicksilver](http://en.wikipedia.org/wiki/Quicksilver_%28software%29) user on my MacBook Pro, I was glad when I found the [Teleport](http://drupal.org/project/teleport) module for [Drupal](http://drupal.org) *(due to Elliott Rothman's [tweet](http://twitter.com/elliotttt/status/18044234238))*.
|
||||||
|
|
||||||
|
@ -18,4 +18,4 @@ Although it's not a new module (the first commits were 2 years ago), I hope that
|
||||||
* 'Actions' like Quicksilver: if you select a node, a second input should appear with options to go to the View page, Edit page, (un)publish, etc. Same with users.
|
* 'Actions' like Quicksilver: if you select a node, a second input should appear with options to go to the View page, Edit page, (un)publish, etc. Same with users.
|
||||||
* Hook into more non-node content, like taxonomy terms and functions in the API module.
|
* Hook into more non-node content, like taxonomy terms and functions in the API module.
|
||||||
|
|
||||||
Personally, this will make navigation around both the front-end and administration area of my Drupal sites so much easier.
|
Personally, this will make navigation around both the front-end and administration area of my Drupal sites so much easier.
|
||||||
|
|
|
@ -3,11 +3,11 @@ title: Review of the Admin:hover Module
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: review-adminhover-module
|
slug: review-adminhover-module
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- drupal-modules
|
- drupal-modules
|
||||||
- admin:hover
|
- admin:hover
|
||||||
- administration
|
- administration
|
||||||
---
|
---
|
||||||
Sorry for the lack of Blog posts lately, but [my new job](http://horseandcountry.tv) that I started a few weeks ago has certainly been keeping me busy! I've got a few more posts that I'm preparing content for, and I'll hopefully be back into my weekly-post routine before too long!
|
Sorry for the lack of Blog posts lately, but [my new job](http://horseandcountry.tv) that I started a few weeks ago has certainly been keeping me busy! I've got a few more posts that I'm preparing content for, and I'll hopefully be back into my weekly-post routine before too long!
|
||||||
|
|
||||||
|
@ -38,4 +38,4 @@ It is also possible to customise which links are available from within the admin
|
||||||
* Configure block
|
* Configure block
|
||||||
* Add block
|
* Add block
|
||||||
|
|
||||||
Although, as I have additional contributed modules installed, some of these may not neccassaily be available out of the box.
|
Although, as I have additional contributed modules installed, some of these may not neccassaily be available out of the box.
|
||||||
|
|
|
@ -3,25 +3,25 @@ title: Create a Better Photo Gallery in Drupal - Part 1
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: create-better-photo-gallery-drupal-part-1
|
slug: create-better-photo-gallery-drupal-part-1
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- photo-gallery
|
- photo-gallery
|
||||||
- sql
|
- sql
|
||||||
- views
|
- views
|
||||||
- sequel-pro
|
- sequel-pro
|
||||||
- cck
|
- cck
|
||||||
- views-attach
|
- views-attach
|
||||||
- drupal
|
- drupal
|
||||||
---
|
---
|
||||||
Recently, I converted a client's static HTML website, along with their Coppermine Photo Gallery, into a Drupal-powered website.
|
Recently, I converted a client's static HTML website, along with their Coppermine Photo Gallery, into a Drupal-powered website.
|
||||||
|
|
||||||
Over the next few posts, I'll be replicating the process that I used during the conversion, and how I added some additional features to my Drupal gallery.
|
Over the next few posts, I'll be replicating the process that I used during the conversion, and how I added some additional features to my Drupal gallery.
|
||||||
|
|
||||||
To begin with, I created my photo gallery as described by [Jeff Eaton](http://www.lullabot.com/about/team/jeff-eaton) in [this screencast](http://www.lullabot.com/articles/photo-galleries-views-attach), downloaded all my client's previous photos via FTP, and quickly added them into the new gallery using the [Imagefield Import](http://drupal.org/project/imagefield_import) module (which I mentioned [previously](/blog/quickly-import-multiples-images-using-imagefieldimport-module/)).
|
To begin with, I created my photo gallery as described by [Jeff Eaton](http://www.lullabot.com/about/team/jeff-eaton) in [this screencast](http://www.lullabot.com/articles/photo-galleries-views-attach), downloaded all my client's previous photos via FTP, and quickly added them into the new gallery using the [Imagefield Import](http://drupal.org/project/imagefield_import) module (which I mentioned [previously](/blog/quickly-import-multiples-images-using-imagefieldimport-module/)).
|
||||||
|
|
||||||
When I compare this to the previous gallery, I can see several differences which I'd like to include. The first of which is the number of photos in each gallery, and the date that the most recent photo was added.
|
When I compare this to the previous gallery, I can see several differences which I'd like to include. The first of which is the number of photos in each gallery, and the date that the most recent photo was added.
|
||||||
|
|
||||||
To do this, I'd need to query my website's database. To begin with, I wanted to have a list of all the galleries on my site which are published, and what they're unique node ID values are. To do this, I opened Sequel Pro and entered the following code:
|
To do this, I'd need to query my website's database. To begin with, I wanted to have a list of all the galleries on my site which are published, and what they're unique node ID values are. To do this, I opened Sequel Pro and entered the following code:
|
||||||
|
|
||||||
~~~sql
|
~~~sql
|
||||||
SELECT title
|
SELECT title
|
||||||
|
@ -31,9 +31,9 @@ WHERE type = 'gallery'
|
||||||
AND status = 1;
|
AND status = 1;
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
As the nid value of each gallery corresponds with the 'field_gallery_nid' field within the content_type_photo field, I can now query the database and retrieve information about each specific gallery.
|
As the nid value of each gallery corresponds with the 'field_gallery_nid' field within the content_type_photo field, I can now query the database and retrieve information about each specific gallery.
|
||||||
|
|
||||||
For example, using [aliasing](http://www.w3schools.com/sql/sql_alias.asp) within my SQL statement, I can retrieve a list of all the published photos within the 'British Squad 2008' gallery by using the following code:
|
For example, using [aliasing](http://www.w3schools.com/sql/sql_alias.asp) within my SQL statement, I can retrieve a list of all the published photos within the 'British Squad 2008' gallery by using the following code:
|
||||||
|
|
||||||
~~~sql
|
~~~sql
|
||||||
SELECT n.title, n.nid, p.field_gallery_nid
|
SELECT n.title, n.nid, p.field_gallery_nid
|
||||||
|
@ -53,7 +53,7 @@ AND n.status = 1
|
||||||
AND n.nid = p.nid;
|
AND n.nid = p.nid;
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
As I've used the [Views Attach](http://drupal.org/project/views_attach) module, and I'm embedding the photos directly into the Gallery nodes, I easily add this to each gallery by creating a custom node-gallery.tpl.php file within my theme. I can then use the following PHP code to retrieve the node ID for that specific gallery:
|
As I've used the [Views Attach](http://drupal.org/project/views_attach) module, and I'm embedding the photos directly into the Gallery nodes, I easily add this to each gallery by creating a custom node-gallery.tpl.php file within my theme. I can then use the following PHP code to retrieve the node ID for that specific gallery:
|
||||||
|
|
||||||
~~~php
|
~~~php
|
||||||
<?php
|
<?php
|
||||||
|
@ -97,27 +97,27 @@ This was all then added into a 'print' statement which displayed it into the pag
|
||||||
~~~php
|
~~~php
|
||||||
<?php
|
<?php
|
||||||
if ($selected_gallery_total != 0) {
|
if ($selected_gallery_total != 0) {
|
||||||
$output = '<i>There are currently ' . $selected_gallery_total . ' photos in this gallery.';
|
$output = '<i>There are currently ' . $selected_gallery_total . ' photos in this gallery.';
|
||||||
$output .= 'Last one added on ' . $latest_photo . '</i>';
|
$output .= 'Last one added on ' . $latest_photo . '</i>';
|
||||||
print $output;
|
print $output;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
OK, so let's take a look at the Gallery so far:
|
OK, so let's take a look at the Gallery so far:
|
||||||
|
|
||||||
You will notice that the returned date value for the latest photo added is displaying the UNIX timestamp instead of in a more readable format. This can be changed by altering the 'print' statement to include a PHP 'date' function:
|
You will notice that the returned date value for the latest photo added is displaying the UNIX timestamp instead of in a more readable format. This can be changed by altering the 'print' statement to include a PHP 'date' function:
|
||||||
|
|
||||||
~~~php
|
~~~php
|
||||||
<?php
|
<?php
|
||||||
if ($selected_gallery_total != 0) {
|
if ($selected_gallery_total != 0) {
|
||||||
$output = '<i>There are currently ' . $selected_gallery_total . ' photos in this gallery.';
|
$output = '<i>There are currently ' . $selected_gallery_total . ' photos in this gallery.';
|
||||||
$output .= 'Last one added on ' . date("l, jS F, Y", $latest_photo) . '.</i>';
|
$output .= 'Last one added on ' . date("l, jS F, Y", $latest_photo) . '.</i>';
|
||||||
print $output;
|
print $output;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
The values that I've entered are from [this page](http://php.net/manual/en/function.date.php) on PHP.net, and can be changed according on how you want the date to be displayed.
|
The values that I've entered are from [this page](http://php.net/manual/en/function.date.php) on PHP.net, and can be changed according on how you want the date to be displayed.
|
||||||
|
|
||||||
As I've added all of these photos today, then the correct dates are being displayed. However, on the client's original website, the majority of these photos were pubished several months or years ago, and I'd like the new website to still reflect the original created dates. As opposed to modifying each individual photograph, I'll be doing this in bulk in my next post.
|
As I've added all of these photos today, then the correct dates are being displayed. However, on the client's original website, the majority of these photos were pubished several months or years ago, and I'd like the new website to still reflect the original created dates. As opposed to modifying each individual photograph, I'll be doing this in bulk in my next post.
|
||||||
|
|
|
@ -3,15 +3,15 @@ title: Create a Better Photo Gallery in Drupal - Part 2
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: create-better-photo-gallery-drupal-part-2
|
slug: create-better-photo-gallery-drupal-part-2
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- photo-gallery
|
- photo-gallery
|
||||||
- sql
|
- sql
|
||||||
- sequel-pro
|
- sequel-pro
|
||||||
---
|
---
|
||||||
At the end of my last post, I'd finished creating the first part of the new photo gallery, but I wanted to change the dates of the published photos to reflect the ones on the client's original website.
|
At the end of my last post, I'd finished creating the first part of the new photo gallery, but I wanted to change the dates of the published photos to reflect the ones on the client's original website.
|
||||||
|
|
||||||
Firstly, I'll refer to the previous list of published galleries that I created before, and create something different that also displays the created and modified dates. Picking the node ID of the required gallery, I used the following SQL query to display a list of photos.
|
Firstly, I'll refer to the previous list of published galleries that I created before, and create something different that also displays the created and modified dates. Picking the node ID of the required gallery, I used the following SQL query to display a list of photos.
|
||||||
|
|
||||||
~~~sql
|
~~~sql
|
||||||
SELECT n.title, n.nid, n.created, n.changed, p.field_gallery_nid
|
SELECT n.title, n.nid, n.created, n.changed, p.field_gallery_nid
|
||||||
|
@ -20,22 +20,22 @@ AND p.field_gallery_nid = 103AND n.nid = p.nid
|
||||||
ORDER BY n.nid ASC;
|
ORDER BY n.nid ASC;
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
When I look back at the old photo gallery, I can see that the previous 'last added' date was June 27, 2008. So, how do I update my new photos to reflect that date? Using <http://www.onlineconversion.com/unix_time.htm>, I can enter the required date in its readable format, and it will give me the equivilent UNIX timestamp. To keep things relatively simple, I'll set all photos within this gallery to the same time.
|
When I look back at the old photo gallery, I can see that the previous 'last added' date was June 27, 2008. So, how do I update my new photos to reflect that date? Using <http://www.onlineconversion.com/unix_time.htm>, I can enter the required date in its readable format, and it will give me the equivilent UNIX timestamp. To keep things relatively simple, I'll set all photos within this gallery to the same time.
|
||||||
|
|
||||||
The result that I'm given is '1217149200'. I can now use an UPDATE statement within another SQL query to update the created and modified dates.
|
The result that I'm given is '1217149200'. I can now use an UPDATE statement within another SQL query to update the created and modified dates.
|
||||||
|
|
||||||
~~~sql
|
~~~sql
|
||||||
UPDATE node
|
UPDATE node
|
||||||
INNER JOIN content_type_photo
|
INNER JOIN content_type_photo
|
||||||
ON node.nid = content_type_photo.nid
|
ON node.nid = content_type_photo.nid
|
||||||
SET
|
SET
|
||||||
node.created = 1217149200,
|
node.created = 1217149200,
|
||||||
node.changed = 1217149200
|
node.changed = 1217149200
|
||||||
WHERE content_type_photo.field_gallery_nid = 103
|
WHERE content_type_photo.field_gallery_nid = 103
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
Now when I query the database, both the created and modified databases have been updated, and when I return to the new photo gallery, the updated value is being displayed.
|
Now when I query the database, both the created and modified databases have been updated, and when I return to the new photo gallery, the updated value is being displayed.
|
||||||
|
|
||||||
Once the changes have been applied, it's a case of repeating the above process for each of the required galleries.
|
Once the changes have been applied, it's a case of repeating the above process for each of the required galleries.
|
||||||
|
|
||||||
In the next post, I'll explain how to add a count of published galleries and photos on the main photo gallery page, as well as how to install and configure the [Shadowbox](http://drupal.org/project/shadowbox) module.
|
In the next post, I'll explain how to add a count of published galleries and photos on the main photo gallery page, as well as how to install and configure the [Shadowbox](http://drupal.org/project/shadowbox) module.
|
||||||
|
|
|
@ -3,11 +3,11 @@ title: Review of the Image Caption Module
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: review-image-caption-module
|
slug: review-image-caption-module
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- imagefield
|
- imagefield
|
||||||
- image-caption
|
- image-caption
|
||||||
---
|
---
|
||||||
Up until as recent as last week, whenever I added an image into one of my Blog posts, I was manually adding the caption below each image and styling it accordingly. That was until I installed the [Image Caption](http://drupal.org/project/image_caption) module.
|
Up until as recent as last week, whenever I added an image into one of my Blog posts, I was manually adding the caption below each image and styling it accordingly. That was until I installed the [Image Caption](http://drupal.org/project/image_caption) module.
|
||||||
|
|
||||||
|
@ -21,4 +21,4 @@ As the Image Caption module uses the image's title tag to create the displayed c
|
||||||
|
|
||||||
This results in a span called `image-caption-container` around the inserted image, and a caption below it called `image-caption` containing the text.
|
This results in a span called `image-caption-container` around the inserted image, and a caption below it called `image-caption` containing the text.
|
||||||
|
|
||||||
All that's left is to style these classes within your CSS stylesheet.
|
All that's left is to style these classes within your CSS stylesheet.
|
||||||
|
|
|
@ -3,10 +3,10 @@ title: The Inaugural Meetup for the South Wales Drupal User Group
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: south-wales-drupal-user-group
|
slug: south-wales-drupal-user-group
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- swdug
|
- swdug
|
||||||
- meetups
|
- meetups
|
||||||
---
|
---
|
||||||
If you do Drupal, and you're in the area, come and join us for the first South Wales Drupal User Group Meetup!
|
If you do Drupal, and you're in the area, come and join us for the first South Wales Drupal User Group Meetup!
|
||||||
|
|
||||||
|
@ -17,4 +17,4 @@ We'll be meeting in the communal area just outside of the [SubHub](http://www.su
|
||||||
Cardiff<br>
|
Cardiff<br>
|
||||||
CF10 5FZ
|
CF10 5FZ
|
||||||
|
|
||||||
For more information and to signup, visit <http://groups.drupal.org/node/95104>.
|
For more information and to signup, visit <http://groups.drupal.org/node/95104>.
|
||||||
|
|
|
@ -3,27 +3,27 @@ title: How to Create and Apply Patches
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: create-and-apply-patches
|
slug: create-and-apply-patches
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- modules
|
- modules
|
||||||
- patches
|
- patches
|
||||||
---
|
---
|
||||||
Earlier this year, I posted a solution to [an issue](http://drupal.org/node/753898) on the Drupal.org issue queue. Originally, I just posted the code back onto the issue, but have now created a patch that can easily be applied to any Drupal 6 installation. Here is a run-through of the process of creating and applying a patch. In this case, I made changes to the `user_pass_validate()` function that's found within `modules/user/user.pages.inc`.
|
Earlier this year, I posted a solution to [an issue](http://drupal.org/node/753898) on the Drupal.org issue queue. Originally, I just posted the code back onto the issue, but have now created a patch that can easily be applied to any Drupal 6 installation. Here is a run-through of the process of creating and applying a patch. In this case, I made changes to the `user_pass_validate()` function that's found within `modules/user/user.pages.inc`.
|
||||||
|
|
||||||
To begin with, a download a fresh copy of Drupal 6.19 and created a copy of the original user.pages.inc file. Within the duplicate file, I made the same changes to the function that I did in earlier code, and saved the changes. Now, within my Terminal, I can navigate to Drupal's root directory and create the patch.
|
To begin with, a download a fresh copy of Drupal 6.19 and created a copy of the original user.pages.inc file. Within the duplicate file, I made the same changes to the function that I did in earlier code, and saved the changes. Now, within my Terminal, I can navigate to Drupal's root directory and create the patch.
|
||||||
|
|
||||||
diff -rup modules/user/user.pages.inc modules/user/user.pages2.inc > /Users/oliver/Desktop/different_messages_for_blocked_users.patch
|
diff -rup modules/user/user.pages.inc modules/user/user.pages2.inc > /Users/oliver/Desktop/different_messages_for_blocked_users.patch
|
||||||
|
|
||||||
This command compares the differences between the two files, and creates the specified patch file.
|
This command compares the differences between the two files, and creates the specified patch file.
|
||||||
|
|
||||||
To apply the patch to my Drupal installation, I go back to Terminal and run the following code:
|
To apply the patch to my Drupal installation, I go back to Terminal and run the following code:
|
||||||
|
|
||||||
patch -p0 < /Users/oliver/Desktop/different_messages_for_blocked_users.patch
|
patch -p0 < /Users/oliver/Desktop/different_messages_for_blocked_users.patch
|
||||||
|
|
||||||
If, for some reason, I need to reverse the patch, I can run this code:
|
If, for some reason, I need to reverse the patch, I can run this code:
|
||||||
|
|
||||||
patch -p0 -R < /Users/oliver/Desktop/different_messages_for_blocked_users.patch
|
patch -p0 -R < /Users/oliver/Desktop/different_messages_for_blocked_users.patch
|
||||||
|
|
||||||
And that's it!
|
And that's it!
|
||||||
|
|
||||||
There is also a Git patch creation workflow, which is described at <http://groups.drupal.org/node/91424>. Thanks to [Randy Fay](http://randyfay.com) for making me aware of this, and suggesting a slight change to my original patch creation command.
|
There is also a Git patch creation workflow, which is described at <http://groups.drupal.org/node/91424>. Thanks to [Randy Fay](http://randyfay.com) for making me aware of this, and suggesting a slight change to my original patch creation command.
|
||||||
|
|
|
@ -3,7 +3,7 @@ title: Create a Better Photo Gallery in Drupal - Part 3
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: create-better-photo-gallery-drupal-part-3
|
slug: create-better-photo-gallery-drupal-part-3
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
---
|
---
|
||||||
The next part of the new gallery that I want to implement is to group the galleries by their respective categories. The first step is to edit my original photo_gallery view and add an additional display.
|
The next part of the new gallery that I want to implement is to group the galleries by their respective categories. The first step is to edit my original photo_gallery view and add an additional display.
|
||||||
|
|
||||||
|
@ -27,8 +27,8 @@ To reduce the amount of code needed, I can use the following 'while' loop to gen
|
||||||
<?php
|
<?php
|
||||||
$terms = db_query("SELECT * FROM {term_data} WHERE vid = 1");
|
$terms = db_query("SELECT * FROM {term_data} WHERE vid = 1");
|
||||||
while ($term = db_fetch_array($terms)) {
|
while ($term = db_fetch_array($terms)) {
|
||||||
print '<h3>' . $term['name'] . '</h3>';
|
print '<h3>' . $term['name'] . '</h3>';
|
||||||
print views_embed_view('gallery', 'page_2', $term['name']);
|
print views_embed_view('gallery', 'page_2', $term['name']);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
~~~
|
~~~
|
||||||
|
|
|
@ -3,7 +3,7 @@ title: Create a Better Photo Gallery in Drupal - Part 2.1
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: create-better-photo-gallery-drupal-part-21
|
slug: create-better-photo-gallery-drupal-part-21
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
---
|
---
|
||||||
Today, I realised that I hadn't published the code that I used to create the total figures of galleries and photos at the top of the gallery (I said at the end of [Part 2](/blog/create-better-photo-gallery-drupal-part-2/ "Create a Better Photo Gallery in Drupal - Part 2") that I'd include it in [Part 3](/blog/create-better-photo-gallery-drupal-part-3/ "Create a Better Photo Gallery in Drupal - Part 3"), but I forgot). So, here it is:
|
Today, I realised that I hadn't published the code that I used to create the total figures of galleries and photos at the top of the gallery (I said at the end of [Part 2](/blog/create-better-photo-gallery-drupal-part-2/ "Create a Better Photo Gallery in Drupal - Part 2") that I'd include it in [Part 3](/blog/create-better-photo-gallery-drupal-part-3/ "Create a Better Photo Gallery in Drupal - Part 3"), but I forgot). So, here it is:
|
||||||
|
|
||||||
|
@ -16,41 +16,41 @@ $galleries = db_query("SELECT nid FROM {node} WHERE type = 'gallery' AND status
|
||||||
$output = 0;
|
$output = 0;
|
||||||
// Prints a list of nids of published galleries.
|
// Prints a list of nids of published galleries.
|
||||||
while($gallery = db_fetch_array($galleries)) {
|
while($gallery = db_fetch_array($galleries)) {
|
||||||
$gallery_id = $gallery['nid'];
|
$gallery_id = $gallery['nid'];
|
||||||
$photos = $photos + db_result(db_query("SELECT COUNT(*) FROM node n, content_type_photo ctp WHERE n.status = 1 AND n.type = 'photo' AND ctp.field_gallery_nid = $gallery_id AND n.nid = ctp.nid"));
|
$photos = $photos + db_result(db_query("SELECT COUNT(*) FROM node n, content_type_photo ctp WHERE n.status = 1 AND n.type = 'photo' AND ctp.field_gallery_nid = $gallery_id AND n.nid = ctp.nid"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prints the output.
|
// Prints the output.
|
||||||
print 'There ';
|
print 'There ';
|
||||||
if($photos == 1) {
|
if($photos == 1) {
|
||||||
print 'is';
|
print 'is';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print 'are';
|
print 'are';
|
||||||
}
|
}
|
||||||
print ' currently ';
|
print ' currently ';
|
||||||
print $photos . ' ';
|
print $photos . ' ';
|
||||||
if($photos == 1) {
|
if($photos == 1) {
|
||||||
print 'photo';
|
print 'photo';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print 'photos';
|
print 'photos';
|
||||||
}
|
}
|
||||||
print ' in ';
|
print ' in ';
|
||||||
|
|
||||||
// Counts the number of published galleries on the site.
|
// Counts the number of published galleries on the site.
|
||||||
$galleries = db_result(db_query("SELECT COUNT(*) FROM {node} WHERE TYPE = 'gallery' AND STATUS = 1"));
|
$galleries = db_result(db_query("SELECT COUNT(*) FROM {node} WHERE TYPE = 'gallery' AND STATUS = 1"));
|
||||||
|
|
||||||
// Prints the number of published galleries.
|
// Prints the number of published galleries.
|
||||||
print $galleries;
|
print $galleries;
|
||||||
if ($galleries == 1) {
|
if ($galleries == 1) {
|
||||||
print ' gallery';
|
print ' gallery';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print ' galleries';
|
print ' galleries';
|
||||||
}
|
}
|
||||||
print '.';
|
print '.';
|
||||||
?>
|
?>
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
It was applied to the view as a header which had the input format set to PHP code.
|
It was applied to the view as a header which had the input format set to PHP code.
|
||||||
|
|
|
@ -3,12 +3,12 @@ title: Use Regular Expressions to Search and Replace in Coda or TextMate
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: use-regular-expressions-search-and-replace-coda-or-textmate
|
slug: use-regular-expressions-search-and-replace-coda-or-textmate
|
||||||
tags:
|
tags:
|
||||||
- taxonomy
|
- taxonomy
|
||||||
- sequel-pro
|
- sequel-pro
|
||||||
- database
|
- database
|
||||||
- coda
|
- coda
|
||||||
- regular-expression
|
- regular-expression
|
||||||
- textmate
|
- textmate
|
||||||
---
|
---
|
||||||
As in [the original post](/blog/add-taxonomy-term-multiple-nodes-using-sql/ "Quickly adding a taxonomy term to multiple nodes using SQL"), I'd generated a list of node ID values, and needed to add structure the SQL update statment formatted in a certain way. However, I changed my inital query slightly to out put the same nid value twice.
|
As in [the original post](/blog/add-taxonomy-term-multiple-nodes-using-sql/ "Quickly adding a taxonomy term to multiple nodes using SQL"), I'd generated a list of node ID values, and needed to add structure the SQL update statment formatted in a certain way. However, I changed my inital query slightly to out put the same nid value twice.
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@ title: Easily Embed TypeKit Fonts into your Drupal Website
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: easily-embed-typekit-fonts-your-drupal-website
|
slug: easily-embed-typekit-fonts-your-drupal-website
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- typekit
|
- typekit
|
||||||
---
|
---
|
||||||
To begin with, you will need to [register for a TypeKit account](https://typekit.com/plans) - there is a free version if you just want to try it out.
|
To begin with, you will need to [register for a TypeKit account](https://typekit.com/plans) - there is a free version if you just want to try it out.
|
||||||
|
|
||||||
|
@ -17,4 +17,4 @@ Download and install the [@font-your-face](http://drupal.org/project/fontyourfac
|
||||||
|
|
||||||
Go to admin/build/themes/fontyourface, and click 'Browse fonts to enable'. Click on the name of the font that you want to enable, check 'Enabled', and click 'Edit font' to save your changes.
|
Go to admin/build/themes/fontyourface, and click 'Browse fonts to enable'. Click on the name of the font that you want to enable, check 'Enabled', and click 'Edit font' to save your changes.
|
||||||
|
|
||||||
With the font enabled, you can now use it in your CSS.
|
With the font enabled, you can now use it in your CSS.
|
||||||
|
|
|
@ -3,7 +3,7 @@ title: Display the Number of Facebook fans in PHP
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: display-number-facebook-fans-php
|
slug: display-number-facebook-fans-php
|
||||||
tags:
|
tags:
|
||||||
- php
|
- php
|
||||||
---
|
---
|
||||||
Replace the $page_id value with your Page ID number (unless you want to show the number of fans for this site).You can find your Page ID by logging into your Facebook account, going to 'Adverts and Pages', clicking 'Edit page', and looking at the URL.
|
Replace the $page_id value with your Page ID number (unless you want to show the number of fans for this site).You can find your Page ID by logging into your Facebook account, going to 'Adverts and Pages', clicking 'Edit page', and looking at the URL.
|
||||||
|
|
||||||
|
@ -18,4 +18,4 @@ $fans = $xml->page->fan_count;
|
||||||
print number_format($fans);
|
print number_format($fans);
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
This code was originally found at <http://wp-snippets.com/display-number-facebook-fans>.
|
This code was originally found at <http://wp-snippets.com/display-number-facebook-fans>.
|
||||||
|
|
|
@ -3,8 +3,8 @@ title: Proctor & Stevenson
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: proctor-stevenson
|
slug: proctor-stevenson
|
||||||
tags:
|
tags:
|
||||||
- personal
|
- personal
|
||||||
---
|
---
|
||||||
2 weeks ago, I handed in my notice of resignation to [Horse & Country TV](http://horseandcountry.tv)because I've been offered a new role at [Proctor & Stevenson](http://proctors.co.uk) - a Marketing Design and Communications agency in Bristol.
|
2 weeks ago, I handed in my notice of resignation to [Horse & Country TV](http://horseandcountry.tv)because I've been offered a new role at [Proctor & Stevenson](http://proctors.co.uk) - a Marketing Design and Communications agency in Bristol.
|
||||||
|
|
||||||
Proctors have an [extensive client list](http://www.proctors.co.uk/clients) - including [BMW](http://www.proctors.co.uk/clients/bmw-financial-services), [Panasonic](http://www.proctors.co.uk/clients/panasonic), the [Open University](http://www.proctors.co.uk/clients/open-university) and [VOSA](http://www.proctors.co.uk/clients/vosa), and it's going to be a fantastic opportunity for me to continue expanding my skillset whilst gaining vital experience.
|
Proctors have an [extensive client list](http://www.proctors.co.uk/clients) - including [BMW](http://www.proctors.co.uk/clients/bmw-financial-services), [Panasonic](http://www.proctors.co.uk/clients/panasonic), the [Open University](http://www.proctors.co.uk/clients/open-university) and [VOSA](http://www.proctors.co.uk/clients/vosa), and it's going to be a fantastic opportunity for me to continue expanding my skillset whilst gaining vital experience.
|
||||||
|
|
|
@ -3,9 +3,9 @@ title: Proctors Hosting the next Drupal Meetup
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: proctors-hosting-next-drupal-meetup
|
slug: proctors-hosting-next-drupal-meetup
|
||||||
tags:
|
tags:
|
||||||
- meetups
|
- meetups
|
||||||
- drupal-bristol
|
- drupal-bristol
|
||||||
---
|
---
|
||||||
My employer, [Proctor & Stevenson](http://www.proctors.co.uk), are going to be hosting the next Bristol & South West Drupal meetup on the 25th May at our offices.
|
My employer, [Proctor & Stevenson](http://www.proctors.co.uk), are going to be hosting the next Bristol & South West Drupal meetup on the 25th May at our offices.
|
||||||
|
|
||||||
You can [view more details](http://groups.drupal.org/node/147324), or register [on our website](http://www.proctors.co.uk/Drupal-SWUG-Meetup).
|
You can [view more details](http://groups.drupal.org/node/147324), or register [on our website](http://www.proctors.co.uk/Drupal-SWUG-Meetup).
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
title: Imagefield Import Archive
|
title: Imagefield Import Archive
|
||||||
nav: blog
|
nav: blog
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- imagefield-import
|
- imagefield-import
|
||||||
---
|
---
|
||||||
I've finally uploaded my first module onto Drupal.org!
|
I've finally uploaded my first module onto Drupal.org!
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,13 @@ title: Create Multigroups in Drupal 7 using Field Collections
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: create-multigroups-drupal-7-using-field-collections
|
slug: create-multigroups-drupal-7-using-field-collections
|
||||||
tags:
|
tags:
|
||||||
- drupal-7
|
- drupal-7
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- cck
|
- cck
|
||||||
- fields
|
- fields
|
||||||
- field-collection
|
- field-collection
|
||||||
- entity-api
|
- entity-api
|
||||||
- multigroup
|
- multigroup
|
||||||
---
|
---
|
||||||
One of my favourite things lately in Drupal 6 has been CCK 3, and more specifically, the Content Multigroups sub-module. Basically this allows you to create a fieldset of various CCK fields, and then repeat that multiple times. For example, I use it on this site whist creating invoices for clients. I have a fieldset called 'Line Item', containing 'Description', 'Quantity' and 'Price' fields. With a standard fieldset, I could only have one instance of each field - however, using a multigroup, I can create multiple groups of line items which I then use within the invoice.
|
One of my favourite things lately in Drupal 6 has been CCK 3, and more specifically, the Content Multigroups sub-module. Basically this allows you to create a fieldset of various CCK fields, and then repeat that multiple times. For example, I use it on this site whist creating invoices for clients. I have a fieldset called 'Line Item', containing 'Description', 'Quantity' and 'Price' fields. With a standard fieldset, I could only have one instance of each field - however, using a multigroup, I can create multiple groups of line items which I then use within the invoice.
|
||||||
|
|
||||||
|
@ -27,4 +27,4 @@ Whilst this works perfectly, the field collection is not editable from the node
|
||||||
|
|
||||||
After some searching I found [a link to a patch](http://drupal.org/node/977890#comment-4184524) which when applied adds a 'subform' widget type to the field collection field and allows for it to be embedded into, and editable from within the node form. Going back to the content type fields page, and clicking on 'Hidden' (the name of the current widget), I can change it to subform and save my changes.
|
After some searching I found [a link to a patch](http://drupal.org/node/977890#comment-4184524) which when applied adds a 'subform' widget type to the field collection field and allows for it to be embedded into, and editable from within the node form. Going back to the content type fields page, and clicking on 'Hidden' (the name of the current widget), I can change it to subform and save my changes.
|
||||||
|
|
||||||
With this change applied, when I go back to add or edit a node within this content type, my field collection will be easily editable directly within the form.
|
With this change applied, when I go back to add or edit a node within this content type, my field collection will be easily editable directly within the form.
|
||||||
|
|
|
@ -3,9 +3,9 @@ title: How to Install and Configure Subversion (SVN) Server on Ubuntu
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: install-and-configure-subversion-svn-server-ubuntu
|
slug: install-and-configure-subversion-svn-server-ubuntu
|
||||||
tags:
|
tags:
|
||||||
- svn
|
- svn
|
||||||
- ubuntu
|
- ubuntu
|
||||||
- version-control
|
- version-control
|
||||||
---
|
---
|
||||||
Recently, I needed to set up a Subversion (SVN) server on a Ubuntu Linux server. This post is going to outline the steps taken, and the commands used, to install and configure the service.
|
Recently, I needed to set up a Subversion (SVN) server on a Ubuntu Linux server. This post is going to outline the steps taken, and the commands used, to install and configure the service.
|
||||||
|
|
||||||
|
@ -13,11 +13,11 @@ Note: As I was using Ubuntu, I was using the 'apt-get' command to download and i
|
||||||
|
|
||||||
Firstly, I'm going to ensure that all of my installed packages are up to date, and install any available updates.
|
Firstly, I'm going to ensure that all of my installed packages are up to date, and install any available updates.
|
||||||
|
|
||||||
$ sudo apt-get update
|
$ sudo apt-get update
|
||||||
|
|
||||||
Now, I need to download the subversion, subversion-tools and libapache2 packages.
|
Now, I need to download the subversion, subversion-tools and libapache2 packages.
|
||||||
|
|
||||||
$ sudo apt-get install subversion subversion-tools libapache2-svn
|
$ sudo apt-get install subversion subversion-tools libapache2-svn
|
||||||
|
|
||||||
These are all of the packages that are needed to run a Subversion server.
|
These are all of the packages that are needed to run a Subversion server.
|
||||||
|
|
||||||
|
@ -25,55 +25,55 @@ These are all of the packages that are needed to run a Subversion server.
|
||||||
|
|
||||||
Now, I need to create the directory where my repositories are going to sit. I've chosen this directory as I know that it's one that is accessible to my managed backup service.
|
Now, I need to create the directory where my repositories are going to sit. I've chosen this directory as I know that it's one that is accessible to my managed backup service.
|
||||||
|
|
||||||
$ sudo mkdir /home/svn
|
$ sudo mkdir /home/svn
|
||||||
|
|
||||||
## Create a test repository
|
## Create a test repository
|
||||||
|
|
||||||
First, I'll create a new folder in which I'll create my test project, and then I'll create a repository for it.
|
First, I'll create a new folder in which I'll create my test project, and then I'll create a repository for it.
|
||||||
|
|
||||||
$ sudo mkdir ~/test
|
$ sudo mkdir ~/test
|
||||||
$ sudo svnadmin create /home/svn/test -m 'initial project structure'
|
$ sudo svnadmin create /home/svn/test -m 'initial project structure'
|
||||||
|
|
||||||
This will create a new repository containing the base file structure.
|
This will create a new repository containing the base file structure.
|
||||||
|
|
||||||
## Adding files into the test project
|
## Adding files into the test project
|
||||||
|
|
||||||
$ cd ~/test
|
$ cd ~/test
|
||||||
$ mkdir trunk tags branches
|
$ mkdir trunk tags branches
|
||||||
|
|
||||||
I can now import these new directories into the test repository.
|
I can now import these new directories into the test repository.
|
||||||
|
|
||||||
$ sudo svn import ~/test file:///home/svn/test -m 'Initial project directories'
|
$ sudo svn import ~/test file:///home/svn/test -m 'Initial project directories'
|
||||||
|
|
||||||
This both adds and commits these new directories into the repository.
|
This both adds and commits these new directories into the repository.
|
||||||
|
|
||||||
In order for Apache to access the SVN repositories, the `/home/svn` directory needs to be owned by the same user and group that Apache runs as. In Ubuntu, this is usually www-data. To change the owner of a directory, use the chown command.
|
In order for Apache to access the SVN repositories, the `/home/svn` directory needs to be owned by the same user and group that Apache runs as. In Ubuntu, this is usually www-data. To change the owner of a directory, use the chown command.
|
||||||
|
|
||||||
$ sudo chown -R www-data:www-data /home/svn
|
$ sudo chown -R www-data:www-data /home/svn
|
||||||
|
|
||||||
## Configuring Apache
|
## Configuring Apache
|
||||||
|
|
||||||
The first thing that I need to do is enable the dav_svn Apache module, using the a2enmod command.
|
The first thing that I need to do is enable the dav_svn Apache module, using the a2enmod command.
|
||||||
|
|
||||||
$ sudo a2enmod dav_svn
|
$ sudo a2enmod dav_svn
|
||||||
|
|
||||||
With this enabled, now I need to modify the Apache configuration file.
|
With this enabled, now I need to modify the Apache configuration file.
|
||||||
|
|
||||||
$ cd /etc/apache2
|
$ cd /etc/apache2
|
||||||
$ sudo nano apache2.conf
|
$ sudo nano apache2.conf
|
||||||
|
|
||||||
At the bottom of the file, add the following lines, and then save the file by pressing Ctrl+X.
|
At the bottom of the file, add the following lines, and then save the file by pressing Ctrl+X.
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
<Location "/svn">
|
<Location "/svn">
|
||||||
DAV svn
|
DAV svn
|
||||||
SVNParentPath /home/svn
|
SVNParentPath /home/svn
|
||||||
</Location>
|
</Location>
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
With this saved, restart the Apache service for the changes to be applied.
|
With this saved, restart the Apache service for the changes to be applied.
|
||||||
|
|
||||||
sudo service apache2 restart
|
sudo service apache2 restart
|
||||||
|
|
||||||
I can now browse through my test repository by opening Firefox, and navigating to `http://127.0.0.1/svn/test`. Here, I can now see my three directories, although they are currently all empty.
|
I can now browse through my test repository by opening Firefox, and navigating to `http://127.0.0.1/svn/test`. Here, I can now see my three directories, although they are currently all empty.
|
||||||
|
|
||||||
|
@ -87,18 +87,18 @@ Re-open apache2.conf, and replace the SVN Location information with this:
|
||||||
|
|
||||||
~~~~
|
~~~~
|
||||||
<Location "/svn">
|
<Location "/svn">
|
||||||
DAV svn
|
DAV svn
|
||||||
SVNParentPath /home/svn
|
SVNParentPath /home/svn
|
||||||
AuthType Basic
|
AuthType Basic
|
||||||
AuthName "My SVN Repositories"
|
AuthName "My SVN Repositories"
|
||||||
AuthUserFile /etc/svn-auth
|
AuthUserFile /etc/svn-auth
|
||||||
Require valid-user
|
Require valid-user
|
||||||
</Location>
|
</Location>
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
Now I need to create the password file.
|
Now I need to create the password file.
|
||||||
|
|
||||||
$ htpasswd -cm /etc/svn-auth oliver
|
$ htpasswd -cm /etc/svn-auth oliver
|
||||||
|
|
||||||
I'm prompted to enter and confirm my password, and then my details are saved. The Apache service will need to be restarted again, and then the user will need to authenticate themselves before viewing the repositories.
|
I'm prompted to enter and confirm my password, and then my details are saved. The Apache service will need to be restarted again, and then the user will need to authenticate themselves before viewing the repositories.
|
||||||
|
|
||||||
|
@ -108,15 +108,15 @@ I'm prompted to enter and confirm my password, and then my details are saved. Th
|
||||||
|
|
||||||
For example, now want to checkout the files within my repository into a new directory called 'test2' within my home directory. Firstly, I need to create the new directory, and then I can issue the checkout command.
|
For example, now want to checkout the files within my repository into a new directory called 'test2' within my home directory. Firstly, I need to create the new directory, and then I can issue the checkout command.
|
||||||
|
|
||||||
$ cd ~
|
$ cd ~
|
||||||
$ mkdir test2
|
$ mkdir test2
|
||||||
$ svn checkout http://127.0.0.1/svn/test/trunk test2
|
$ svn checkout http://127.0.0.1/svn/test/trunk test2
|
||||||
|
|
||||||
I'm passing the command two arguments - the first is the URL of the repository's trunk directory, and the second is the directory where the files are to be placed. As no files have been commited yet into the trunk, it appears to be empty - but if you perform an ls -la command, you'll see that there is a hidden .svn directory.
|
I'm passing the command two arguments - the first is the URL of the repository's trunk directory, and the second is the directory where the files are to be placed. As no files have been commited yet into the trunk, it appears to be empty - but if you perform an ls -la command, you'll see that there is a hidden .svn directory.
|
||||||
|
|
||||||
Now you can start adding files into the directory. Once you've created your files, perform a svn add command, passing in individual filenames as further arguments.
|
Now you can start adding files into the directory. Once you've created your files, perform a svn add command, passing in individual filenames as further arguments.
|
||||||
|
|
||||||
$ svn add index.php
|
$ svn add index.php
|
||||||
$ svn add *
|
$ svn add *
|
||||||
|
|
||||||
With all the required files added, they can be committed using `svn commit -m 'commit message'` command, and the server can be updated using the svn up command.
|
With all the required files added, they can be committed using `svn commit -m 'commit message'` command, and the server can be updated using the svn up command.
|
||||||
|
|
|
@ -3,17 +3,17 @@ title: How to use Authorized Keys to Create a Passwordless SSH Connection
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: use-authorized-keys-create-passwordless-ssh-connection
|
slug: use-authorized-keys-create-passwordless-ssh-connection
|
||||||
tags:
|
tags:
|
||||||
- linux
|
- linux
|
||||||
- ssh
|
- ssh
|
||||||
---
|
---
|
||||||
If you're accessing Linux servers or automating tasks between servers, rather than having to enter your user password every time, you can also use SSH public key authentication. This is a simple process that involves creating a local key and storing it within the *authorized_keys* file on the remote server.
|
If you're accessing Linux servers or automating tasks between servers, rather than having to enter your user password every time, you can also use SSH public key authentication. This is a simple process that involves creating a local key and storing it within the *authorized_keys* file on the remote server.
|
||||||
|
|
||||||
1. Check if you already have a SSH key.
|
1. Check if you already have a SSH key.
|
||||||
`$ ssh-add -L`
|
`$ ssh-add -L`
|
||||||
2. If you don't have one, create one.
|
2. If you don't have one, create one.
|
||||||
`$ ssh-keygen`
|
`$ ssh-keygen`
|
||||||
2. Upload the key onto the server. Replace *myserver* with the hostname or IP address of your remote server.
|
2. Upload the key onto the server. Replace *myserver* with the hostname or IP address of your remote server.
|
||||||
`$ ssh-copy-id myserver`
|
`$ ssh-copy-id myserver`
|
||||||
|
|
||||||
If you're using Mac OS X and you don't have ssh-copy-id installed, download and install [Homebrew](http://mxcl.github.com/homebrew "Homebrew") and run the `brew install ssh-copy-id` command.
|
If you're using Mac OS X and you don't have ssh-copy-id installed, download and install [Homebrew](http://mxcl.github.com/homebrew "Homebrew") and run the `brew install ssh-copy-id` command.
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ If successful, you should now see a message like:
|
||||||
|
|
||||||
> Now try logging into the machine, with "ssh 'myserver'", and check in:
|
> Now try logging into the machine, with "ssh 'myserver'", and check in:
|
||||||
>
|
>
|
||||||
> ~/.ssh/authorized_keys
|
> ~/.ssh/authorized_keys
|
||||||
>
|
>
|
||||||
> to make sure we haven't added extra keys that you weren't expecting.
|
> to make sure we haven't added extra keys that you weren't expecting.
|
||||||
|
|
||||||
Now the next time that you SSH onto the server, it should log you in without prompting you for your password.
|
Now the next time that you SSH onto the server, it should log you in without prompting you for your password.
|
||||||
|
|
|
@ -3,32 +3,32 @@ title: Create an Omega Subtheme with LESS CSS Preprocessor using Omega Tools and
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: create-omega-subtheme-less-css-preprocessor-using-omega-tools-and-drush
|
slug: create-omega-subtheme-less-css-preprocessor-using-omega-tools-and-drush
|
||||||
tags:
|
tags:
|
||||||
- drupal-7
|
- drupal-7
|
||||||
- omega
|
- omega
|
||||||
- theming
|
- theming
|
||||||
- less
|
- less
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal
|
- drupal
|
||||||
---
|
---
|
||||||
In this tutorial I'll be showing how to create an [Omega](http://drupal.org/project/omega) subtheme using the [Omega Tools](http://drupal.org/project/omega_tools) module, and have it working with the [LESS CSS preprocessor](http://lesscss.org).
|
In this tutorial I'll be showing how to create an [Omega](http://drupal.org/project/omega) subtheme using the [Omega Tools](http://drupal.org/project/omega_tools) module, and have it working with the [LESS CSS preprocessor](http://lesscss.org).
|
||||||
|
|
||||||
The first thing that I need to do is download the Omega theme and the Omega Tools and [LESS](http://drupal.org/project/less "LESS module on drupal.org") modules, and then to enable both modules. I'm doing this using Drush, but you can of course do this via the admin interface at admin/modules.
|
The first thing that I need to do is download the Omega theme and the Omega Tools and [LESS](http://drupal.org/project/less "LESS module on drupal.org") modules, and then to enable both modules. I'm doing this using Drush, but you can of course do this via the admin interface at admin/modules.
|
||||||
|
|
||||||
$ drush dl less omega omega_tools;
|
$ drush dl less omega omega_tools;
|
||||||
$ drush en -y less omega_tools
|
$ drush en -y less omega_tools
|
||||||
|
|
||||||
With the Omega Tools module enabled I get the drush omega-subtheme command that creates my Omega subtheme programatically. Using this command, I'm creating a new subtheme, enabling it and setting it as the default theme on my site.
|
With the Omega Tools module enabled I get the drush omega-subtheme command that creates my Omega subtheme programatically. Using this command, I'm creating a new subtheme, enabling it and setting it as the default theme on my site.
|
||||||
|
|
||||||
$ drush omega-subtheme "Oliver Davies" --machine_name="oliverdavies" --enable --set-default
|
$ drush omega-subtheme "Oliver Davies" --machine_name="oliverdavies" --enable --set-default
|
||||||
|
|
||||||
By default, four stylesheets are created within the subtheme's css directory. The first thing that I'm going to do is rename `global.css` to `global.less`.
|
By default, four stylesheets are created within the subtheme's css directory. The first thing that I'm going to do is rename `global.css` to `global.less`.
|
||||||
|
|
||||||
$ mv css/global.css css/global.less
|
$ mv css/global.css css/global.less
|
||||||
|
|
||||||
Now I need to find all references to global.css within my oliverdavies.info file. I did this using `$ nano oliverdavies.info`, pressing `Ctrl+W` to search, then `Ctrl+R` to replace, entering `global.css` as the search phrase, and then `global.less` as the replacement text. After making any changes to oliverdavies.info, I need to clear Drupal's caches for the changes to be applied.
|
Now I need to find all references to global.css within my oliverdavies.info file. I did this using `$ nano oliverdavies.info`, pressing `Ctrl+W` to search, then `Ctrl+R` to replace, entering `global.css` as the search phrase, and then `global.less` as the replacement text. After making any changes to oliverdavies.info, I need to clear Drupal's caches for the changes to be applied.
|
||||||
|
|
||||||
$ drush cc all
|
$ drush cc all
|
||||||
|
|
||||||
I tested my changes by making some quick additions to my global.less file and reloading the page.
|
I tested my changes by making some quick additions to my global.less file and reloading the page.
|
||||||
|
|
||||||
If your changes aren't applied, then confirm that your global.less file is enabled within your theme's configuration. I did this by going to admin/appearance/settings/oliverdavies, clicking on the Toggle styles tab within *Layout configuration* and finding global.less at the bottom of *Enable optional stylesheets*.
|
If your changes aren't applied, then confirm that your global.less file is enabled within your theme's configuration. I did this by going to admin/appearance/settings/oliverdavies, clicking on the Toggle styles tab within *Layout configuration* and finding global.less at the bottom of *Enable optional stylesheets*.
|
||||||
|
|
|
@ -3,9 +3,9 @@ title: Installing Nagios on CentOS
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: installing-nagios-centos
|
slug: installing-nagios-centos
|
||||||
tags:
|
tags:
|
||||||
- nagios
|
- nagios
|
||||||
- centos
|
- centos
|
||||||
- linux
|
- linux
|
||||||
---
|
---
|
||||||
A great post details that details the steps needed to install [Nagios](http://nagios.org) - a popular open source system and network monitoring software application - on CentOS.
|
A great post details that details the steps needed to install [Nagios](http://nagios.org) - a popular open source system and network monitoring software application - on CentOS.
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
title: Adding Custom Theme Templates in Drupal 7
|
title: Adding Custom Theme Templates in Drupal 7
|
||||||
nav: blog
|
nav: blog
|
||||||
description: >
|
description: >
|
||||||
Today, I had a situation where I was displaying a list of teasers for news article nodes. The article content type had several different fields assigned to it, including main and thumbnail images. In this case, I wanted to have different output and fields displayed when a teaser was displayed compared to when a complete node was displayed.
|
Today, I had a situation where I was displaying a list of teasers for news article nodes. The article content type had several different fields assigned to it, including main and thumbnail images. In this case, I wanted to have different output and fields displayed when a teaser was displayed compared to when a complete node was displayed.
|
||||||
slug: adding-custom-theme-templates-drupal-7
|
slug: adding-custom-theme-templates-drupal-7
|
||||||
tags:
|
tags:
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal
|
- drupal
|
||||||
---
|
---
|
||||||
Today, I had a situation where I was displaying a list of teasers for news article nodes. The article content type had several different fields assigned to it, including main and thumbnail images. In this case, I wanted to have different output and fields displayed when a teaser was displayed compared to when a complete node was displayed.
|
Today, I had a situation where I was displaying a list of teasers for news article nodes. The article content type had several different fields assigned to it, including main and thumbnail images. In this case, I wanted to have different output and fields displayed when a teaser was displayed compared to when a complete node was displayed.
|
||||||
|
|
||||||
|
@ -14,10 +14,10 @@ I have previously seen it done this way by adding this into in a node.tpl.php fi
|
||||||
|
|
||||||
~~~~
|
~~~~
|
||||||
if ($teaser) {
|
if ($teaser) {
|
||||||
// The teaser output.
|
// The teaser output.
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// The whole node output.
|
// The whole node output.
|
||||||
}
|
}
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
|
@ -27,10 +27,10 @@ The function requires the node variables as an argument - one of which is theme_
|
||||||
|
|
||||||
~~~~php
|
~~~~php
|
||||||
array (
|
array (
|
||||||
0 => 'node__article',
|
0 => 'node__article',
|
||||||
1 => 'node__343',
|
1 => 'node__343',
|
||||||
2 => 'node__view__latest_news',
|
2 => 'node__view__latest_news',
|
||||||
3 => 'node__view__latest_news__page',
|
3 => 'node__view__latest_news__page',
|
||||||
)
|
)
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
|
@ -41,12 +41,12 @@ So, within my theme's template.php file:
|
||||||
* Implementation of hook_preprocess_HOOK().
|
* Implementation of hook_preprocess_HOOK().
|
||||||
*/
|
*/
|
||||||
function mytheme_preprocess_node(&$variables) {
|
function mytheme_preprocess_node(&$variables) {
|
||||||
$node = $variables['node'];
|
$node = $variables['node'];
|
||||||
|
|
||||||
if ($variables['teaser']) {
|
if ($variables['teaser']) {
|
||||||
// Add a new item into the theme_hook_suggestions array.
|
// Add a new item into the theme_hook_suggestions array.
|
||||||
$variables['theme_hook_suggestions'][] = 'node__' . $node->type . '_teaser';
|
$variables['theme_hook_suggestions'][] = 'node__' . $node->type . '_teaser';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
|
@ -54,12 +54,12 @@ After adding the new suggestion:
|
||||||
|
|
||||||
~~~~php
|
~~~~php
|
||||||
array (
|
array (
|
||||||
0 => 'node__article',
|
0 => 'node__article',
|
||||||
1 => 'node__343',
|
1 => 'node__343',
|
||||||
2 => 'node__view__latest_news',
|
2 => 'node__view__latest_news',
|
||||||
3 => 'node__view__latest_news__page',
|
3 => 'node__view__latest_news__page',
|
||||||
4 => 'node__article_teaser',
|
4 => 'node__article_teaser',
|
||||||
)
|
)
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
Now, within my theme I can create a new node--article-teaser.tpl.php template file and this will get called instead of the node--article.tpl.php when a teaser is loaded. As I'm not specifying the node type specifically and using the dynamic <em>$node->type</em> value within my suggestion, this will also apply for all other content types on my site and not just news articles.
|
Now, within my theme I can create a new node--article-teaser.tpl.php template file and this will get called instead of the node--article.tpl.php when a teaser is loaded. As I'm not specifying the node type specifically and using the dynamic <em>$node->type</em> value within my suggestion, this will also apply for all other content types on my site and not just news articles.
|
||||||
|
|
|
@ -3,15 +3,15 @@ title: Prevent Apache from displaying text files within a web browser
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: prevent-apache-displaying-text-files-within-web-browser
|
slug: prevent-apache-displaying-text-files-within-web-browser
|
||||||
tags:
|
tags:
|
||||||
- apache
|
- apache
|
||||||
- code
|
- code
|
||||||
- drupal
|
- drupal
|
||||||
---
|
---
|
||||||
When you download [Drupal](http://drupal.org), there are several text files that are placed in the root of your installation. You don't want or need these to be visible to anyone attempting to view them in a browser - especially CHANGELOG.txt as that includes the exact version of Drupal you are running and could therefore have security implications. Rather than delete these files or change the file permissions manually for each file, I can add the following lines into my VirtualHost configuration:
|
When you download [Drupal](http://drupal.org), there are several text files that are placed in the root of your installation. You don't want or need these to be visible to anyone attempting to view them in a browser - especially CHANGELOG.txt as that includes the exact version of Drupal you are running and could therefore have security implications. Rather than delete these files or change the file permissions manually for each file, I can add the following lines into my VirtualHost configuration:
|
||||||
|
|
||||||
<Files ~ "\.txt$">
|
<Files ~ "\.txt$">
|
||||||
Order deny,allow
|
Order deny,allow
|
||||||
Deny from all
|
Deny from all
|
||||||
</Files>
|
</Files>
|
||||||
|
|
||||||
This prevents any files with a .txt extension from being accessed and rendered in a web browser.
|
This prevents any files with a .txt extension from being accessed and rendered in a web browser.
|
||||||
|
|
|
@ -3,13 +3,13 @@ title: Checkout a specific revision from SVN from the command line
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: checkout-specific-revision-svn-command-line
|
slug: checkout-specific-revision-svn-command-line
|
||||||
tags:
|
tags:
|
||||||
- svn
|
- svn
|
||||||
- version-control
|
- version-control
|
||||||
---
|
---
|
||||||
If you're checking out the repository for the first time:
|
If you're checking out the repository for the first time:
|
||||||
|
|
||||||
svn checkout -r 1234 url://repository/path
|
svn checkout -r 1234 url://repository/path
|
||||||
|
|
||||||
If you already have the repository checked out:
|
If you already have the repository checked out:
|
||||||
|
|
||||||
svn up -r 1234
|
svn up -r 1234
|
||||||
|
|
|
@ -3,34 +3,34 @@ title: How to add a date popup calendar onto a custom form
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: add-date-popup-calendar-custom-form
|
slug: add-date-popup-calendar-custom-form
|
||||||
tags:
|
tags:
|
||||||
- forms
|
- forms
|
||||||
- form-api
|
- form-api
|
||||||
- date
|
- date
|
||||||
- calendar
|
- calendar
|
||||||
- drupal-7
|
- drupal-7
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal
|
- drupal
|
||||||
---
|
---
|
||||||
First, I need to download the [Date](http://drupal.org/project/date "Date module on Drupal.org") module, and make my module dependent on date_popup by adding the following line into my module's .info file.
|
First, I need to download the [Date](http://drupal.org/project/date "Date module on Drupal.org") module, and make my module dependent on date_popup by adding the following line into my module's .info file.
|
||||||
|
|
||||||
dependencies[] = date_popup
|
dependencies[] = date_popup
|
||||||
|
|
||||||
Within my form builder function:
|
Within my form builder function:
|
||||||
|
|
||||||
~~~php
|
~~~php
|
||||||
$form['date'] = array(
|
$form['date'] = array(
|
||||||
'#title' => t('Arrival date'),
|
'#title' => t('Arrival date'),
|
||||||
|
|
||||||
// Provided by the date_popup module
|
// Provided by the date_popup module
|
||||||
'#type' => 'date_popup',
|
'#type' => 'date_popup',
|
||||||
|
|
||||||
// Uses the PHP date() format - http://php.net/manual/en/function.date.php
|
// Uses the PHP date() format - http://php.net/manual/en/function.date.php
|
||||||
'#date_format' => 'j F Y',
|
'#date_format' => 'j F Y',
|
||||||
|
|
||||||
// Limits the year range to the next two upcoming years
|
// Limits the year range to the next two upcoming years
|
||||||
'#date_year_range' => '0:+2',
|
'#date_year_range' => '0:+2',
|
||||||
|
|
||||||
// Default value must be in 'Y-m-d' format.
|
// Default value must be in 'Y-m-d' format.
|
||||||
'#default_value' => date('Y-m-d', time()),
|
'#default_value' => date('Y-m-d', time()),
|
||||||
);
|
);
|
||||||
~~~
|
~~~
|
||||||
|
|
|
@ -3,23 +3,23 @@ title: Forward one domain to another using mod_rewrite and .htaccess
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: forward-one-domain-another-using-modrewrite-and-htaccess
|
slug: forward-one-domain-another-using-modrewrite-and-htaccess
|
||||||
tags:
|
tags:
|
||||||
- .htaccess
|
- .htaccess
|
||||||
- code
|
- code
|
||||||
- drupal
|
- drupal
|
||||||
- apache
|
- apache
|
||||||
- mod_rewrite
|
- mod_rewrite
|
||||||
---
|
---
|
||||||
Within the mod_rewrite section of your .htaccess file, add the following lines:
|
Within the mod_rewrite section of your .htaccess file, add the following lines:
|
||||||
|
|
||||||
RewriteCond %{HTTP_HOST} ^yoursite\.co\.uk$
|
RewriteCond %{HTTP_HOST} ^yoursite\.co\.uk$
|
||||||
RewriteRule (.*) http://yoursite.com/$1 [R=301,L]
|
RewriteRule (.*) http://yoursite.com/$1 [R=301,L]
|
||||||
|
|
||||||
This automatically forwards any users from http://yoursite.co.uk to http://yoursite.com. This can also be used to forward multiple domains:
|
This automatically forwards any users from http://yoursite.co.uk to http://yoursite.com. This can also be used to forward multiple domains:
|
||||||
|
|
||||||
RewriteCond %{HTTP_HOST} ^yoursite\.co\.uk$ [OR]
|
RewriteCond %{HTTP_HOST} ^yoursite\.co\.uk$ [OR]
|
||||||
RewriteCond %{HTTP_HOST} ^yoursite\.info$ [OR]
|
RewriteCond %{HTTP_HOST} ^yoursite\.info$ [OR]
|
||||||
RewriteCond %{HTTP_HOST} ^yoursite\.biz$ [OR]
|
RewriteCond %{HTTP_HOST} ^yoursite\.biz$ [OR]
|
||||||
RewriteCond %{HTTP_HOST} ^yoursite\.eu$
|
RewriteCond %{HTTP_HOST} ^yoursite\.eu$
|
||||||
RewriteRule (.*) http://yoursite.com/$1 [R=301,L]
|
RewriteRule (.*) http://yoursite.com/$1 [R=301,L]
|
||||||
|
|
||||||
If any of the RewriteCond conditions apply, then the RewriteRule is executed.
|
If any of the RewriteCond conditions apply, then the RewriteRule is executed.
|
||||||
|
|
|
@ -3,10 +3,10 @@ title: Writing a .info file for a Drupal 7 theme
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: writing-info-file-drupal-7-theme
|
slug: writing-info-file-drupal-7-theme
|
||||||
tags:
|
tags:
|
||||||
- theming
|
- theming
|
||||||
- drupal-theming
|
- drupal-theming
|
||||||
- drupal
|
- drupal
|
||||||
- code
|
- code
|
||||||
---
|
---
|
||||||
~~~
|
~~~
|
||||||
name = My Theme
|
name = My Theme
|
||||||
|
@ -36,4 +36,4 @@ stylesheets[print][] = css/print.css
|
||||||
|
|
||||||
# Add javascript files
|
# Add javascript files
|
||||||
styles[] = js/mytheme.js
|
styles[] = js/mytheme.js
|
||||||
~~~
|
~~~
|
||||||
|
|
|
@ -4,10 +4,10 @@ nav: blog
|
||||||
description: If you use a lot of process and preprocess functions within your Drupal theme, then your template.php can get very long and it can become difficult to find a certain piece of code. Following the example of the Omega theme, I've started separating my process and preprocess functions into their own files.
|
description: If you use a lot of process and preprocess functions within your Drupal theme, then your template.php can get very long and it can become difficult to find a certain piece of code. Following the example of the Omega theme, I've started separating my process and preprocess functions into their own files.
|
||||||
slug: dividing-drupals-process-and-preprocess-functions-separate-files
|
slug: dividing-drupals-process-and-preprocess-functions-separate-files
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- code
|
- code
|
||||||
- theming
|
- theming
|
||||||
- preprocessing
|
- preprocessing
|
||||||
---
|
---
|
||||||
If you use a lot of process and preprocess functions within your Drupal theme, then your template.php can get very long and it can become difficult to find a certain piece of code. Following the example of the [Omega theme](http://drupal.org/project/omega "The Omega theme on Drupal.org"), I've started separating my process and preprocess functions into their own files. For example, mytheme_preprocess_node can be placed within a preprocess/node.inc file, and mytheme_process_page can be placed within process/page.inc.
|
If you use a lot of process and preprocess functions within your Drupal theme, then your template.php can get very long and it can become difficult to find a certain piece of code. Following the example of the [Omega theme](http://drupal.org/project/omega "The Omega theme on Drupal.org"), I've started separating my process and preprocess functions into their own files. For example, mytheme_preprocess_node can be placed within a preprocess/node.inc file, and mytheme_process_page can be placed within process/page.inc.
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ The first step is to use the default mytheme_process() and mytheme_preprocess()
|
||||||
* Initialises the mytheme_invoke() function for the preprocess hook.
|
* Initialises the mytheme_invoke() function for the preprocess hook.
|
||||||
*/
|
*/
|
||||||
function mytheme_preprocess(&$variables, $hook) {
|
function mytheme_preprocess(&$variables, $hook) {
|
||||||
mytheme_invoke('preprocess', $hook, $variables);
|
mytheme_invoke('preprocess', $hook, $variables);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,7 +31,7 @@ function mytheme_preprocess(&$variables, $hook) {
|
||||||
* Initialises the mytheme_invoke() function for the process hook.
|
* Initialises the mytheme_invoke() function for the process hook.
|
||||||
*/
|
*/
|
||||||
function mytheme_process(&$variables, $hook) {
|
function mytheme_process(&$variables, $hook) {
|
||||||
mytheme_invoke('process', $hook, $variables);
|
mytheme_invoke('process', $hook, $variables);
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
@ -44,40 +44,40 @@ Now, to write the `mytheme_invoke()` function:
|
||||||
* Invokes custom process and preprocess functions.
|
* Invokes custom process and preprocess functions.
|
||||||
*
|
*
|
||||||
* @param string $type
|
* @param string $type
|
||||||
* The type of function we are trying to include (i.e. process or preprocess).
|
* The type of function we are trying to include (i.e. process or preprocess).
|
||||||
*
|
*
|
||||||
* @param array $variables
|
* @param array $variables
|
||||||
* The variables array.
|
* The variables array.
|
||||||
*
|
*
|
||||||
* @param string $hook
|
* @param string $hook
|
||||||
* The name of the hook.
|
* The name of the hook.
|
||||||
*
|
*
|
||||||
* @see mytheme_preprocess()
|
* @see mytheme_preprocess()
|
||||||
* @see mytheme_process()
|
* @see mytheme_process()
|
||||||
*/
|
*/
|
||||||
function mytheme_invoke($type, $hook, &$variables) {
|
function mytheme_invoke($type, $hook, &$variables) {
|
||||||
global $theme_key;
|
global $theme_key;
|
||||||
|
|
||||||
// The name of the function to look for (e.g. mytheme_process_node).
|
// The name of the function to look for (e.g. mytheme_process_node).
|
||||||
$function = $theme_key . '_' . $type . '_' . $hook;
|
$function = $theme_key . '_' . $type . '_' . $hook;
|
||||||
|
|
||||||
// If the function doesn't exist within template.php, look for the
|
// If the function doesn't exist within template.php, look for the
|
||||||
// appropriate include file.
|
// appropriate include file.
|
||||||
if (!function_exists($function)) {
|
if (!function_exists($function)) {
|
||||||
// The file to search for (e.g. process/node.inc).
|
// The file to search for (e.g. process/node.inc).
|
||||||
$file = drupal_get_path('theme', $theme_key) . '/' . $type . '/' . $type . '-' . str_replace('_', '-', $hook) . '.inc';
|
$file = drupal_get_path('theme', $theme_key) . '/' . $type . '/' . $type . '-' . str_replace('_', '-', $hook) . '.inc';
|
||||||
|
|
||||||
// If the file exists, include it.
|
// If the file exists, include it.
|
||||||
if (is_file($file)) {
|
if (is_file($file)) {
|
||||||
include($file);
|
include($file);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Try to call the function again.
|
// Try to call the function again.
|
||||||
if (function_exists($function)) {
|
if (function_exists($function)) {
|
||||||
$function($variables);
|
$function($variables);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
As `mytheme_invoke()` checks to see if the function already exists before searching for checking the include files, I could still add the functions into template.php as normal and this would override any corresponding include file.
|
As `mytheme_invoke()` checks to see if the function already exists before searching for checking the include files, I could still add the functions into template.php as normal and this would override any corresponding include file.
|
||||||
|
|
|
@ -3,16 +3,16 @@ title: My new Drupal modules
|
||||||
nav: blog
|
nav: blog
|
||||||
description: After a busy few days, I've released two new contrib Drupal modules.
|
description: After a busy few days, I've released two new contrib Drupal modules.
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-modules
|
- drupal-modules
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- drupal-7
|
- drupal-7
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- accessibility
|
- accessibility
|
||||||
---
|
---
|
||||||
After a busy few days, I've released two new contrib Drupal modules:
|
After a busy few days, I've released two new contrib Drupal modules:
|
||||||
|
|
||||||
* [Block Aria Landmark Roles](http://drupal.org/project/block_aria_landmark_roles) - Inspired by [Block Class](http://drupal.org/project/block_class), this module adds additional elements to the block configuration forms that allow users to assign a ARIA landmark role to a block.
|
* [Block Aria Landmark Roles](http://drupal.org/project/block_aria_landmark_roles) - Inspired by [Block Class](http://drupal.org/project/block_class), this module adds additional elements to the block configuration forms that allow users to assign a ARIA landmark role to a block.
|
||||||
* [Nomensa Accessible Media Player](http://drupal.org/project/nomensa_amp) - Provides integration with Nomensa's [Accessible Media Player](https://github.com/nomensa/Accessible-Media-Player).
|
* [Nomensa Accessible Media Player](http://drupal.org/project/nomensa_amp) - Provides integration with Nomensa's [Accessible Media Player](https://github.com/nomensa/Accessible-Media-Player).
|
||||||
|
|
||||||
Documentation for both to follow shortly on Drupal.org.
|
Documentation for both to follow shortly on Drupal.org.
|
||||||
|
|
|
@ -3,10 +3,10 @@ title: Install and Configure the Nomensa Accessible Media Player in Drupal
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: install-nomensa-media-player-drupal
|
slug: install-nomensa-media-player-drupal
|
||||||
tags:
|
tags:
|
||||||
- accessibility
|
- accessibility
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- nomensa
|
- nomensa
|
||||||
---
|
---
|
||||||
*The official documentation for this module is now located at <https://www.drupal.org/node/2383447>. This post was accurate at the time of writing, whereas the documentation page will be kept up to date with any future changes.*
|
*The official documentation for this module is now located at <https://www.drupal.org/node/2383447>. This post was accurate at the time of writing, whereas the documentation page will be kept up to date with any future changes.*
|
||||||
|
|
||||||
|
@ -36,11 +36,11 @@ Within your content add links to your videos. For example:
|
||||||
|
|
||||||
### YouTube
|
### YouTube
|
||||||
|
|
||||||
<a href="http://www.youtube.com/watch?v=Zi31YMGmQC4">Checking colour contrast</a>
|
<a href="http://www.youtube.com/watch?v=Zi31YMGmQC4">Checking colour contrast</a>
|
||||||
|
|
||||||
### Vimeo
|
### Vimeo
|
||||||
|
|
||||||
<a href="http://vimeo.com/33729937">Screen readers are strange, when you're a stranger by Leonie Watson</a>
|
<a href="http://vimeo.com/33729937">Screen readers are strange, when you're a stranger by Leonie Watson</a>
|
||||||
|
|
||||||
## Adding captions
|
## Adding captions
|
||||||
|
|
||||||
|
@ -51,9 +51,9 @@ The best way that I can suggest to do this is to use a File field to upload your
|
||||||
3. Right-click the uploaded file, copy the link location, and use this for the path to your captions file.
|
3. Right-click the uploaded file, copy the link location, and use this for the path to your captions file.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
<a href="http://www.youtube.com/watch?v=Zi31YMGmQC4">Checking colour contrast</a> <a class="captions" href="http://oliverdavies.co.uk/sites/default/files/checking-colour-contrast-captions.xml">Captions for Checking Colour Contrast</a>
|
<a href="http://www.youtube.com/watch?v=Zi31YMGmQC4">Checking colour contrast</a> <a class="captions" href="http://oliverdavies.co.uk/sites/default/files/checking-colour-contrast-captions.xml">Captions for Checking Colour Contrast</a>
|
||||||
|
|
||||||
## Screencast
|
## Screencast
|
||||||
|
|
||||||
<a class="player" href="http://vimeo.com/45731954">Nomensa Accessible Media Player for Drupal</a>
|
<a class="player" href="http://vimeo.com/45731954">Nomensa Accessible Media Player for Drupal</a>
|
||||||
|
|
|
@ -4,12 +4,12 @@ nav: blog
|
||||||
description: I'm absolutely delighted to announce that I'm going to be writing an article for Linux Journal magazine's upcoming Drupal special.
|
description: I'm absolutely delighted to announce that I'm going to be writing an article for Linux Journal magazine's upcoming Drupal special.
|
||||||
slug: writing-article-linux-journal
|
slug: writing-article-linux-journal
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- distributions
|
- distributions
|
||||||
- installation-profiles
|
- installation-profiles
|
||||||
- writing
|
- writing
|
||||||
- linux-journal
|
- linux-journal
|
||||||
---
|
---
|
||||||
I'm absolutely delighted to announce that I'm going to be writing an article for [Linux Journal](http://www.linuxjournal.com) magazine's upcoming Drupal special. The article is going to be entitled "Speeding Up Your Drupal Development Using Installation Profiles and Distributions" and will be mentioning existing distributions available on Drupal.org, but mainly focussing on the steps needed to create your own custom distribution. Needless to say, I'm quite excited about it!
|
I'm absolutely delighted to announce that I'm going to be writing an article for [Linux Journal](http://www.linuxjournal.com) magazine's upcoming Drupal special. The article is going to be entitled "Speeding Up Your Drupal Development Using Installation Profiles and Distributions" and will be mentioning existing distributions available on Drupal.org, but mainly focussing on the steps needed to create your own custom distribution. Needless to say, I'm quite excited about it!
|
||||||
|
|
||||||
The article is expected to be published in October.
|
The article is expected to be published in October.
|
||||||
|
|
|
@ -4,11 +4,11 @@ nav: blog
|
||||||
description: For reference, this is the code needed to display a menu in a Drupal 7 template file.
|
description: For reference, this is the code needed to display a menu in a Drupal 7 template file.
|
||||||
slug: display-custom-menu-drupal-7-theme-template-file
|
slug: display-custom-menu-drupal-7-theme-template-file
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-7
|
- drupal-7
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- php
|
- php
|
||||||
- aria
|
- aria
|
||||||
---
|
---
|
||||||
For reference, this is the code needed to display a menu in a Drupal 7 template file, including the navigation ARIA role.
|
For reference, this is the code needed to display a menu in a Drupal 7 template file, including the navigation ARIA role.
|
||||||
|
|
||||||
|
@ -16,11 +16,11 @@ For reference, this is the code needed to display a menu in a Drupal 7 template
|
||||||
$menu_name = 'menu-footer-menu';
|
$menu_name = 'menu-footer-menu';
|
||||||
$menu_id = 'footer-menu';
|
$menu_id = 'footer-menu';
|
||||||
print theme('links', array(
|
print theme('links', array(
|
||||||
'links' => menu_navigation_links($menu_name),
|
'links' => menu_navigation_links($menu_name),
|
||||||
'attributes' => array(
|
'attributes' => array(
|
||||||
'id' => $menu_id,
|
'id' => $menu_id,
|
||||||
'role' => 'navigation',
|
'role' => 'navigation',
|
||||||
'class'=> array('links', 'inline')
|
'class'=> array('links', 'inline')
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
~~~
|
~~~
|
||||||
|
|
|
@ -4,7 +4,7 @@ nav: blog
|
||||||
description: Yesterday evening I went to and spoke at the <a href="http://www.unifieddiff.co.uk" title="UnifiedDiff">UnifiedDiff meetup</a> in Cardiff, having offered previously to do a presentation providing an introduction to Drupal.
|
description: Yesterday evening I went to and spoke at the <a href="http://www.unifieddiff.co.uk" title="UnifiedDiff">UnifiedDiff meetup</a> in Cardiff, having offered previously to do a presentation providing an introduction to Drupal.
|
||||||
slug: reflections-speaking-unifieddiff
|
slug: reflections-speaking-unifieddiff
|
||||||
tags:
|
tags:
|
||||||
- talks
|
- talks
|
||||||
---
|
---
|
||||||
Yesterday evening I went along and spoke at the [UnifiedDiff meetup](http://www.unifieddiff.co.uk) in Cardiff, having offered previously to do a presentation providing an introduction to Drupal.
|
Yesterday evening I went along and spoke at the [UnifiedDiff meetup](http://www.unifieddiff.co.uk) in Cardiff, having offered previously to do a presentation providing an introduction to Drupal.
|
||||||
|
|
||||||
|
@ -12,4 +12,4 @@ I'm an experienced Drupal Developer, but not an experienced public speaker (alth
|
||||||
|
|
||||||
Initially, after aiming for a 20-minute presentation plus Q&A, I think I wrapped up the presentation in around 14 minutes, although I did about 6 minutes of answering questions afterwards including the apparently mandatory "Why use Drupal compared to WordPress or Joomla?" question, some Drupal 8 and Symfony questions, as well as an interesting question about the White House development project after I'd listed it within a list of example sites. Next time, I think that some more detailed presenter notes are needed. Typically, as soon as it sat back in my seat, the majority of things that I'd managed to remember beforehand all came flooding back to me and I thought "I should have said that whilst I was up speaking".
|
Initially, after aiming for a 20-minute presentation plus Q&A, I think I wrapped up the presentation in around 14 minutes, although I did about 6 minutes of answering questions afterwards including the apparently mandatory "Why use Drupal compared to WordPress or Joomla?" question, some Drupal 8 and Symfony questions, as well as an interesting question about the White House development project after I'd listed it within a list of example sites. Next time, I think that some more detailed presenter notes are needed. Typically, as soon as it sat back in my seat, the majority of things that I'd managed to remember beforehand all came flooding back to me and I thought "I should have said that whilst I was up speaking".
|
||||||
|
|
||||||
Overall, considering my inexperience at speaking to this type of audience, I was fairly happy with my presentation, although I'm sure that I'll change my mind once I've watched the video of it on the UnifiedDiff website. Regardless, I think that it was a great experience and I enjoyed doing it, and I'd like to thank the organisers of UnifiedDiff for having me speak at their meetup. It was great to have a more relaxed conversation with some people after the other speakers had been up, and having introduced Drupal I would be more than happy to come back and do a more in-depth presentation if there is an interest for me to do so.
|
Overall, considering my inexperience at speaking to this type of audience, I was fairly happy with my presentation, although I'm sure that I'll change my mind once I've watched the video of it on the UnifiedDiff website. Regardless, I think that it was a great experience and I enjoyed doing it, and I'd like to thank the organisers of UnifiedDiff for having me speak at their meetup. It was great to have a more relaxed conversation with some people after the other speakers had been up, and having introduced Drupal I would be more than happy to come back and do a more in-depth presentation if there is an interest for me to do so.
|
||||||
|
|
|
@ -3,7 +3,7 @@ title: My Sublime Text 2 settings
|
||||||
nav: blog
|
nav: blog
|
||||||
description: <a href="http://www.sublimetext.com/2" title="Sublime Text 2">Sublime Text 2</a> has been my text editor of choice for the past few months, and I use it at home, in work, and on any virtual machines that I run. So rather than having to manually re-enter my settings each time, I thought that I'd document them here for future reference.
|
description: <a href="http://www.sublimetext.com/2" title="Sublime Text 2">Sublime Text 2</a> has been my text editor of choice for the past few months, and I use it at home, in work, and on any virtual machines that I run. So rather than having to manually re-enter my settings each time, I thought that I'd document them here for future reference.
|
||||||
tags:
|
tags:
|
||||||
- sublime-text
|
- sublime-text
|
||||||
---
|
---
|
||||||
[Sublime Text 2](http://www.sublimetext.com/2) has been my text editor of choice for the past few months, and I use it at home, in work, and on any virtual machines that I run. So rather than having to manually re-enter my settings each time, I thought that I'd document them here for future reference. These preferences ensure that the code is compliant with [Drupal coding standards](http://drupal.org/coding-standards "Drupal coding standards on Drupal.org") - using two spaces instead of a tab, no trailing whitespace, blank line at the end of a file etc.
|
[Sublime Text 2](http://www.sublimetext.com/2) has been my text editor of choice for the past few months, and I use it at home, in work, and on any virtual machines that I run. So rather than having to manually re-enter my settings each time, I thought that I'd document them here for future reference. These preferences ensure that the code is compliant with [Drupal coding standards](http://drupal.org/coding-standards "Drupal coding standards on Drupal.org") - using two spaces instead of a tab, no trailing whitespace, blank line at the end of a file etc.
|
||||||
|
|
||||||
|
@ -13,64 +13,64 @@ These can be changed by going to Preferences > Settings - User.
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
{
|
{
|
||||||
"color_scheme": "Packages/Theme - Aqua/Color Schemes/Tomorrow Night Aqua.tmTheme",
|
"color_scheme": "Packages/Theme - Aqua/Color Schemes/Tomorrow Night Aqua.tmTheme",
|
||||||
"default_line_ending": "unix",
|
"default_line_ending": "unix",
|
||||||
"ensure_newline_at_eof_on_save": true,
|
"ensure_newline_at_eof_on_save": true,
|
||||||
"fallback_encoding": "UTF-8",
|
"fallback_encoding": "UTF-8",
|
||||||
"file_exclude_patterns":
|
"file_exclude_patterns":
|
||||||
[
|
[
|
||||||
"*.pyc",
|
"*.pyc",
|
||||||
"*.pyo",
|
"*.pyo",
|
||||||
"*.exe",
|
"*.exe",
|
||||||
"*.dll",
|
"*.dll",
|
||||||
"*.obj",
|
"*.obj",
|
||||||
"*.o",
|
"*.o",
|
||||||
"*.a",
|
"*.a",
|
||||||
"*.lib",
|
"*.lib",
|
||||||
"*.so",
|
"*.so",
|
||||||
"*.dylib",
|
"*.dylib",
|
||||||
"*.ncb",
|
"*.ncb",
|
||||||
"*.sdf",
|
"*.sdf",
|
||||||
"*.suo",
|
"*.suo",
|
||||||
"*.pdb",
|
"*.pdb",
|
||||||
"*.idb",
|
"*.idb",
|
||||||
".DS_Store",
|
".DS_Store",
|
||||||
"*.class",
|
"*.class",
|
||||||
"*.psd",
|
"*.psd",
|
||||||
"*.db",
|
"*.db",
|
||||||
"*.sublime*"
|
"*.sublime*"
|
||||||
],
|
],
|
||||||
"folder_exclude_patterns":
|
"folder_exclude_patterns":
|
||||||
[
|
[
|
||||||
".svn",
|
".svn",
|
||||||
".git",
|
".git",
|
||||||
".hg",
|
".hg",
|
||||||
"CVS",
|
"CVS",
|
||||||
"FirePHPCore"
|
"FirePHPCore"
|
||||||
],
|
],
|
||||||
"font_options":
|
"font_options":
|
||||||
[
|
[
|
||||||
"no_bold",
|
"no_bold",
|
||||||
"no_italic"
|
"no_italic"
|
||||||
],
|
],
|
||||||
"font_size": 16.0,
|
"font_size": 16.0,
|
||||||
"highlight_line": true,
|
"highlight_line": true,
|
||||||
"ignored_packages":
|
"ignored_packages":
|
||||||
[
|
[
|
||||||
],
|
],
|
||||||
"line_padding_bottom": 1,
|
"line_padding_bottom": 1,
|
||||||
"rulers":
|
"rulers":
|
||||||
[
|
[
|
||||||
80
|
80
|
||||||
],
|
],
|
||||||
"save_on_focus_lost": true,
|
"save_on_focus_lost": true,
|
||||||
"shift_tab_unindent": true,
|
"shift_tab_unindent": true,
|
||||||
"tab_size": 2,
|
"tab_size": 2,
|
||||||
"theme": "Soda Light.sublime-theme",
|
"theme": "Soda Light.sublime-theme",
|
||||||
"translate_tabs_to_spaces": true,
|
"translate_tabs_to_spaces": true,
|
||||||
"trim_automatic_white_space": true,
|
"trim_automatic_white_space": true,
|
||||||
"trim_trailing_white_space_on_save": true,
|
"trim_trailing_white_space_on_save": true,
|
||||||
"word_wrap": false
|
"word_wrap": false
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
@ -80,8 +80,8 @@ These can be changed by going to Preferences > Key Bindings - User.
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
[
|
[
|
||||||
{ "keys": ["alt+s"], "command": "toggle_side_bar" },
|
{ "keys": ["alt+s"], "command": "toggle_side_bar" },
|
||||||
{ "keys": ["alt+r"], "command": "reindent" }
|
{ "keys": ["alt+r"], "command": "reindent" }
|
||||||
]
|
]
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
@ -94,4 +94,4 @@ These are the packages that I currently have installed.
|
||||||
* [LESS](https://github.com/danro/LESS-sublime)
|
* [LESS](https://github.com/danro/LESS-sublime)
|
||||||
* [Package Control](http://wbond.net/sublime_packages/package_control)
|
* [Package Control](http://wbond.net/sublime_packages/package_control)
|
||||||
* [Sublime CodeIntel](http://github.com/Kronuz/SublimeCodeIntel)
|
* [Sublime CodeIntel](http://github.com/Kronuz/SublimeCodeIntel)
|
||||||
* [Theme - Soda](https://github.com/buymeasoda/soda-theme)
|
* [Theme - Soda](https://github.com/buymeasoda/soda-theme)
|
||||||
|
|
|
@ -3,10 +3,10 @@ title: Accessible Bristol site launched
|
||||||
nav: blog
|
nav: blog
|
||||||
description: I'm happy to report that the Accessible Bristol was launched this week, on Drupal 7.
|
description: I'm happy to report that the Accessible Bristol was launched this week, on Drupal 7.
|
||||||
tags:
|
tags:
|
||||||
- accessibility
|
- accessibility
|
||||||
- accessible-bristol
|
- accessible-bristol
|
||||||
- nomensa
|
- nomensa
|
||||||
---
|
---
|
||||||
I'm happy to report that the [Accessible Bristol](http://www.accessiblebristol.org.uk) website was launched this week, on Drupal 7. The site's been developed over the past few months, and uses the [User Relationships](http://drupal.org/project/user_relationships) and [Privatemsg](http://drupal.org/project/privatemsg) modules to provide a community-based platform where people with an interest in accessibility can register and network with each other.
|
I'm happy to report that the [Accessible Bristol](http://www.accessiblebristol.org.uk) website was launched this week, on Drupal 7. The site's been developed over the past few months, and uses the [User Relationships](http://drupal.org/project/user_relationships) and [Privatemsg](http://drupal.org/project/privatemsg) modules to provide a community-based platform where people with an interest in accessibility can register and network with each other.
|
||||||
|
|
||||||
The group is hosting a launch event on the 28th November at the Council House, College Green, Bristol. Interested? More information is available at <http://www.accessiblebristol.org.uk/events/accessible-bristol-launch> or go to <http://buytickets.at/accessiblebristol/6434> to register.
|
The group is hosting a launch event on the 28th November at the Council House, College Green, Bristol. Interested? More information is available at <http://www.accessiblebristol.org.uk/events/accessible-bristol-launch> or go to <http://buytickets.at/accessiblebristol/6434> to register.
|
||||||
|
|
|
@ -3,14 +3,14 @@ title: Open Sublime Text 2 from the Mac OS X Command Line
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: open-sublime-text-2-mac-os-x-command-line
|
slug: open-sublime-text-2-mac-os-x-command-line
|
||||||
tags:
|
tags:
|
||||||
- sublime-text
|
- sublime-text
|
||||||
- mac-os-x
|
- mac-os-x
|
||||||
- terminal
|
- terminal
|
||||||
---
|
---
|
||||||
Paste the following code into the Mac OS X Terminal, assuming that you've installed Sublime Text 2 into the /Applications folder.
|
Paste the following code into the Mac OS X Terminal, assuming that you've installed Sublime Text 2 into the /Applications folder.
|
||||||
|
|
||||||
$ ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/sublime
|
$ ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/sublime
|
||||||
|
|
||||||
Now you can type `sublime <filename>` open a file or directory in Sublime Text, or `sublime .` to open the current directory.
|
Now you can type `sublime <filename>` open a file or directory in Sublime Text, or `sublime .` to open the current directory.
|
||||||
|
|
||||||
You can also type `sublime --help` to see a list of the available commands.
|
You can also type `sublime --help` to see a list of the available commands.
|
||||||
|
|
|
@ -3,14 +3,14 @@ title: How to use SASS and Compass in Drupal 7 using Sassy
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: use-sass-and-compass-drupal-7-using-sassy
|
slug: use-sass-and-compass-drupal-7-using-sassy
|
||||||
tags:
|
tags:
|
||||||
- compass
|
- compass
|
||||||
- css
|
- css
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-7
|
- drupal-7
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- less
|
- less
|
||||||
- preprocessing
|
- preprocessing
|
||||||
- sass
|
- sass
|
||||||
---
|
---
|
||||||
I've recently started using [SASS](http://sass-lang.com) rather than LESS to do my CSS preprocessing - namely due to its integration with [Compass](http://compass-style.org) and it's built-in CSS3 mixins. There are three modules that provide the ability to use SASS within Drupal:
|
I've recently started using [SASS](http://sass-lang.com) rather than LESS to do my CSS preprocessing - namely due to its integration with [Compass](http://compass-style.org) and it's built-in CSS3 mixins. There are three modules that provide the ability to use SASS within Drupal:
|
||||||
|
|
||||||
|
@ -24,17 +24,17 @@ Alternatively, you could use a base theme like [Sasson](http://drupal.org/projec
|
||||||
|
|
||||||
The first thing to do is download the PHPSass library from [GitHub](https://github.com/richthegeek/phpsass "PHPSass on GitHub"), as this is a requirement of the Sassy module and we can't enable it without the library. So, in a Terminal window:
|
The first thing to do is download the PHPSass library from [GitHub](https://github.com/richthegeek/phpsass "PHPSass on GitHub"), as this is a requirement of the Sassy module and we can't enable it without the library. So, in a Terminal window:
|
||||||
|
|
||||||
$ mkdir -p sites/all/libraries;
|
$ mkdir -p sites/all/libraries;
|
||||||
$ cd sites/all/libraries;
|
$ cd sites/all/libraries;
|
||||||
$ wget https://github.com/richthegeek/phpsass/archive/master.tar.gz;
|
$ wget https://github.com/richthegeek/phpsass/archive/master.tar.gz;
|
||||||
$ tar zxf master.tar.gz;
|
$ tar zxf master.tar.gz;
|
||||||
$ rm master.tar.gz;
|
$ rm master.tar.gz;
|
||||||
$ mv phpsass-master/ phpsass
|
$ mv phpsass-master/ phpsass
|
||||||
|
|
||||||
Or, if you're using Drush Make files:
|
Or, if you're using Drush Make files:
|
||||||
|
|
||||||
libraries[phpsass][download][type] = "get"
|
libraries[phpsass][download][type] = "get"
|
||||||
libraries[phpsass][download][url] = "https://github.com/richthegeek/phpsass/archive/master.tar.gz"
|
libraries[phpsass][download][url] = "https://github.com/richthegeek/phpsass/archive/master.tar.gz"
|
||||||
|
|
||||||
The PHPSass library should now be located at `sites/all/libraries/phpsass`.
|
The PHPSass library should now be located at `sites/all/libraries/phpsass`.
|
||||||
|
|
||||||
|
@ -42,8 +42,8 @@ The PHPSass library should now be located at `sites/all/libraries/phpsass`.
|
||||||
|
|
||||||
This is easy if you use [Drush](http://drupal.org/project/drush):
|
This is easy if you use [Drush](http://drupal.org/project/drush):
|
||||||
|
|
||||||
$ drush dl libraries prepro sassy
|
$ drush dl libraries prepro sassy
|
||||||
$ drush en -y libraries prepro sassy sassy_compass
|
$ drush en -y libraries prepro sassy sassy_compass
|
||||||
|
|
||||||
Otherwise, download the each module from it's respective project page and place it within your `sites/all/modules` or `sites/all/modules/contrib` directory.
|
Otherwise, download the each module from it's respective project page and place it within your `sites/all/modules` or `sites/all/modules/contrib` directory.
|
||||||
|
|
||||||
|
@ -55,4 +55,4 @@ Personally, in development, I'd set caching to 'uncached' and the error reportin
|
||||||
|
|
||||||
## Adding SASS files into your theme
|
## Adding SASS files into your theme
|
||||||
|
|
||||||
With this done, you can now add SASS and SCSS files by adding a line like `stylesheets[all][] = css/base.scss` in your theme's .info file.
|
With this done, you can now add SASS and SCSS files by adding a line like `stylesheets[all][] = css/base.scss` in your theme's .info file.
|
||||||
|
|
|
@ -4,18 +4,18 @@ nav: blog
|
||||||
description: How to check if a user is logged into Drupal by using the user_is_logged_in() and user_is_anonymous() functions.
|
description: How to check if a user is logged into Drupal by using the user_is_logged_in() and user_is_anonymous() functions.
|
||||||
slug: checking-if-user-logged-drupal-right-way
|
slug: checking-if-user-logged-drupal-right-way
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- drupal-7
|
- drupal-7
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- php
|
- php
|
||||||
---
|
---
|
||||||
I see this regularly when working on Drupal sites when someone wants to check whether the current user is logged in to Drupal (authenticated) or not (anonymous):
|
I see this regularly when working on Drupal sites when someone wants to check whether the current user is logged in to Drupal (authenticated) or not (anonymous):
|
||||||
|
|
||||||
~~~~
|
~~~~
|
||||||
global $user;
|
global $user;
|
||||||
if ($user->uid) {
|
if ($user->uid) {
|
||||||
// The user is logged in.
|
// The user is logged in.
|
||||||
}
|
}
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ or
|
||||||
~~~~
|
~~~~
|
||||||
global $user;
|
global $user;
|
||||||
if (!$user->uid) {
|
if (!$user->uid) {
|
||||||
// The user is not logged in.
|
// The user is not logged in.
|
||||||
}
|
}
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ The better way to do this is to use the [user_is_logged_in()](http://api.drupal.
|
||||||
|
|
||||||
~~~~
|
~~~~
|
||||||
if (user_is_logged_in()) {
|
if (user_is_logged_in()) {
|
||||||
// Do something.
|
// Do something.
|
||||||
}
|
}
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
|
@ -45,14 +45,14 @@ A great use case for this is within a `hook_menu()` implementation within a cust
|
||||||
* Implements hook_menu().
|
* Implements hook_menu().
|
||||||
*/
|
*/
|
||||||
function mymodule_menu() {
|
function mymodule_menu() {
|
||||||
$items['foo'] = array(
|
$items['foo'] = array(
|
||||||
'title' => 'Foo',
|
'title' => 'Foo',
|
||||||
'page callback' => 'mymodule_foo',
|
'page callback' => 'mymodule_foo',
|
||||||
'access callback' => 'user_is_logged_in',
|
'access callback' => 'user_is_logged_in',
|
||||||
);
|
);
|
||||||
|
|
||||||
return $items;
|
return $items;
|
||||||
}
|
}
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
There is also a [user_is_anonymous()](http://api.drupal.org/api/drupal/modules!user!user.module/function/user_is_anonymous/7) function if you want the opposite result. Both of these functions are available in Drupal 6 and higher.
|
There is also a [user_is_anonymous()](http://api.drupal.org/api/drupal/modules!user!user.module/function/user_is_anonymous/7) function if you want the opposite result. Both of these functions are available in Drupal 6 and higher.
|
||||||
|
|
|
@ -3,10 +3,10 @@ title: Creating and using custom tokens in Drupal 7
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: creating-and-using-custom-tokens-drupal-7
|
slug: creating-and-using-custom-tokens-drupal-7
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal-7
|
- drupal-7
|
||||||
- tokens
|
- tokens
|
||||||
---
|
---
|
||||||
This post outlines the steps required to create your own custom tokens in Drupal.
|
This post outlines the steps required to create your own custom tokens in Drupal.
|
||||||
|
|
||||||
|
@ -32,13 +32,13 @@ The first thing that we need to do is define the new token type and/or the token
|
||||||
* Implements hook_token_info().
|
* Implements hook_token_info().
|
||||||
*/
|
*/
|
||||||
function foo_token_info() {
|
function foo_token_info() {
|
||||||
$info = array();
|
$info = array();
|
||||||
|
|
||||||
// Add any new tokens.
|
// Add any new tokens.
|
||||||
$info['tokens']['foo']['bar'] = t('This is my new bar token within the foo type.');
|
$info['tokens']['foo']['bar'] = t('This is my new bar token within the foo type.');
|
||||||
|
|
||||||
// Return them.
|
// Return them.
|
||||||
return $info;
|
return $info;
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
@ -55,12 +55,12 @@ Now that the Token module is aware of our new token, we now need to determine wh
|
||||||
* Implements hook_tokens().
|
* Implements hook_tokens().
|
||||||
*/
|
*/
|
||||||
function foo_tokens($type, $tokens, array $data = array(), array $options = array()) {
|
function foo_tokens($type, $tokens, array $data = array(), array $options = array()) {
|
||||||
$replacements = array();
|
$replacements = array();
|
||||||
|
|
||||||
// Code goes here...
|
// Code goes here...
|
||||||
|
|
||||||
// Return the replacements.
|
// Return the replacements.
|
||||||
return $replacements;
|
return $replacements;
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
@ -71,29 +71,29 @@ The first thing to check for is the type of token using an `if()` function, as t
|
||||||
* Implements hook_tokens().
|
* Implements hook_tokens().
|
||||||
*/
|
*/
|
||||||
function foo_tokens($type, $tokens, array $data = array(), array $options = array()) {
|
function foo_tokens($type, $tokens, array $data = array(), array $options = array()) {
|
||||||
$replacements = array();
|
$replacements = array();
|
||||||
|
|
||||||
// The first thing that we're going to check for is the type of token - node,
|
// The first thing that we're going to check for is the type of token - node,
|
||||||
// user etc...
|
// user etc...
|
||||||
if ($type == 'foo') {
|
if ($type == 'foo') {
|
||||||
// Loop through each of the available tokens.
|
// Loop through each of the available tokens.
|
||||||
foreach ($tokens as $name => $original) {
|
foreach ($tokens as $name => $original) {
|
||||||
// Find the desired token by name
|
// Find the desired token by name
|
||||||
switch ($name) {
|
switch ($name) {
|
||||||
case 'bar':
|
case 'bar':
|
||||||
$new = '';
|
$new = '';
|
||||||
|
|
||||||
// Work out the value of $new...
|
// Work out the value of $new...
|
||||||
|
|
||||||
// Add the new value into the replacements array.
|
// Add the new value into the replacements array.
|
||||||
$replacements[$original] = $new;
|
$replacements[$original] = $new;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Return the replacements.
|
// Return the replacements.
|
||||||
return $replacements;
|
return $replacements;
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
@ -106,22 +106,22 @@ An example from Copyright Block module:
|
||||||
* Implements hook_tokens().
|
* Implements hook_tokens().
|
||||||
*/
|
*/
|
||||||
function copyright_block_tokens($type, $tokens, array $data = array(), array $options = array()) {
|
function copyright_block_tokens($type, $tokens, array $data = array(), array $options = array()) {
|
||||||
$replacements = array();
|
$replacements = array();
|
||||||
|
|
||||||
if ($type == 'copyright_statement') {
|
if ($type == 'copyright_statement') {
|
||||||
foreach ($tokens as $name => $original) {
|
foreach ($tokens as $name => $original) {
|
||||||
switch ($name) {
|
switch ($name) {
|
||||||
case 'dates':
|
case 'dates':
|
||||||
$start_year = variable_get('copyright_block_start_year', date('Y'));
|
$start_year = variable_get('copyright_block_start_year', date('Y'));
|
||||||
$current_year = date('Y');
|
$current_year = date('Y');
|
||||||
|
|
||||||
$replacements[$original] = $start_year < $current_year ? $start_year . '-' . $current_year : $start_year;
|
$replacements[$original] = $start_year < $current_year ? $start_year . '-' . $current_year : $start_year;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $replacements;
|
return $replacements;
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
@ -135,4 +135,4 @@ $a = t('Something');
|
||||||
$b = token_replace($a);
|
$b = token_replace($a);
|
||||||
// This would only use foo tokens.
|
// This would only use foo tokens.
|
||||||
$c = token_replace($a, array('foo'));
|
$c = token_replace($a, array('foo'));
|
||||||
~~~
|
~~~
|
||||||
|
|
|
@ -3,14 +3,14 @@ title: The Quickest way to Install Sublime Text 2 in Ubuntu
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: quickest-way-install-sublime-text-2-ubuntu
|
slug: quickest-way-install-sublime-text-2-ubuntu
|
||||||
tags:
|
tags:
|
||||||
- linux
|
- linux
|
||||||
- sublime-text
|
- sublime-text
|
||||||
- ubuntu
|
- ubuntu
|
||||||
---
|
---
|
||||||
After reading numerous blog posts about how to install [Sublime Text 2](http://www.sublimetext.com/2 "Sublime Text 2") in [Ubuntu](http://www.ubuntu.com/2 "Ubuntu"), this is definitely the quickest way! Just paste the following lines into your Terminal:
|
After reading numerous blog posts about how to install [Sublime Text 2](http://www.sublimetext.com/2 "Sublime Text 2") in [Ubuntu](http://www.ubuntu.com/2 "Ubuntu"), this is definitely the quickest way! Just paste the following lines into your Terminal:
|
||||||
|
|
||||||
$ sudo add-apt-repository ppa:webupd8team/sublime-text-2
|
$ sudo add-apt-repository ppa:webupd8team/sublime-text-2
|
||||||
$ sudo apt-get update
|
$ sudo apt-get update
|
||||||
$ sudo apt-get install sublime-text
|
$ sudo apt-get install sublime-text
|
||||||
|
|
||||||
After running this, Sublime Text 2 has been installed within the */usr/lib/sublime-text-2* directory and can be launched from the Dashboard, or by typing `subl`, `sublime-text` or `sublime-text-2` into a Terminal window.
|
After running this, Sublime Text 2 has been installed within the */usr/lib/sublime-text-2* directory and can be launched from the Dashboard, or by typing `subl`, `sublime-text` or `sublime-text-2` into a Terminal window.
|
||||||
|
|
|
@ -3,12 +3,12 @@ title: Leaving Nomensa, Joining Precedent
|
||||||
nav: blog
|
nav: blog
|
||||||
description: Yesterday was my last day working at Nomensa. Next week, I'll be starting as a Senior Developer at Precedent.
|
description: Yesterday was my last day working at Nomensa. Next week, I'll be starting as a Senior Developer at Precedent.
|
||||||
tags:
|
tags:
|
||||||
- nomensa
|
- nomensa
|
||||||
- precedent
|
- precedent
|
||||||
- personal
|
- personal
|
||||||
---
|
---
|
||||||
Yesterday was my last day working at [Nomensa](http://www.nomensa.com "Nomensa"). Next week, I'll be starting as a Senior Developer at [Precedent](http://www.precedent.co.uk "Precedent").
|
Yesterday was my last day working at [Nomensa](http://www.nomensa.com "Nomensa"). Next week, I'll be starting as a Senior Developer at [Precedent](http://www.precedent.co.uk "Precedent").
|
||||||
|
|
||||||
The last 14 months that I've been working at Nomensa have been absolutely fantastic, and had allowed me to work on some great projects for great clients - mainly [unionlearn](http://www.unionlearn.org "unionlearn") and [Digital Theatre Plus](http://www.digitaltheatreplus.com "Digital Theatre Plus"). I've learned so much about accessibility and web standards, and have pretty much changed my whole approach to front-end development to accommodate best practices. I've also been involved with the Drupal Accessibility group since starting at Nomensa, and have written several accessibility-focused Drupal modules, including the [Nomensa Accessible Media Player](http://drupal.org/project/nomensa_amp "The Nomensa Accessible Media Player Drupal module") module and the [Accessibility Checklist](http://drupal.org/project/a11y_checklist "The accessibility checklist for Drupal"). I'll definitely be continuing my interest in accessibility, championing best practices, and incorporating it into my future work wherever possible.
|
The last 14 months that I've been working at Nomensa have been absolutely fantastic, and had allowed me to work on some great projects for great clients - mainly [unionlearn](http://www.unionlearn.org "unionlearn") and [Digital Theatre Plus](http://www.digitaltheatreplus.com "Digital Theatre Plus"). I've learned so much about accessibility and web standards, and have pretty much changed my whole approach to front-end development to accommodate best practices. I've also been involved with the Drupal Accessibility group since starting at Nomensa, and have written several accessibility-focused Drupal modules, including the [Nomensa Accessible Media Player](http://drupal.org/project/nomensa_amp "The Nomensa Accessible Media Player Drupal module") module and the [Accessibility Checklist](http://drupal.org/project/a11y_checklist "The accessibility checklist for Drupal"). I'll definitely be continuing my interest in accessibility, championing best practices, and incorporating it into my future work wherever possible.
|
||||||
|
|
||||||
With that all said, I'm really looking forward to starting my new role at Precedent, tackling some new challenges, and I'm sure that it'll be as great a place to work as Nomensa was.
|
With that all said, I'm really looking forward to starting my new role at Precedent, tackling some new challenges, and I'm sure that it'll be as great a place to work as Nomensa was.
|
||||||
|
|
|
@ -4,10 +4,10 @@ nav: blog
|
||||||
description: Whilst watching Drupalize.me's recent Introduction to Git series, I thought it was useful the way that the current Git branch or tag name was displayed in the bash prompt. Here's how to do it.
|
description: Whilst watching Drupalize.me's recent Introduction to Git series, I thought it was useful the way that the current Git branch or tag name was displayed in the bash prompt. Here's how to do it.
|
||||||
slug: display-git-branch-or-tag-names-your-bash-prompt
|
slug: display-git-branch-or-tag-names-your-bash-prompt
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- git
|
- git
|
||||||
- terminal
|
- terminal
|
||||||
---
|
---
|
||||||
Whilst watching [Drupalize.me](http://drupalize.me "Drupalize.me")'s recent [Introduction to Git series](http://drupalize.me/series/introduction-git-series "Introduction to Git on Drupalize.me"), I thought it was useful the way that the current Git branch or tag name was displayed in the bash prompt.
|
Whilst watching [Drupalize.me](http://drupalize.me "Drupalize.me")'s recent [Introduction to Git series](http://drupalize.me/series/introduction-git-series "Introduction to Git on Drupalize.me"), I thought it was useful the way that the current Git branch or tag name was displayed in the bash prompt.
|
||||||
|
|
||||||
|
@ -22,37 +22,37 @@ Here's how to do it.
|
||||||
|
|
||||||
To begin with, create a new file to contain the functions,
|
To begin with, create a new file to contain the functions,
|
||||||
|
|
||||||
vim ~/.bash/git-prompt
|
vim ~/.bash/git-prompt
|
||||||
|
|
||||||
Paste the following code into the file, and save it.
|
Paste the following code into the file, and save it.
|
||||||
|
|
||||||
~~~~
|
~~~~
|
||||||
parse_git_branch () {
|
parse_git_branch () {
|
||||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_git_tag () {
|
parse_git_tag () {
|
||||||
git describe --tags 2> /dev/null
|
git describe --tags 2> /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_git_branch_or_tag() {
|
parse_git_branch_or_tag() {
|
||||||
local OUT="$(parse_git_branch)"
|
local OUT="$(parse_git_branch)"
|
||||||
if [ "$OUT" == " ((no branch))" ]; then
|
if [ "$OUT" == " ((no branch))" ]; then
|
||||||
OUT="($(parse_git_tag))";
|
OUT="($(parse_git_tag))";
|
||||||
fi
|
fi
|
||||||
echo $OUT
|
echo $OUT
|
||||||
}
|
}
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
Edit your `.bashrc` or `.bash_profile` file to override the PS1 value.
|
Edit your `.bashrc` or `.bash_profile` file to override the PS1 value.
|
||||||
|
|
||||||
vim ~/.bashrc
|
vim ~/.bashrc
|
||||||
|
|
||||||
Add the following code at the bottom of the file, and save it.
|
Add the following code at the bottom of the file, and save it.
|
||||||
|
|
||||||
~~~~
|
~~~~
|
||||||
source ~/.bash/git-prompt
|
source ~/.bash/git-prompt
|
||||||
PS1="\u@\h:\w\$(parse_git_branch_or_tag) $ "
|
PS1="\u@\h:\w\$(parse_git_branch_or_tag) $ "
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
Restart your Terminal or type `source ~/.bashrc` to see your changes.
|
Restart your Terminal or type `source ~/.bashrc` to see your changes.
|
||||||
|
|
|
@ -3,11 +3,11 @@ title: Some useful links for using SimpleTest in Drupal
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: some-useful-links-using-simpletest-drupal
|
slug: some-useful-links-using-simpletest-drupal
|
||||||
tags:
|
tags:
|
||||||
- simpletest
|
- simpletest
|
||||||
- tdd
|
- tdd
|
||||||
- test-driven-development
|
- test-driven-development
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drupal
|
- drupal
|
||||||
---
|
---
|
||||||
Here are some useful links that I've found when researching about unit testing in Drupal using SimpleTest:
|
Here are some useful links that I've found when researching about unit testing in Drupal using SimpleTest:
|
||||||
|
|
||||||
|
@ -16,4 +16,4 @@ Here are some useful links that I've found when researching about unit testing i
|
||||||
* [SimpleTest Tutorial (Drupal 6)](https://drupal.org/simpletest-tutorial "SimpleTest Tutorial (Drupal 6)")
|
* [SimpleTest Tutorial (Drupal 6)](https://drupal.org/simpletest-tutorial "SimpleTest Tutorial (Drupal 6)")
|
||||||
* [SimpleTest Tutorial (Drupal 7)](https://drupal.org/simpletest-tutorial-drupal7 "SimpleTest Tutorial (Drupal 7)")
|
* [SimpleTest Tutorial (Drupal 7)](https://drupal.org/simpletest-tutorial-drupal7 "SimpleTest Tutorial (Drupal 7)")
|
||||||
* [SimpleTest Reference](https://drupal.org/node/278126 "SimpleTest Reference")
|
* [SimpleTest Reference](https://drupal.org/node/278126 "SimpleTest Reference")
|
||||||
* [Testing with SimpleTest](https://drupal.org/node/1128366 "Testing with SimpleTest")
|
* [Testing with SimpleTest](https://drupal.org/node/1128366 "Testing with SimpleTest")
|
||||||
|
|
|
@ -3,11 +3,11 @@ title: Creating Local and Staging sites with Drupal's Domain Module Enabled
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: creating-local-and-staging-sites-drupals-domain-module-enabled
|
slug: creating-local-and-staging-sites-drupals-domain-module-enabled
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- databases
|
- databases
|
||||||
- domain
|
- domain
|
||||||
- table-prefixing
|
- table-prefixing
|
||||||
---
|
---
|
||||||
The [Domain Access project](https://drupal.org/project/domain "The Domain Access project on Drupal.org") is a suite of modules that provide tools for running a group of affiliated sites from one Drupal installation and a single shared database. The issue is that the domains are stored within the database so these are copied across when the data is migrated between environments, whereas the domains are obviously going to change.
|
The [Domain Access project](https://drupal.org/project/domain "The Domain Access project on Drupal.org") is a suite of modules that provide tools for running a group of affiliated sites from one Drupal installation and a single shared database. The issue is that the domains are stored within the database so these are copied across when the data is migrated between environments, whereas the domains are obviously going to change.
|
||||||
|
|
||||||
|
@ -23,19 +23,19 @@ Within each site's settings.php file, define the prefix for the domain table wit
|
||||||
|
|
||||||
~~~~php
|
~~~~php
|
||||||
$databases['default']['default'] = array(
|
$databases['default']['default'] = array(
|
||||||
'driver' => 'mysql',
|
'driver' => 'mysql',
|
||||||
'database' => 'foobar',
|
'database' => 'foobar',
|
||||||
'username' => 'foo',
|
'username' => 'foo',
|
||||||
'password' => 'bar',
|
'password' => 'bar',
|
||||||
'host' => 'localhost',
|
'host' => 'localhost',
|
||||||
'prefix' => array(
|
'prefix' => array(
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'domain' => 'local_', // This will use the local_domain table.
|
'domain' => 'local_', // This will use the local_domain table.
|
||||||
// Add any other prefixed tables here.
|
// Add any other prefixed tables here.
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
Within each environment-specific domain table, update the subdomain column to contain the appropriate domain names.
|
Within each environment-specific domain table, update the subdomain column to contain the appropriate domain names.
|
||||||
|
|
||||||
**Update:** I've just found out about the Domain Alias sub-module, which you can enable and add aliases to each domain, so you could add the aliases in this way also.
|
**Update:** I've just found out about the Domain Alias sub-module, which you can enable and add aliases to each domain, so you could add the aliases in this way also.
|
||||||
|
|
|
@ -3,11 +3,11 @@ title: Going to DrupalCon
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: going-drupalcon
|
slug: going-drupalcon
|
||||||
tags:
|
tags:
|
||||||
- drupalcon
|
- drupalcon
|
||||||
- precedent
|
- precedent
|
||||||
---
|
---
|
||||||
[Precedent](http://www.precedent.co.uk) are sending myself and two of our other Drupal Developers to [Drupalcon Prague](http://prague2013.drupal.org).
|
[Precedent](http://www.precedent.co.uk) are sending myself and two of our other Drupal Developers to [Drupalcon Prague](http://prague2013.drupal.org).
|
||||||
|
|
||||||
Having wanted to attend the last few Drupalcons (London, especially) but not being able to, I'm definitely looking forward to this one.
|
Having wanted to attend the last few Drupalcons (London, especially) but not being able to, I'm definitely looking forward to this one.
|
||||||
|
|
||||||
See you there!
|
See you there!
|
||||||
|
|
|
@ -3,19 +3,19 @@ title: Create a Zen Sub-theme Using Drush
|
||||||
nav: blog
|
nav: blog
|
||||||
description: How to quickly create a Zen sub-theme using Drush.
|
description: How to quickly create a Zen sub-theme using Drush.
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drush
|
- drush
|
||||||
- zen
|
- zen
|
||||||
- theming
|
- theming
|
||||||
---
|
---
|
||||||
First, download the [Zen](https://drupal.org/project/zen "The Zen theme") theme if you haven't already done so.
|
First, download the [Zen](https://drupal.org/project/zen "The Zen theme") theme if you haven't already done so.
|
||||||
|
|
||||||
$ drush dl zen
|
$ drush dl zen
|
||||||
|
|
||||||
This will now enable you to use the "drush zen" command.
|
This will now enable you to use the "drush zen" command.
|
||||||
|
|
||||||
$ drush zen "Oliver Davies" oliverdavies --description="A Zen sub-theme for oliverdavies.co.uk" --without-rtl
|
$ drush zen "Oliver Davies" oliverdavies --description="A Zen sub-theme for oliverdavies.co.uk" --without-rtl
|
||||||
|
|
||||||
The parameters that I'm passing it are:
|
The parameters that I'm passing it are:
|
||||||
|
|
||||||
|
@ -26,4 +26,4 @@ The parameters that I'm passing it are:
|
||||||
|
|
||||||
This will create a new theme in sites/all/themes/oliverdavies.
|
This will create a new theme in sites/all/themes/oliverdavies.
|
||||||
|
|
||||||
For further help, type `$ drush help zen` to see the Drush help page for the zen command.
|
For further help, type `$ drush help zen` to see the Drush help page for the zen command.
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
title: Don't Bootstrap Drupal, Use Drush
|
title: Don't Bootstrap Drupal, Use Drush
|
||||||
nav: blog
|
nav: blog
|
||||||
tags:
|
tags:
|
||||||
- drush
|
- drush
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- php
|
- php
|
||||||
---
|
---
|
||||||
There are times when doing Drupal development when you need to run a custom PHP script, maybe moving data from one field to another, that doesn't warrant the time and effort to create a custom module. In this scenario, it would be quicker to write a .php script and bootstrap Drupal to gain access to functions like `node_load()` and `db_query()`.
|
There are times when doing Drupal development when you need to run a custom PHP script, maybe moving data from one field to another, that doesn't warrant the time and effort to create a custom module. In this scenario, it would be quicker to write a .php script and bootstrap Drupal to gain access to functions like `node_load()` and `db_query()`.
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ $node = node_load(1);
|
||||||
|
|
||||||
The script would need be placed in the root of your Drupal directory, and you would then have had to open a browser window and visit http://example.com/foo.php to execute it. This is where the "drush php-script" command (or "drush scr" for short) is useful, and can be used to execute the script from the command line.
|
The script would need be placed in the root of your Drupal directory, and you would then have had to open a browser window and visit http://example.com/foo.php to execute it. This is where the "drush php-script" command (or "drush scr" for short) is useful, and can be used to execute the script from the command line.
|
||||||
|
|
||||||
$ drush scr foo.php
|
$ drush scr foo.php
|
||||||
|
|
||||||
It also means that I no longer need to manually bootstrap Drupal, so my script is much cleaner.
|
It also means that I no longer need to manually bootstrap Drupal, so my script is much cleaner.
|
||||||
|
|
||||||
|
@ -38,10 +38,10 @@ $node = node_load(1);
|
||||||
|
|
||||||
I prefer to keep these scripts outside of my Drupal directory in a separate "scripts" directory (with Drupal in a "drupal" directory on the same level). This makes it easier to update Drupal as I don't need to worry about accidentally deleting the additional files. From within the drupal directory, I can now run the following command to go up one level, into the scripts directory and then execute the script. Note that you do not need to include the file extension.
|
I prefer to keep these scripts outside of my Drupal directory in a separate "scripts" directory (with Drupal in a "drupal" directory on the same level). This makes it easier to update Drupal as I don't need to worry about accidentally deleting the additional files. From within the drupal directory, I can now run the following command to go up one level, into the scripts directory and then execute the script. Note that you do not need to include the file extension.
|
||||||
|
|
||||||
$ drush scr ../scripts/foo
|
$ drush scr ../scripts/foo
|
||||||
|
|
||||||
Or, if you're using [Drush aliases](http://deeson-online.co.uk/labs/drupal-drush-aliases-and-how-use-them "Drupal, Drush aliases, and how to use them"):
|
Or, if you're using [Drush aliases](http://deeson-online.co.uk/labs/drupal-drush-aliases-and-how-use-them "Drupal, Drush aliases, and how to use them"):
|
||||||
|
|
||||||
$ drush @mysite.local scr foo
|
$ drush @mysite.local scr foo
|
||||||
|
|
||||||
If you commonly use the same scripts for different projects, you could also store these within a separate Git repository and checkout the scripts directory using a [Git submodule](http://git-scm.com/book/en/Git-Tools-Submodules "Git Submodules").
|
If you commonly use the same scripts for different projects, you could also store these within a separate Git repository and checkout the scripts directory using a [Git submodule](http://git-scm.com/book/en/Git-Tools-Submodules "Git Submodules").
|
||||||
|
|
|
@ -3,7 +3,7 @@ title: Useful Vagrant Commands
|
||||||
nav: blog
|
nav: blog
|
||||||
description: Here are the basic commands that you need to adminster a virtual machine using <a href="http://vagrantup.com" title="The Vagrant Home page">Vagrant</a>.
|
description: Here are the basic commands that you need to adminster a virtual machine using <a href="http://vagrantup.com" title="The Vagrant Home page">Vagrant</a>.
|
||||||
tags:
|
tags:
|
||||||
- vagrant
|
- vagrant
|
||||||
---
|
---
|
||||||
[Vagrant](http://www.vagrantup.com "About Vagrant") is a tool for managing virtual machines within [VirtualBox](https://www.virtualbox.org) from the command line. Here are some useful commands to know when using Vagrant:
|
[Vagrant](http://www.vagrantup.com "About Vagrant") is a tool for managing virtual machines within [VirtualBox](https://www.virtualbox.org) from the command line. Here are some useful commands to know when using Vagrant:
|
||||||
|
|
||||||
|
@ -18,4 +18,4 @@ vagrant suspend | Suspend the Vagrant box. Use "vagrant up" to start the box aga
|
||||||
vagrant halt (-f) | Halt the Vagrant box. Use -f to forcefully shut down the box without prompting for confirmation.
|
vagrant halt (-f) | Halt the Vagrant box. Use -f to forcefully shut down the box without prompting for confirmation.
|
||||||
vagrant destroy (-f) | Destroys a Vagrant box. Use -f to forcefully shut down the box without prompting for confirmation.
|
vagrant destroy (-f) | Destroys a Vagrant box. Use -f to forcefully shut down the box without prompting for confirmation.
|
||||||
|
|
||||||
The full Vagrant documentation can be found at <http://docs.vagrantup.com/v2/>.
|
The full Vagrant documentation can be found at <http://docs.vagrantup.com/v2/>.
|
||||||
|
|
|
@ -3,18 +3,18 @@ title: Quickly Apply Patches Using Git and curl or wget
|
||||||
nav: blog
|
nav: blog
|
||||||
description: How to quickly download a patch file and apply it to a Git repository in one line
|
description: How to quickly download a patch file and apply it to a Git repository in one line
|
||||||
tags:
|
tags:
|
||||||
- git
|
- git
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
---
|
---
|
||||||
Testing a patch file is usually a two-step process. First you download the patch file from the source, and then you run a separate command to apply it.
|
Testing a patch file is usually a two-step process. First you download the patch file from the source, and then you run a separate command to apply it.
|
||||||
|
|
||||||
You can save time and typing by running the two commands on one line:
|
You can save time and typing by running the two commands on one line:
|
||||||
|
|
||||||
$ curl http://drupal.org/files/[patch-name].patch | git apply -v
|
$ curl http://drupal.org/files/[patch-name].patch | git apply -v
|
||||||
|
|
||||||
Or, if you don't have curl installed, you can use wget:
|
Or, if you don't have curl installed, you can use wget:
|
||||||
|
|
||||||
$ wget -q -O - http://drupal.org/files/[patch-name].patch | git apply -v
|
$ wget -q -O - http://drupal.org/files/[patch-name].patch | git apply -v
|
||||||
|
|
||||||
These commands need to be run within the root of your Git repository (i.e. where the .git directory is).
|
These commands need to be run within the root of your Git repository (i.e. where the .git directory is).
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ nav: blog
|
||||||
description: How to download different versions of Drupal core using Drush.
|
description: How to download different versions of Drupal core using Drush.
|
||||||
slug: download-different-versions-drupal-drush
|
slug: download-different-versions-drupal-drush
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drush
|
- drush
|
||||||
---
|
---
|
||||||
If you use [Drush](https://raw.github.com/drush-ops/drush/master/README.md "About Drush"), it's likely that you've used the `drush pm-download` (or `drush dl` for short) command to start a new project. This command downloads projects from Drupal.org, but if you don't specify a project or type "drush dl drupal", the command will download the current stable version of Drupal core. Currently, this will be Drupal 7 with that being the current stable version of core at the time of writing this post.
|
If you use [Drush](https://raw.github.com/drush-ops/drush/master/README.md "About Drush"), it's likely that you've used the `drush pm-download` (or `drush dl` for short) command to start a new project. This command downloads projects from Drupal.org, but if you don't specify a project or type "drush dl drupal", the command will download the current stable version of Drupal core. Currently, this will be Drupal 7 with that being the current stable version of core at the time of writing this post.
|
||||||
|
|
||||||
|
@ -16,22 +16,22 @@ I still maintain a number of Drupal 6 sites and occassionally need to download D
|
||||||
|
|
||||||
By declarding the core version of Drupal, such as "drupal-6", Drush will download that instead.
|
By declarding the core version of Drupal, such as "drupal-6", Drush will download that instead.
|
||||||
|
|
||||||
$ drush dl drupal-6
|
$ drush dl drupal-6
|
||||||
|
|
||||||
This downloads the most recent stable version of Drupal 6. If you don't want that, you can add the --select and additionally the --all options to be presented with an entire list to chose from.
|
This downloads the most recent stable version of Drupal 6. If you don't want that, you can add the --select and additionally the --all options to be presented with an entire list to chose from.
|
||||||
|
|
||||||
$ drush dl drupal-6 --select
|
$ drush dl drupal-6 --select
|
||||||
$ drush dl drupal-6 --select --all
|
$ drush dl drupal-6 --select --all
|
||||||
|
|
||||||
If you want the most recent development version, just type:
|
If you want the most recent development version, just type:
|
||||||
|
|
||||||
$ drush dl drupal-6.x
|
$ drush dl drupal-6.x
|
||||||
|
|
||||||
The same can be done for other core versions of Drupal, from Drupal 5 upwards.
|
The same can be done for other core versions of Drupal, from Drupal 5 upwards.
|
||||||
|
|
||||||
# This will download Drupal 5
|
# This will download Drupal 5
|
||||||
$ drush dl drupal-5
|
$ drush dl drupal-5
|
||||||
# This will download Drupal 8
|
# This will download Drupal 8
|
||||||
$ drush dl drupal-8
|
$ drush dl drupal-8
|
||||||
|
|
||||||
For a full list of the available options, type "drush help pm-download" into a Terminal window or take a look at the entry on [drush.ws](http://drush.ws/#pm-download, "The entry for pm-download on drush.ws").
|
For a full list of the available options, type "drush help pm-download" into a Terminal window or take a look at the entry on [drush.ws](http://drush.ws/#pm-download, "The entry for pm-download on drush.ws").
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
title: Some Useful Git Aliases
|
title: Some Useful Git Aliases
|
||||||
nav: blog
|
nav: blog
|
||||||
tags:
|
tags:
|
||||||
- git
|
- git
|
||||||
---
|
---
|
||||||
Here are some bash aliases that I use and find helpful for quickly writing Git and Git Flow commands. These should be placed within your `~/.bashrc` or `~/.bash_profile` file:
|
Here are some bash aliases that I use and find helpful for quickly writing Git and Git Flow commands. These should be placed within your `~/.bashrc` or `~/.bash_profile` file:
|
||||||
|
|
||||||
|
@ -26,4 +26,4 @@ alias gfi="git flow init"
|
||||||
alias gff="git flow feature"
|
alias gff="git flow feature"
|
||||||
alias gfr="git flow release"
|
alias gfr="git flow release"
|
||||||
alias gfh="git flow hotfix"
|
alias gfh="git flow hotfix"
|
||||||
~~~~
|
~~~~
|
||||||
|
|
|
@ -3,10 +3,10 @@ title: DrupalCamp London 2014
|
||||||
nav: blog
|
nav: blog
|
||||||
description: It's all booked, I'm going to be attending DrupalCamp London.
|
description: It's all booked, I'm going to be attending DrupalCamp London.
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupalcamp-london
|
- drupalcamp-london
|
||||||
- git
|
- git
|
||||||
- git-flow
|
- git-flow
|
||||||
---
|
---
|
||||||
It's all booked, I'm going to be attending [DrupalCamp London](http://2014.drupalcamplondon.co.uk).
|
It's all booked, I'm going to be attending [DrupalCamp London](http://2014.drupalcamplondon.co.uk).
|
||||||
|
|
||||||
|
@ -16,4 +16,4 @@ I'm looking forward to meeting some new people as well as catching up with some
|
||||||
|
|
||||||
If you're also coming, see you there!
|
If you're also coming, see you there!
|
||||||
|
|
||||||
**Update:** I've just found out that my session, [What is Git Flow?](http://2014.drupalcamplondon.co.uk/drupalcamp-london-2014/session/what-git-flow "Information about the session on the DrupalCamp website"), has been accepted and will take place on the Sunday morning. It's going to be a busy weekend!
|
**Update:** I've just found out that my session, [What is Git Flow?](http://2014.drupalcamplondon.co.uk/drupalcamp-london-2014/session/what-git-flow "Information about the session on the DrupalCamp website"), has been accepted and will take place on the Sunday morning. It's going to be a busy weekend!
|
||||||
|
|
|
@ -4,10 +4,10 @@ nav: blog
|
||||||
description: Slides and notes from my talk, "What is Git Flow?", that I presented at DrupalCamp London 2014.
|
description: Slides and notes from my talk, "What is Git Flow?", that I presented at DrupalCamp London 2014.
|
||||||
slug: what-git-flow
|
slug: what-git-flow
|
||||||
tags:
|
tags:
|
||||||
- git
|
- git
|
||||||
- git-flow
|
- git-flow
|
||||||
- drupalcamp-london
|
- drupalcamp-london
|
||||||
- talks
|
- talks
|
||||||
tweets: true
|
tweets: true
|
||||||
---
|
---
|
||||||
Here are my slides from my "What is Git Flow?" session at [DrupalCamp London](http://2014.drupalcamplondon.co.uk).
|
Here are my slides from my "What is Git Flow?" session at [DrupalCamp London](http://2014.drupalcamplondon.co.uk).
|
||||||
|
@ -35,4 +35,4 @@ I've had some great feedback via Twitter:
|
||||||
|
|
||||||
<blockquote class="twitter-tweet" data-cards="hidden" lang="en"><p>Great presentation by <a href="https://twitter.com/opdavies">@opdavies</a> on git flow at <a href="https://twitter.com/search?q=%23dclondon&src=hash">#dclondon</a> very well prepared and presented. <a href="http://t.co/tDINp2Nsbn">pic.twitter.com/tDINp2Nsbn</a></p>— Greg Franklin (@gfranklin) <a href="https://twitter.com/gfranklin/statuses/440104311276969984">March 2, 2014</a></blockquote>
|
<blockquote class="twitter-tweet" data-cards="hidden" lang="en"><p>Great presentation by <a href="https://twitter.com/opdavies">@opdavies</a> on git flow at <a href="https://twitter.com/search?q=%23dclondon&src=hash">#dclondon</a> very well prepared and presented. <a href="http://t.co/tDINp2Nsbn">pic.twitter.com/tDINp2Nsbn</a></p>— Greg Franklin (@gfranklin) <a href="https://twitter.com/gfranklin/statuses/440104311276969984">March 2, 2014</a></blockquote>
|
||||||
|
|
||||||
<blockquote class="twitter-tweet" lang="en"><p>Great talk on git flow <a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/search?q=%23dclondon&src=hash">#dclondon</a></p>— Curve Agency (@CurveAgency) <a href="https://twitter.com/CurveAgency/statuses/440095250775035904">March 2, 2014</a></blockquote>
|
<blockquote class="twitter-tweet" lang="en"><p>Great talk on git flow <a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/search?q=%23dclondon&src=hash">#dclondon</a></p>— Curve Agency (@CurveAgency) <a href="https://twitter.com/CurveAgency/statuses/440095250775035904">March 2, 2014</a></blockquote>
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
title: Drupal Association
|
title: Drupal Association
|
||||||
nav: blog
|
nav: blog
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- personal
|
- personal
|
||||||
---
|
---
|
||||||
Today was my last day working at [Precedent](http://www.precedent.com). Next week, I'll be starting my [new job](https://assoc.drupal.org/node/18923 "Drupal.org Developer") at the [Drupal Association](http://assoc.drupal.org) working on Drupal's home - [Drupal.org](http://www.drupal.org).
|
Today was my last day working at [Precedent](http://www.precedent.com). Next week, I'll be starting my [new job](https://assoc.drupal.org/node/18923 "Drupal.org Developer") at the [Drupal Association](http://assoc.drupal.org) working on Drupal's home - [Drupal.org](http://www.drupal.org).
|
||||||
|
|
||||||
|
@ -15,4 +15,4 @@ I was able to [contribute some code](https://drupal.org/project/eventsforce) bac
|
||||||
|
|
||||||
It was good to be able to introduce some new tools like [Vagrant](http://www.vagrantup.com), [Puppet](http://www.puppetlabs.com), [SASS](http://www.sass-lang.com) and [Compass](http://www.compass-style.org) into the team. I was pleased to introduce and champion the [Git Flow](http://danielkummer.github.io/git-flow-cheatsheet "Git Flow Cheat Sheet") branching model, which them became the standard approach for all Drupal projects, and hopefully soon all development projects.
|
It was good to be able to introduce some new tools like [Vagrant](http://www.vagrantup.com), [Puppet](http://www.puppetlabs.com), [SASS](http://www.sass-lang.com) and [Compass](http://www.compass-style.org) into the team. I was pleased to introduce and champion the [Git Flow](http://danielkummer.github.io/git-flow-cheatsheet "Git Flow Cheat Sheet") branching model, which them became the standard approach for all Drupal projects, and hopefully soon all development projects.
|
||||||
|
|
||||||
Working for the Drupal Association and on Drupal.org was an opportunity that I couldn't refuse, and is certainly going to be a fun and interesting challenge. I can't wait to get started!
|
Working for the Drupal Association and on Drupal.org was an opportunity that I couldn't refuse, and is certainly going to be a fun and interesting challenge. I can't wait to get started!
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
title: Thanks
|
title: Thanks
|
||||||
nav: blog
|
nav: blog
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-association
|
- drupal-association
|
||||||
- personal
|
- personal
|
||||||
---
|
---
|
||||||
This is just a quick post to thank everyone for their comments and congratulations after my previous post about [joining the Drupal Association](/blog/drupal-association/). I’m looking forward to my first day in the job tomorrow.
|
This is just a quick post to thank everyone for their comments and congratulations after my previous post about [joining the Drupal Association](/blog/drupal-association/). I’m looking forward to my first day in the job tomorrow.
|
||||||
|
|
|
@ -3,10 +3,10 @@ title: git format-patch is your Friend
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: git-format-patch
|
slug: git-format-patch
|
||||||
tags:
|
tags:
|
||||||
- patches
|
- patches
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- git
|
- git
|
||||||
---
|
---
|
||||||
## The Problem
|
## The Problem
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ There is an option that the maintainer can add to the end of their commit messag
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
--author="opdavies <opdavies@381388.no-reply.drupal.org>"
|
--author="opdavies <opdavies@381388.no-reply.drupal.org>"
|
||||||
|
|
||||||
This differs slightly different for each Drupal user, and the code can be found on their Drupal.org profile page.
|
This differs slightly different for each Drupal user, and the code can be found on their Drupal.org profile page.
|
||||||
|
|
||||||
|
@ -75,8 +75,8 @@ If you need to commit a patch that was created using `git format-patch`, the bes
|
||||||
|
|
||||||
For example, within your repository, run:
|
For example, within your repository, run:
|
||||||
|
|
||||||
$ git am /path/to/file
|
$ git am /path/to/file
|
||||||
$ git am ~/Code/metatag-comment-fragment-conflict-2265447-4.patch
|
$ git am ~/Code/metatag-comment-fragment-conflict-2265447-4.patch
|
||||||
|
|
||||||
You should end up with some output similar to the following:
|
You should end up with some output similar to the following:
|
||||||
|
|
||||||
|
@ -89,4 +89,4 @@ Applying: #2272799 Replaced URL
|
||||||
|
|
||||||
Each line is the commit message associated with that patch.
|
Each line is the commit message associated with that patch.
|
||||||
|
|
||||||
Assuming that there are no errors, you can go ahead and push your updated code into your remote repository.
|
Assuming that there are no errors, you can go ahead and push your updated code into your remote repository.
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
title: drush make drupalbristol
|
title: drush make drupalbristol
|
||||||
nav: blog
|
nav: blog
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drush
|
- drush
|
||||||
- drush-make
|
- drush-make
|
||||||
- drupal-bristol
|
- drupal-bristol
|
||||||
- talks
|
- talks
|
||||||
---
|
---
|
||||||
Here are my slides from this month's talk night at the [Drupal Bristol user group](https://groups.drupal.org/bristol-and-west-uk).
|
Here are my slides from this month's talk night at the [Drupal Bristol user group](https://groups.drupal.org/bristol-and-west-uk).
|
||||||
|
|
||||||
<script async class="speakerdeck-embed" data-id="42605700f102013198de5a5f6f23ab67" data-ratio="1.29456384323641" src="//speakerdeck.com/assets/embed.js"></script>
|
<script async class="speakerdeck-embed" data-id="42605700f102013198de5a5f6f23ab67" data-ratio="1.29456384323641" src="//speakerdeck.com/assets/embed.js"></script>
|
||||||
|
|
|
@ -3,10 +3,10 @@ title: How to fix Vagrant Loading the Wrong Virtual Machine
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: fix-vagrant-loading-wrong-virtual-machine
|
slug: fix-vagrant-loading-wrong-virtual-machine
|
||||||
tags:
|
tags:
|
||||||
- vagrant
|
- vagrant
|
||||||
- virtualbox
|
- virtualbox
|
||||||
meta:
|
meta:
|
||||||
description: How to fix it when Vagrant loads the wrong virtual machine.
|
description: How to fix it when Vagrant loads the wrong virtual machine.
|
||||||
---
|
---
|
||||||
A few times recently, I've had instances where Vagrant seems to have forgotten which virtual machine it's supposed to load, probably due to renaming a project directory or the .vagrant directory being moved accidentally.
|
A few times recently, I've had instances where Vagrant seems to have forgotten which virtual machine it's supposed to load, probably due to renaming a project directory or the .vagrant directory being moved accidentally.
|
||||||
|
|
||||||
|
@ -15,4 +15,4 @@ Here are the steps that I took to fix this and point Vagrant back at the correct
|
||||||
1. Stop the machine from running using the `$ vagrant halt` command.
|
1. Stop the machine from running using the `$ vagrant halt` command.
|
||||||
2. Use the `$ VBoxManage list vms` command to view a list of the virtual machines on your system. Note the ID of the correct VM that should be loading. For example, `"foo_default_1405481857614_74478" {e492bfc3-cac2-4cde-a396-e81e37e421e2}`. The number within the curly brackets is the ID of the virtual machine.
|
2. Use the `$ VBoxManage list vms` command to view a list of the virtual machines on your system. Note the ID of the correct VM that should be loading. For example, `"foo_default_1405481857614_74478" {e492bfc3-cac2-4cde-a396-e81e37e421e2}`. The number within the curly brackets is the ID of the virtual machine.
|
||||||
3. Within the .vagrant directory in your project (it is hidden by default), update the ID within the machines/default/virtualbox/id file.
|
3. Within the .vagrant directory in your project (it is hidden by default), update the ID within the machines/default/virtualbox/id file.
|
||||||
4. Start the new VM with `$ vagrant up`.
|
4. Start the new VM with `$ vagrant up`.
|
||||||
|
|
|
@ -3,10 +3,10 @@ title: Updating Features and Adding Components Using Drush
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: updating-features-and-adding-components-using-drush
|
slug: updating-features-and-adding-components-using-drush
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- drush
|
- drush
|
||||||
- features
|
- features
|
||||||
---
|
---
|
||||||
If you use the [Features module](http://drupal.org/project/features) to manage your Drupal configuration, it can be time consuming to update features through the UI, especially if you are working on a remote server and need to keep downloading and uploading files.
|
If you use the [Features module](http://drupal.org/project/features) to manage your Drupal configuration, it can be time consuming to update features through the UI, especially if you are working on a remote server and need to keep downloading and uploading files.
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ To search for a component, use the `drush features-components` command. This wil
|
||||||
|
|
||||||
To filter further, you can also use the `grep` command to filter the results. For example, `drush features-components --not-exported field_base | grep foo`, would only return non-exported field bases containing the word "foo".
|
To filter further, you can also use the `grep` command to filter the results. For example, `drush features-components --not-exported field_base | grep foo`, would only return non-exported field bases containing the word "foo".
|
||||||
|
|
||||||
The result is a source and a component, separated by a colon. For example, `field_base:field_foo`.
|
The result is a source and a component, separated by a colon. For example, `field_base:field_foo`.
|
||||||
|
|
||||||
## Exporting the Feature
|
## Exporting the Feature
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ Once you have a list of the components that you need to add, you can export the
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
$ drush features-export -y myfeature field_base:field_foo field_instance:user-field_foo
|
$ drush features-export -y myfeature field_base:field_foo field_instance:user-field_foo
|
||||||
|
|
||||||
In this example, the base for field_boo and it's instance on the user object is being added to the "myfeature" feature.
|
In this example, the base for field_boo and it's instance on the user object is being added to the "myfeature" feature.
|
||||||
|
|
||||||
|
@ -46,4 +46,4 @@ Once finished, the feature is updated in it's original location, so there's no d
|
||||||
|
|
||||||
* [The Features project page on Drupal.org](http://www.drupal.org/project/features)
|
* [The Features project page on Drupal.org](http://www.drupal.org/project/features)
|
||||||
* [The "drush features-components" command](http://www.drushcommands.com/drush-6x/features/features-components)
|
* [The "drush features-components" command](http://www.drushcommands.com/drush-6x/features/features-components)
|
||||||
* [The "drush features-export" command](http://www.drushcommands.com/drush-6x/features/features-export)
|
* [The "drush features-export" command](http://www.drushcommands.com/drush-6x/features/features-export)
|
||||||
|
|
|
@ -4,54 +4,54 @@ nav: blog
|
||||||
description: How to use an SASS each loop to easily add multiple fonts to your CSS.
|
description: How to use an SASS each loop to easily add multiple fonts to your CSS.
|
||||||
slug: include-css-fonts-using-sass-each-loop
|
slug: include-css-fonts-using-sass-each-loop
|
||||||
tags:
|
tags:
|
||||||
- compass
|
- compass
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- fonts
|
- fonts
|
||||||
- sass
|
- sass
|
||||||
---
|
---
|
||||||
Using a file structure similar to this, organise your font files into directories, using the the font name for both the directory name and for the file names.
|
Using a file structure similar to this, organise your font files into directories, using the the font name for both the directory name and for the file names.
|
||||||
|
|
||||||
~~~~
|
~~~~
|
||||||
.
|
.
|
||||||
├── FuturaBold
|
├── FuturaBold
|
||||||
│ ├── FuturaBold.eot
|
│ ├── FuturaBold.eot
|
||||||
│ ├── FuturaBold.svg
|
│ ├── FuturaBold.svg
|
||||||
│ ├── FuturaBold.ttf
|
│ ├── FuturaBold.ttf
|
||||||
│ └── FuturaBold.woff
|
│ └── FuturaBold.woff
|
||||||
├── FuturaBoldItalic
|
├── FuturaBoldItalic
|
||||||
│ ├── FuturaBoldItalic.eot
|
│ ├── FuturaBoldItalic.eot
|
||||||
│ ├── FuturaBoldItalic.svg
|
│ ├── FuturaBoldItalic.svg
|
||||||
│ ├── FuturaBoldItalic.ttf
|
│ ├── FuturaBoldItalic.ttf
|
||||||
│ └── FuturaBoldItalic.woff
|
│ └── FuturaBoldItalic.woff
|
||||||
├── FuturaBook
|
├── FuturaBook
|
||||||
│ ├── FuturaBook.eot
|
│ ├── FuturaBook.eot
|
||||||
│ ├── FuturaBook.svg
|
│ ├── FuturaBook.svg
|
||||||
│ ├── FuturaBook.ttf
|
│ ├── FuturaBook.ttf
|
||||||
│ └── FuturaBook.woff
|
│ └── FuturaBook.woff
|
||||||
├── FuturaItalic
|
├── FuturaItalic
|
||||||
│ ├── FuturaItalic.eot
|
│ ├── FuturaItalic.eot
|
||||||
│ ├── FuturaItalic.svg
|
│ ├── FuturaItalic.svg
|
||||||
│ ├── FuturaItalic.ttf
|
│ ├── FuturaItalic.ttf
|
||||||
│ └── FuturaItalic.woff
|
│ └── FuturaItalic.woff
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
Within your SASS file, start an `@each` loop, listing the names of the fonts. In the same way as PHP's `foreach` loop, each font name will get looped through using the `$family` variable and then compiled into CSS.
|
Within your SASS file, start an `@each` loop, listing the names of the fonts. In the same way as PHP's `foreach` loop, each font name will get looped through using the `$family` variable and then compiled into CSS.
|
||||||
|
|
||||||
~~~~
|
~~~~
|
||||||
@each $family in FuturaBook, FuturaBold, FuturaBoldItalic, FuturaItalic {
|
@each $family in FuturaBook, FuturaBold, FuturaBoldItalic, FuturaItalic {
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: #{$family};
|
font-family: #{$family};
|
||||||
src: url('../fonts/#{$family}/#{$family}.eot');
|
src: url('../fonts/#{$family}/#{$family}.eot');
|
||||||
src: url('../fonts/#{$family}/#{$family}.eot?#iefix') format('embedded-opentype'),
|
src: url('../fonts/#{$family}/#{$family}.eot?#iefix') format('embedded-opentype'),
|
||||||
url('../fonts/#{$family}/#{$family}.woff') format('woff'),
|
url('../fonts/#{$family}/#{$family}.woff') format('woff'),
|
||||||
url('../fonts/#{$family}/#{$family}.ttf') format('truetype'),
|
url('../fonts/#{$family}/#{$family}.ttf') format('truetype'),
|
||||||
url('../fonts/#{$family}/#{$family}.svg##{$family}') format('svg');
|
url('../fonts/#{$family}/#{$family}.svg##{$family}') format('svg');
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
When the CSS has been compiled, you can then use in your CSS in the standard way.
|
When the CSS has been compiled, you can then use in your CSS in the standard way.
|
||||||
|
|
||||||
font-family: "FuturaBook";
|
font-family: "FuturaBook";
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
title: Using Remote Files when Developing Locally with Stage File Proxy Module
|
title: Using Remote Files when Developing Locally with Stage File Proxy Module
|
||||||
nav: blog
|
nav: blog
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- servers
|
- servers
|
||||||
---
|
---
|
||||||
Download the [Stage File Proxy](https://www.drupal.org/project/stage_file_proxy) module from Drupal.org and enable it on your site.
|
Download the [Stage File Proxy](https://www.drupal.org/project/stage_file_proxy) module from Drupal.org and enable it on your site.
|
||||||
|
|
||||||
|
@ -25,4 +25,4 @@ If the origin site is not publicly accessible yet, maybe it's a pre-live or stag
|
||||||
|
|
||||||
~~~php
|
~~~php
|
||||||
$conf['stage_file_proxy_origin'] = 'http://user:password@prelive.example.com';
|
$conf['stage_file_proxy_origin'] = 'http://user:password@prelive.example.com';
|
||||||
~~~
|
~~~
|
||||||
|
|
|
@ -3,10 +3,10 @@ title: Include environment-specific settings files on Pantheon
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: pantheon-settings-files
|
slug: pantheon-settings-files
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- pantheon
|
- pantheon
|
||||||
- settings.php
|
- settings.php
|
||||||
---
|
---
|
||||||
I was recently doing some work on a site hosted on [Pantheon](http://getpantheon.com) and came across an issue, for which part of the suggested fix was to ensure that the `$base_url` variable was explicitly defined within settings.php (this is also best practice on all Drupal sites).
|
I was recently doing some work on a site hosted on [Pantheon](http://getpantheon.com) and came across an issue, for which part of the suggested fix was to ensure that the `$base_url` variable was explicitly defined within settings.php (this is also best practice on all Drupal sites).
|
||||||
|
|
||||||
|
@ -14,22 +14,22 @@ The way that was recommended was by using a `switch()` function based on Pantheo
|
||||||
|
|
||||||
~~~php
|
~~~php
|
||||||
switch ($_SERVER['PANTHEON_ENVIRONMENT']) {
|
switch ($_SERVER['PANTHEON_ENVIRONMENT']) {
|
||||||
case 'dev':
|
case 'dev':
|
||||||
// Development environment.
|
// Development environment.
|
||||||
$base_url = 'dev-my-site.gotpantheon.com';
|
$base_url = 'dev-my-site.gotpantheon.com';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case 'test':
|
case 'test':
|
||||||
// Testing environment.
|
// Testing environment.
|
||||||
$base_url = 'test-my-site.gotpantheon.com';
|
$base_url = 'test-my-site.gotpantheon.com';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case 'live':
|
case 'live':
|
||||||
// Production environment.
|
// Production environment.
|
||||||
$base_url = 'live-my-site.gotpantheon.com';
|
$base_url = 'live-my-site.gotpantheon.com';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
@ -41,17 +41,17 @@ To do this, add the following code to the bottom of settings.php:
|
||||||
|
|
||||||
~~~php
|
~~~php
|
||||||
if (isset($_SERVER['PANTHEON_ENVIRONMENT'])) {
|
if (isset($_SERVER['PANTHEON_ENVIRONMENT'])) {
|
||||||
if ($_SERVER['PANTHEON_ENVIRONMENT'] != 'live') {
|
if ($_SERVER['PANTHEON_ENVIRONMENT'] != 'live') {
|
||||||
// You can still add things here, for example to apply to all sites apart
|
// You can still add things here, for example to apply to all sites apart
|
||||||
// from production. Mail reroutes, caching settings etc.
|
// from production. Mail reroutes, caching settings etc.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include an environment-specific settings file, for example
|
// Include an environment-specific settings file, for example
|
||||||
// settings.dev.php, if one exists.
|
// settings.dev.php, if one exists.
|
||||||
$environment_settings = __DIR__ . '/settings.' . $_SERVER['PANTHEON_ENVIRONMENT'] . '.php';
|
$environment_settings = __DIR__ . '/settings.' . $_SERVER['PANTHEON_ENVIRONMENT'] . '.php';
|
||||||
if (file_exists($environment_settings)) {
|
if (file_exists($environment_settings)) {
|
||||||
include $environment_settings;
|
include $environment_settings;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
@ -78,4 +78,4 @@ Within the sites/default directory, I also include an example file (example.sett
|
||||||
$base_url = '';
|
$base_url = '';
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
The environment specific files are also committed into Git and pushed to Pantheon, and are then included automatically on each environment.
|
The environment specific files are also committed into Git and pushed to Pantheon, and are then included automatically on each environment.
|
||||||
|
|
|
@ -3,19 +3,19 @@ title: Include a Local Drupal Settings file for Environment Configuration and Ov
|
||||||
nav: blog
|
nav: blog
|
||||||
slug: include-local-drupal-settings-file-environment-configuration-and-overrides
|
slug: include-local-drupal-settings-file-environment-configuration-and-overrides
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- drupal-7
|
- drupal-7
|
||||||
- drupal-8
|
- drupal-8
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- settings.php
|
- settings.php
|
||||||
---
|
---
|
||||||
At the bottom of settings.php, add the following code:
|
At the bottom of settings.php, add the following code:
|
||||||
|
|
||||||
~~~php
|
~~~php
|
||||||
$local_settings = __DIR__ . '/settings.local.php';
|
$local_settings = __DIR__ . '/settings.local.php';
|
||||||
if (file_exists($local_settings)) {
|
if (file_exists($local_settings)) {
|
||||||
include $local_settings;
|
include $local_settings;
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ Environment specific settings like `$databases` and `$base_url` can be placed wi
|
||||||
|
|
||||||
settings.php though is ignored by default by Git by a .gitignore file, so it won't show up as a file available to be committed. There are two ways to fix this. The first is to use the `--force` option when adding the file which overrides the ignore file:
|
settings.php though is ignored by default by Git by a .gitignore file, so it won't show up as a file available to be committed. There are two ways to fix this. The first is to use the `--force` option when adding the file which overrides the ignore file:
|
||||||
|
|
||||||
git add --force sites/default/settings.php
|
git add --force sites/default/settings.php
|
||||||
|
|
||||||
The other option is to update the .gitignore file itself so that settings.php is no longer ignored. An updated .gitignore file could look like:
|
The other option is to update the .gitignore file itself so that settings.php is no longer ignored. An updated .gitignore file could look like:
|
||||||
|
|
||||||
|
@ -38,4 +38,4 @@ sites/*/files
|
||||||
sites/*/private
|
sites/*/private
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
This will allow for settings.php to be added to Git and committed, but not settings.local.php.
|
This will allow for settings.php to be added to Git and committed, but not settings.local.php.
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
title: Configuring the Reroute Email Module
|
title: Configuring the Reroute Email Module
|
||||||
nav: blog
|
nav: blog
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-6
|
- drupal-6
|
||||||
- drupal-7
|
- drupal-7
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
- email
|
- email
|
||||||
draft: true
|
draft: true
|
||||||
---
|
---
|
||||||
[Reroute Email](https://www.drupal.org/project/reroute_email) module uses `hook_mail_alter()` to prevent emails from being sent to users from non-production sites. It allows you to enter one or more email addresses that will receive the emails instead of delivering them to the original user.
|
[Reroute Email](https://www.drupal.org/project/reroute_email) module uses `hook_mail_alter()` to prevent emails from being sent to users from non-production sites. It allows you to enter one or more email addresses that will receive the emails instead of delivering them to the original user.
|
||||||
|
@ -39,10 +39,10 @@ If you want to add multiple addresses, these should be added in a semicolon-deli
|
||||||
|
|
||||||
~~~php
|
~~~php
|
||||||
$conf['reroute_email_address'] = implode(';', array(
|
$conf['reroute_email_address'] = implode(';', array(
|
||||||
'person1@example.com',
|
'person1@example.com',
|
||||||
'person2@example.com',
|
'person2@example.com',
|
||||||
'person3@example.com',
|
'person3@example.com',
|
||||||
));
|
));
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
In this example, person2@example.com and person3@example.com would receive their emails from the site as normal. Any emails to addresses not in the array would continue to be redirected to person1@example.com.
|
In this example, person2@example.com and person3@example.com would receive their emails from the site as normal. Any emails to addresses not in the array would continue to be redirected to person1@example.com.
|
||||||
|
|
|
@ -3,9 +3,9 @@ title: 2014
|
||||||
description: A look back at 2014.
|
description: A look back at 2014.
|
||||||
nav: blog
|
nav: blog
|
||||||
tags:
|
tags:
|
||||||
- drupal-association
|
- drupal-association
|
||||||
- drupalcamp-london
|
- drupalcamp-london
|
||||||
- personal
|
- personal
|
||||||
tweets: true
|
tweets: true
|
||||||
---
|
---
|
||||||
A lot happened in 2014. Here are some of the main things that I'd like to highlight:
|
A lot happened in 2014. Here are some of the main things that I'd like to highlight:
|
||||||
|
|
|
@ -3,14 +3,14 @@ title: How to Define a Minimum Drupal Core Version
|
||||||
description: How to define a minimum Drupal core version for your module or theme.
|
description: How to define a minimum Drupal core version for your module or theme.
|
||||||
nav: blog
|
nav: blog
|
||||||
tags:
|
tags:
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-7
|
- drupal-7
|
||||||
- drupal-planet
|
- drupal-planet
|
||||||
meta:
|
meta:
|
||||||
og:
|
og:
|
||||||
title: 'How to Define a Minimum Drupal Core Version'
|
title: 'How to Define a Minimum Drupal Core Version'
|
||||||
description: 'How to define a minimum Drupal core version for your module or theme.'
|
description: 'How to define a minimum Drupal core version for your module or theme.'
|
||||||
type: article
|
type: article
|
||||||
---
|
---
|
||||||
This week, my first code patch was [committed to Drupal core](https://www.drupal.org/node/2394517#comment-9773143). The patch adds the `user_has_role()` function to the user module, to simplify the way to check whether a user in Drupal has been assigned a specific role. This is something that I normally write a custom function for each project, but it's now available in Drupal core as of [7.36](https://www.drupal.org/drupal-7.36-release-notes).
|
This week, my first code patch was [committed to Drupal core](https://www.drupal.org/node/2394517#comment-9773143). The patch adds the `user_has_role()` function to the user module, to simplify the way to check whether a user in Drupal has been assigned a specific role. This is something that I normally write a custom function for each project, but it's now available in Drupal core as of [7.36](https://www.drupal.org/drupal-7.36-release-notes).
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ What I'm going to be doing for my contrib projects is defining a minimum version
|
||||||
|
|
||||||
You can define a simple dependency for your module by adding a line this this to your project's .info file:
|
You can define a simple dependency for your module by adding a line this this to your project's .info file:
|
||||||
|
|
||||||
dependencies[] = views
|
dependencies[] = views
|
||||||
|
|
||||||
This would make your module dependant on having the [Views](https://www.drupal.org/project/views) module present and enabled, which you'd need if you were including views as part of your module, for example.
|
This would make your module dependant on having the [Views](https://www.drupal.org/project/views) module present and enabled, which you'd need if you were including views as part of your module, for example.
|
||||||
|
|
||||||
|
@ -34,12 +34,12 @@ This would make your module dependant on having the [Views](https://www.drupal.o
|
||||||
|
|
||||||
In the previous example, our module would enable if _any_ version of Views was enabled, but we need to specify a specific version. We can do this by including version numbers within the dependencies field in the following format:
|
In the previous example, our module would enable if _any_ version of Views was enabled, but we need to specify a specific version. We can do this by including version numbers within the dependencies field in the following format:
|
||||||
|
|
||||||
dependencies[] = modulename (major.minor)
|
dependencies[] = modulename (major.minor)
|
||||||
|
|
||||||
This can be a for a specific module release or a branch name:
|
This can be a for a specific module release or a branch name:
|
||||||
|
|
||||||
dependencies[] = modulename (1.0)
|
dependencies[] = modulename (1.0)
|
||||||
dependencies[] = modulename (1.x)
|
dependencies[] = modulename (1.x)
|
||||||
|
|
||||||
We can also use the following as part of the field for extra granularity:
|
We can also use the following as part of the field for extra granularity:
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ We can also use the following as part of the field for extra granularity:
|
||||||
|
|
||||||
In the original scenario, we want to specify that the module can only be enabled on Drupal core 7.36 or later. To do this, we can use the "greater than or equal to" option.
|
In the original scenario, we want to specify that the module can only be enabled on Drupal core 7.36 or later. To do this, we can use the "greater than or equal to" option.
|
||||||
|
|
||||||
dependencies[] = system (>=7.36)
|
dependencies[] = system (>=7.36)
|
||||||
|
|
||||||
Because we need to check for Drupal's core version, we're using the system module as the dependency and specifying that it needs to be either equal to or greater than 7.36. If this dependency is not met, e.g. Drupal 7.35 is being used, then the module cannot be enabled rather than showing a function not found error for `user_has_role()` when it is called.
|
Because we need to check for Drupal's core version, we're using the system module as the dependency and specifying that it needs to be either equal to or greater than 7.36. If this dependency is not met, e.g. Drupal 7.35 is being used, then the module cannot be enabled rather than showing a function not found error for `user_has_role()` when it is called.
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,11 @@ title: LDAP Integration with Drupal
|
||||||
location: South Wales Drupal User Group
|
location: South Wales Drupal User Group
|
||||||
description: An overview of the Drupal LDAP module and how I customised it for a client project.
|
description: An overview of the Drupal LDAP module and how I customised it for a client project.
|
||||||
tags:
|
tags:
|
||||||
- user-group
|
- user-group
|
||||||
- drupal
|
- drupal
|
||||||
- ldap
|
- ldap
|
||||||
meta:
|
meta:
|
||||||
description: 'Integrating Drupal with LDAP.'
|
description: 'Integrating Drupal with LDAP.'
|
||||||
nav: talks
|
nav: talks
|
||||||
---
|
---
|
||||||
An overview of the [Drupal LDAP module](https://www.drupal.org/project/ldap) and how I integrated and customised it for a client project.
|
An overview of the [Drupal LDAP module](https://www.drupal.org/project/ldap) and how I integrated and customised it for a client project.
|
||||||
|
|
|
@ -5,13 +5,13 @@ description: <a href="/blog/what-git-flow">Never Commit to Master</a>: An Introd
|
||||||
slides: https://speakerdeck.com/opdavies/never-commit-to-master-an-introduction-to-git-flow
|
slides: https://speakerdeck.com/opdavies/never-commit-to-master-an-introduction-to-git-flow
|
||||||
slides_embed: <script async class="speakerdeck-embed" data-id="201559e0f103013198dd5a5f6f23ab67" data-ratio="1.29456384323641" src="//speakerdeck.com/assets/embed.js"></script>
|
slides_embed: <script async class="speakerdeck-embed" data-id="201559e0f103013198dd5a5f6f23ab67" data-ratio="1.29456384323641" src="//speakerdeck.com/assets/embed.js"></script>
|
||||||
tags:
|
tags:
|
||||||
- conference
|
- conference
|
||||||
- drupalcamp
|
- drupalcamp
|
||||||
- drupalcamp-london
|
- drupalcamp-london
|
||||||
- git
|
- git
|
||||||
- git-flow
|
- git-flow
|
||||||
meta:
|
meta:
|
||||||
description:
|
description:
|
||||||
slug: git-flow
|
slug: git-flow
|
||||||
nav: talks
|
nav: talks
|
||||||
---
|
---
|
||||||
|
|
|
@ -5,12 +5,12 @@ description: <a href="/blog/drush-make-drupalbristol">drush make drupalbristol</
|
||||||
slides: https://speakerdeck.com/opdavies/drush-make-drupalbristol
|
slides: https://speakerdeck.com/opdavies/drush-make-drupalbristol
|
||||||
slides_embed: <script async class="speakerdeck-embed" data-id="42605700f102013198de5a5f6f23ab67" data-ratio="1.29456384323641" src="//speakerdeck.com/assets/embed.js"></script>
|
slides_embed: <script async class="speakerdeck-embed" data-id="42605700f102013198de5a5f6f23ab67" data-ratio="1.29456384323641" src="//speakerdeck.com/assets/embed.js"></script>
|
||||||
tags:
|
tags:
|
||||||
- user-group
|
- user-group
|
||||||
- drupal
|
- drupal
|
||||||
- drush
|
- drush
|
||||||
- drush-make
|
- drush-make
|
||||||
meta:
|
meta:
|
||||||
description: 'An introduction to Drush and Drush Make.'
|
description: 'An introduction to Drush and Drush Make.'
|
||||||
nav: talks
|
nav: talks
|
||||||
---
|
---
|
||||||
An introduction to Drush and Drush Make.
|
An introduction to Drush and Drush Make.
|
||||||
|
|
|
@ -3,11 +3,11 @@ title: About the Drupal Association
|
||||||
location: South Wales Drupal User Group
|
location: South Wales Drupal User Group
|
||||||
description: An impromptu talk about the <a href="https://assoc.drupal.org">Drupal Association</a> and I've done there since joining the team.
|
description: An impromptu talk about the <a href="https://assoc.drupal.org">Drupal Association</a> and I've done there since joining the team.
|
||||||
tags:
|
tags:
|
||||||
- user-group
|
- user-group
|
||||||
- drupal-association
|
- drupal-association
|
||||||
meta:
|
meta:
|
||||||
description: "An impromptu talk about the Drupal Association and I've done there since joining the team."
|
description: "An impromptu talk about the Drupal Association and I've done there since joining the team."
|
||||||
slug: drupal-association
|
slug: drupal-association
|
||||||
nav: talks
|
nav: talks
|
||||||
---
|
---
|
||||||
An impromptu talk about the [Drupal Association](https://assoc.drupal.org) and I've done there since joining the team.
|
An impromptu talk about the [Drupal Association](https://assoc.drupal.org) and I've done there since joining the team.
|
||||||
|
|
|
@ -4,12 +4,12 @@ location: <a href="http://www.drupalcampbrighton.co.uk/drupalcamp-brighton-2015/
|
||||||
date: 2015-01-18
|
date: 2015-01-18
|
||||||
description: Drupal.org in 2015: What's coming next?
|
description: Drupal.org in 2015: What's coming next?
|
||||||
tags:
|
tags:
|
||||||
- conference
|
- conference
|
||||||
- drupalcamp
|
- drupalcamp
|
||||||
- drupalcamp-brighton
|
- drupalcamp-brighton
|
||||||
- drupalorg
|
- drupalorg
|
||||||
meta:
|
meta:
|
||||||
description: 'Everything that you wanted to know about Drupal 8 in ten minutes, but were afraid to ask!'
|
description: 'Everything that you wanted to know about Drupal 8 in ten minutes, but were afraid to ask!'
|
||||||
slug: drupalorg-2015
|
slug: drupalorg-2015
|
||||||
nav: talks
|
nav: talks
|
||||||
---
|
---
|
||||||
|
|
|
@ -4,12 +4,12 @@ location: <a href="http://2015.drupalcamplondon.co.uk">DrupalCamp London</a>
|
||||||
date: 2015-02-28
|
date: 2015-02-28
|
||||||
description: Drupal.org in 2015: What's coming next?
|
description: Drupal.org in 2015: What's coming next?
|
||||||
tags:
|
tags:
|
||||||
- conference
|
- conference
|
||||||
- drupalcamp
|
- drupalcamp
|
||||||
- drupalcamp-london
|
- drupalcamp-london
|
||||||
- drupalorg
|
- drupalorg
|
||||||
meta:
|
meta:
|
||||||
description: 'Everything that you wanted to know about Drupal 8 in ten minutes, but were afraid to ask!'
|
description: 'Everything that you wanted to know about Drupal 8 in ten minutes, but were afraid to ask!'
|
||||||
slug: drupalorg-2015
|
slug: drupalorg-2015
|
||||||
nav: talks
|
nav: talks
|
||||||
---
|
---
|
||||||
|
|
|
@ -6,12 +6,12 @@ description: <a href="https://speakerdeck.com/opdavies/drupal-8">Drupal 8</a> (l
|
||||||
slides: https://speakerdeck.com/opdavies/drupal-8
|
slides: https://speakerdeck.com/opdavies/drupal-8
|
||||||
slides_embed: <script async class="speakerdeck-embed" data-id="46ba4ba577d94a32b7abdade610ceb69" data-ratio="1.29456384323641" src="//speakerdeck.com/assets/embed.js"></script>
|
slides_embed: <script async class="speakerdeck-embed" data-id="46ba4ba577d94a32b7abdade610ceb69" data-ratio="1.29456384323641" src="//speakerdeck.com/assets/embed.js"></script>
|
||||||
tags:
|
tags:
|
||||||
- meetup
|
- meetup
|
||||||
- phpsw
|
- phpsw
|
||||||
- drupal
|
- drupal
|
||||||
- drupal-8
|
- drupal-8
|
||||||
meta:
|
meta:
|
||||||
description: 'Everything that you wanted to know about Drupal 8 in ten minutes, but were afraid to ask!'
|
description: 'Everything that you wanted to know about Drupal 8 in ten minutes, but were afraid to ask!'
|
||||||
slug: drupal-8
|
slug: drupal-8
|
||||||
nav: talks
|
nav: talks
|
||||||
---
|
---
|
||||||
|
|
|
@ -2,9 +2,9 @@ source 'https://rubygems.org'
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
|
|
||||||
gem "sass"
|
gem "sass"
|
||||||
gem "sass-globbing"
|
gem "sass-globbing"
|
||||||
gem "bootstrap-sass"
|
gem "bootstrap-sass"
|
||||||
gem "compass"
|
gem "compass"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,41 +1,41 @@
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
autoprefixer-rails (5.1.8)
|
autoprefixer-rails (5.1.8)
|
||||||
execjs
|
execjs
|
||||||
json
|
json
|
||||||
bootstrap-sass (3.3.4.1)
|
bootstrap-sass (3.3.4.1)
|
||||||
autoprefixer-rails (>= 5.0.0.1)
|
autoprefixer-rails (>= 5.0.0.1)
|
||||||
sass (>= 3.2.19)
|
sass (>= 3.2.19)
|
||||||
chunky_png (1.3.4)
|
chunky_png (1.3.4)
|
||||||
compass (1.0.3)
|
compass (1.0.3)
|
||||||
chunky_png (~> 1.2)
|
chunky_png (~> 1.2)
|
||||||
compass-core (~> 1.0.2)
|
compass-core (~> 1.0.2)
|
||||||
compass-import-once (~> 1.0.5)
|
compass-import-once (~> 1.0.5)
|
||||||
rb-fsevent (>= 0.9.3)
|
rb-fsevent (>= 0.9.3)
|
||||||
rb-inotify (>= 0.9)
|
rb-inotify (>= 0.9)
|
||||||
sass (>= 3.3.13, < 3.5)
|
sass (>= 3.3.13, < 3.5)
|
||||||
compass-core (1.0.3)
|
compass-core (1.0.3)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
sass (>= 3.3.0, < 3.5)
|
sass (>= 3.3.0, < 3.5)
|
||||||
compass-import-once (1.0.5)
|
compass-import-once (1.0.5)
|
||||||
sass (>= 3.2, < 3.5)
|
sass (>= 3.2, < 3.5)
|
||||||
execjs (2.4.0)
|
execjs (2.4.0)
|
||||||
ffi (1.9.8)
|
ffi (1.9.8)
|
||||||
json (1.8.2)
|
json (1.8.2)
|
||||||
multi_json (1.11.0)
|
multi_json (1.11.0)
|
||||||
rb-fsevent (0.9.4)
|
rb-fsevent (0.9.4)
|
||||||
rb-inotify (0.9.5)
|
rb-inotify (0.9.5)
|
||||||
ffi (>= 0.5.0)
|
ffi (>= 0.5.0)
|
||||||
sass (3.4.13)
|
sass (3.4.13)
|
||||||
sass-globbing (1.1.1)
|
sass-globbing (1.1.1)
|
||||||
sass (>= 3.1)
|
sass (>= 3.1)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
bootstrap-sass
|
bootstrap-sass
|
||||||
compass
|
compass
|
||||||
sass
|
sass
|
||||||
sass-globbing
|
sass-globbing
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
body {
|
body {
|
||||||
padding-top: 60px;
|
padding-top: 60px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
dt {
|
dt {
|
||||||
margin-top: .5em;
|
margin-top: .5em;
|
||||||
|
|
||||||
&:after {
|
&:after {
|
||||||
content: ':';
|
content: ':';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dd {
|
dd {
|
||||||
padding-left: 2em;
|
padding-left: 2em;
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue