Trailing and extra spaces
This commit is contained in:
parent
74de62ca7e
commit
49d5cbbf48
|
@ -14,9 +14,9 @@ tags:
|
|||
|
||||
In preparation for my Blog posts being added to [Drupal Planet](http://drupal.org/planet), I needed to create a new Taxonomy term (or, in this case, tag) called 'Drupal Planet', and assign it to new content to imported into their aggregator. After taking a quick look though my previous posts, I decided that 14 of my previous posts were relevant, and thought that it would be useful to also assign these the 'Drupal Planet' tag.
|
||||
|
||||
I didn't want to manually open each post and add the new tag, so I decided to make the changes myself directly into the database using SQL, and as a follow-up to a previous post - [Quickly Change the Content Type of Multiple Nodes using SQL](/blog/change-content-type-multiple-nodes-using-sql).
|
||||
I didn't want to manually open each post and add the new tag, so I decided to make the changes myself directly into the database using SQL, and as a follow-up to a previous post - [Quickly Change the Content Type of Multiple Nodes using SQL](/blog/change-content-type-multiple-nodes-using-sql/).
|
||||
|
||||
**Again, before changing any values within the database, ensure that you have an up-to-date backup which you can restore if you encounter a problem!**
|
||||
**Again, before changing any values within the database, ensure that you have an up-to-date backup which you can restore if you encounter a problem!**
|
||||
|
||||
The first thing I did was create the 'Drupal Planet' term in my Tags vocabulary. I decided to do this via the administration area of my site, and not via the database. Then, using [Sequel Pro](http://www.sequelpro.com), I ran the following SQL query to give me a list of Blog posts on my site - showing just their titles and nid values.
|
||||
|
||||
|
@ -27,13 +27,13 @@ SELECT title, nid FROM node WHERE TYPE = 'blog' ORDER BY title ASC;
|
|||
I made a note of the nid's of the returned nodes, and kept them for later. I then ran a similar query against the term_data table. This returned a list of Taxonomy terms - showing the term's name, and it's unique tid value.
|
||||
|
||||
~~~sql
|
||||
SELECT NAME, tid FROM term_data ORDER BY NAME ASC;
|
||||
SELECT NAME, tid FROM term_data ORDER BY NAME ASC;
|
||||
~~~
|
||||
|
||||
The term that I was interested in, Drupal Planet, had the tid of 84. To confirm that no nodes were already assigned a taxonomy term with this tid, I ran another query against the database. I'm using aliases within this query to link the node, term_node and term_data tables. For more information on SQL aliases, take a look at <http://w3schools.com/sql/sql_alias.asp>.
|
||||
|
||||
~~~sql
|
||||
SELECT * FROM node n, term_data td, term_node tn WHERE td.tid = 84 AND n.nid = tn.nid AND tn.tid = td.tid;
|
||||
SELECT * FROM node n, term_data td, term_node tn WHERE td.tid = 84 AND n.nid = tn.nid AND tn.tid = td.tid;
|
||||
~~~
|
||||
|
||||
As expected, it returned no rows.
|
||||
|
|
|
@ -17,7 +17,7 @@ Recently, I converted a client's static HTML website, along with their Coppermin
|
|||
|
||||
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.
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ slug: create-better-photo-gallery-drupal-part-21
|
|||
tags:
|
||||
- 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:
|
||||
|
||||
~~~php
|
||||
<?php
|
||||
|
|
|
@ -10,7 +10,7 @@ tags:
|
|||
- regular-expression
|
||||
- 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.
|
||||
|
||||
~~~sql
|
||||
SELECT nid, nid FROM node WHERE TYPE = 'blog' ORDER BY nid ASC;
|
||||
|
|
|
@ -6,4 +6,4 @@ tags:
|
|||
- drupal-association
|
||||
- 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.
|
|
@ -21,7 +21,7 @@ Oliver Davies is a senior level Web Developer and System Administrator based in
|
|||
|
||||
Oliver currently works for the [Drupal Association](https://assoc.drupal.org) and also provides freelance consultancy services for Drupal websites and Linux servers.
|
||||
|
||||
In his spare time, Oliver contributes to Drupal core and maintains several modules on Drupal.org, is the Git Documentation Maintainer for the Drupal project, and is a provisional member of the [Drupal Security team](https://www.drupal.org/security-team). He attends, organises and [talks](/talks) at user groups, and volunteers and mentors at conferences. He also is a 2nd Degree Black Belt in Tae Kwon-Do and a Brazilian Jiu-Jitsu practitioner.
|
||||
In his spare time, Oliver contributes to Drupal core and maintains several modules on Drupal.org, is the Git Documentation Maintainer for the Drupal project, and is a provisional member of the [Drupal Security team](https://www.drupal.org/security-team). He attends, organises and [talks](/talks/) at user groups, and volunteers and mentors at conferences. He also is a 2nd Degree Black Belt in Tae Kwon-Do and a Brazilian Jiu-Jitsu practitioner.
|
||||
|
||||
Oliver has active social media profiles on <a href="{{ site.twitter }}">Twitter</a> and <a href="{{ site.linkedin }}">LinkedIn</a>, and you can view his code on
|
||||
<a href="{{ site.drupalorg }}/track/code">Drupal.org</a> and <a href="{{ site.github }}?tab=activity">GitHub</a>.
|
||||
|
|
Reference in a new issue