Work in Progress: It’s finally working

So I ran into a lot of trouble on my pet project Drupal site these last few days. I finally managed to solve one of my issues after two days of researching the issue: in order to show a backlinks tab (what references this node) on a particular node, I had to set the path to be /node/%/references. Then in the Arguments (which are now called contextual references in Drupal 7), I had to set it to NID. I will do a write-up later of my View which is using the Entity Reference module to make the connection between nodes.

The Relation module slowed me down for a day and a half. The prospect is promising: instead of just making a vague reference from Node A to Node B (oh, yeah: also in Drupal 7, the different pieces of a website — comments, nodes, etc. — are called entities), you make a new connective entity (a relation) between the two nodes. So now you’d have Node A –> Relation –> Node B. On the relation, you can add other fields. I was thinking that I could turn my relation into a family-like page so I could include stuff like how many children Person A had with Person B. Or if they ever married, if so, where and for how long? I watched several tutorials before finding one that promised if I used the Dummy Relation Widget, I could print out the Relation info + all those extra rich fields on Node A and Node B. Yes! Yes! How exciting!

An hour later I realized that the Dummy Relation widget had been broken and/or the working components had been removed months prior — according to the issues filed. I could make the Relation but when I visited this newly created entity, the “page” was broken. This meant I could not pull the data back out. So, there seems to be a lot of high hopes for this module, but at the current time it is useless.

So, I ended up staying up far too late last night and added the forty or so characters to my website. Did I mention that the point of this website is to be a character database repository — the same thing I was looking for last week? :-)

Work in Progress: Day 2

I added a couple new modules (Conditional Fields and Multiselect) to help with entering data into the website. I then struggled all day with a particular issue that I needed the URL to be only one word but needed to display on the page the entire contents of the field. I created a new tpl.php file and eventually managed to figure out how to print the contents of the field I needed:

but I could not get this code to override the title on the page. This code would only show up in the body. I then tried with the Display Suite model, but no dice. I posted on a few forums online with no luck either. Finally, I decided to create two fields — one for the full length for the title and then another whose single word content I plug into URL aliases. It’s far from an ideal solution, but it was the best that I could come up with.

Work in Progress: New Drupal 7 Website

Evernote’s Clip toolbar thing is not working well, so I decided to document the resources I’m using to build my new website here. The things I am looking to accomplish:

  • Have a node for each article which links to the people mentioned in the article (with backlinks from the person to each article they are mentioned in).
  • Create individual profile pages for each person which will include these fields: Name, Bio, Race, Description, Parents, Siblings, Partners, Children, list of all articles they are mentioned in, and photos.
  • Short story collection which is tagged to the correct person (just like article).
  • Use the diff module to see what changes are made to each node.
  • Wiki-like tools so that hyperlinking to pages is easier. DONE
  • Auto link people’s names to their profile page. DONE with the use of Alinks.

Issues I’ve been investigating:
Backlinking between nodes
Reverse node reference
Creating relationships between people (parent to child, etc.) — this prevents the fields from showing in Views so I cannot manipulate the appearance of fields. It’s cool how you can show ancestors and decedents, but there is no way to show siblings. I also need to be able to customize relationship types since the ones present were too restricting.

Issues with setting up Drupal 7:
1&1 issue that I had to fix with a bit of code to the .htacess
1&1 issue with Clean URLs
Posted for help in figuring out if I can choose which content type a freelink goes to.

Modules installed:
Alink
Automatic Nodetitle
Backup and Migrate
Ctools
Diff
Entity Reference
Entity API
Freelinking
Pathauto
Talk
Token
Views
Wikitools

Resources:

To create automatic node titles so that only the first word shows as the title (which will make linking in Alinks super easy since you only need to enter the first name of the person):
First, download Automatic Nodetitles and enable it.
Second, in your selected content type, create the field which will be replacing the title field. In my example, it is called xyz9990 so I enter that in the bold section of code.
Then on your content type, select Automatically generate the title and hide the title field and then enter the below code:


field_xyz9990[$node->language][0]['value'];

$text = strip_tags($text);
$words = str_word_count($text, 2);
$pos = array_keys($words);
if (count($words) > $limit) {
$text = substr( $text, 0, $pos[$limit]);
$text = trim( $text );
$text = rtrim( $text, '.' );
}

return $text;
?>

Make sure to check off the Evaluate PHP in pattern box.

Theme Ideas:
Twitter Bootstrap for Drupal

Things to consider:
What will the Conversation title field be? — Make sure to change it back since it is currently the sample Automatic Nodetitle example from above.
When configuring the freelinking module, you need to make sure to specify the relative path.
A wiki might not be what I’m after since they’re wanting to create other wiki pages instead of linking to other node types.
To create a revision, you need to check off on the revision tab in your node to make a node that you’re making a revision. This is not auto like in WordPress.

Quick Note

It’s been a very busy week at work as I’ve gotten to indulge in putting together new IA for the library’s website. I met with two people from the children’s department yesterday and by the end of the meeting, I had an idea of what the front of their section will now look like. Yes! I wrote up a “contract” of sorts listing what they need to do and what I need to do to move us towards getting their new site design done. Hopeful deadline is May 25th then I’ll put up their new site that weekend.

In the evenings I’ve been hurrying to finish up reading a 7 day checkout book, The Snow Child, and finish scanning my friend’s artwork. We’re over 10 GB worth of material now scanned mostly in grayscale at 600 dpi in TIFF and JPEG formats.

Now off to a morning of digital signage (I found a new place to put them!) and teaching someone about FTP.

Create Profile Page with Related Nodes in Views – Part One

A request that came in from the Library staff was for an archival view showing all posts related to a speaker. In the current setup, you can only find the posts by doing a general search on the website. What I wanted to create were these content types and have them show up on the same page together: speaker, events, and videos. To make these content types work in Drupal 6 similar to what I have you will need to have these modules installed: CCK, Node Reference URL Widget, Node Reference, Imagefield, ImageAPI (I use the ImageAPI GD2 in the modules list), ImageCache (I use the ImageAPI GD2), Views, and Views attach. Make sure to give yourself permissions for each module and configure the Imagecache to create the proper image sizes for your needs. I created thumbnail, small, medium, and large based upon the sizes we were using in a Javascript function already. I am also using Display Suite, Node Display, and Views Display to make theming easy. Make sure to set up your URL aliases and custom breadcrumbs as well per content type!

If a field within a section (e.g. Basic settings) is not mentioned here, leave it at the default).
The content types:

Speaker

  • Change default title and body to Name and Biography.
  • Add the field Photo with a type of File. Configure as needed.

Event

  • Add the fields Speaker with a Node Reference to speaker (This excellent video from Mustardseed Media will explain how to do it!).
  • Add another Photo field.

Video

  • Add the fields Speaker with a Node Reference to speaker.
  • Add a second Node Reference to the Event field (note: I am having trouble getting the video link to show up on the Event field).

Create the Views:
Make a node View. You will now make several displays. Remember that after making the Default display, on any other display, you will need to Override everything. So I will go through each of the displays with their fields.

Defaults
Basic Settings
Title: Speaker Profile (will show up to the users).
Link display: Speaker Individual Page

Relationships
Content: Speaker (Label: Page Reference)

Arguments
Node: Nid
Action to take if argument is not present: Hide view/Page not found (404)

Fields
Node: Title
Content: Photo (Generic files with a Widget Label of Photo — probably not a good thing to set here, but this is my setup)

Sort criteria
Node: title (asc)

Filters
Node: Published (yes)
Node: Type = Speaker


Speaker Individual Page — Page Display
Basic Settings
Name: Speaker Individual Page (for my usage on the backend so I can see which display is which)
Title: Speaker Profile (will show up to the users).
Items to display: 1

Page settings
Path: ____ (set whatever URL you want. Mine is set to events/speakers/% with the percent sign representing an individual speaker. Use the % !!!).

Relationships
Content: Speaker (Label: Page Reference)

Arguments
Node: Nid (Action to take if argument is not present: Hide view/Page not found (404))

Fields
Node: Title
Content: Photo (large image)
Node: Body (remove label)

Sort criteria
Node: title (asc)

Filters
Node: Published (yes)
Node: Type = Speaker


All Speakers — Page Display
Basic Settings
Name: All Speakers
Title: Speaker Profiles (will show up to the users).
Style: Grid
Items to display: 20
Use pager: Yes

Page settings
Path: ____ (set whatever URL you want).

Fields
Node: Nid (Label: Nid; Exclude from display)
Node: Title (Remove label; Output this field as a link: events/speakers/[nid] — make sure Node: Nid is on top of the Fields so the Nid will pull successfully into here).
Content: Photo (thumbnail image)

Sort criteria
Node: title (asc)

Filters
Node: Published (yes)
Node: Type = Speaker


Video Attachment — Node content Display
Basic Settings
Name: Video Attachment
Title: Speaker Profile (will show up to the users).
Link display: Speaker Individual page

Node content settings
Node types: Event, Speaker
Arguments: nid (Use the ID of the node the view is attached to)

Relationships
Content: Speaker (Label: Page Reference)

Arguments
Relationship:
Node: Nid (Relationship: Speaker)

Fields
Node: Title (Link this field to its node)

Sort criteria
Node: title (asc)

Filters
Node: Published (yes)
Node: Type = Video


Event Attachment — Node content Display
Basic Settings
Name: Event Attachment
Title: Speaker Profile (will show up to the users).
Link display: Speaker Individual page

Node content settings
Node types: Speaker
Arguments: nid (Use the ID of the node the view is attached to)

Relationships
Content: Speaker (Label: Page Reference)

Arguments
Relationship:
Node: Nid (Relationship: Speaker; Action to take if argument is not found: Hide view/Page not found (404))

Fields
Node: Title (Link this field to its node)

Sort criteria
Node: title (asc)

Filters
Node: Published (yes)
Node: Type = Event


Work in Progress — This is to create a single event page which calls in the Biography (formerly called body) field of the Speaker content type. This way the person creating an event will not have to rewrite the bio every time a speaker visits.

Event Single Page — Page Display
Basic settings
Name: Event Single Page
Title: Speaker Profile
Row style: Display suite fields
Items to display: 1

Page settings
Path: _____ (enter whatever URL that you wish)

Relationships
Content: Speaker (Require this relationship)

Arguments
Node: Nid

Fields
Node: Title (Label: Title)
Content: Photo (Label: none; medium image)
Node: Body (Label: none)
Node: Body (Relationship: Page Ref)

Sort criteria
Node: Title (asc)

Filters
Node: Published (yes)
Node: Type = Event

Next time we will look at how I am setting up Display Suite to show these different node types.

Bulk Export Nodes in Drupal

I had a colleague request a copy of blog posts she had written. I had been given this task while in graduate school for a class but had been unable to withdrawal the records at that time. Here is how to do it in Drupal 6 with Views 6.x-2.12 and Views Bonus Pack (enable Bonus: Views Export). I used this as a guide for correctly setting up the export.

Create a new node View and then create a page display.
My settings for each area is broken up by area:

Basic Settings
Name: Export nodes
Style: DOC file (for my needs)
Items to display: ____ (insert the number you need)

Feed Settings
Path: _____ (enter your URL here — this is what I choose but you could change Link Display under Basic Settings from Page to Export nodes. Maybe. I’m not sure)

Fields
Node: Title
Node: Post date
Node: Body

Sort criteria
Node: Post date (asc)

Filters
Node: Type (choose whichever content types apply)
User: Name (Operator: Is one of and Usernames: _____ [whoever’s nodes you are exporting])

When I saved and went to the URL I had specified as the path, the Word Doc immediately downloaded. The formatting looks weird as it is in three columns thanks to the fields and the pictures did not download.

Down Week

I did not write any posts for this past week because I was not feeling very well. Besides it was the usual stuff with meetings, computer lab, digital signage, and working on four sections of the website (Online Resources, Adult Tech Classes, Book Groups, and Events). So I will devote the following posts to documenting how I did some things in Drupal instead of my usual work day summary.

I am always looking for new stuff to do or learn, so let me know if you have something for me!

Getting Behind Again

…in posting here. Fortunately these posts are 100% written for my own benefit. Highlights again:

Wednesday

  • I could not sleep last night but I had a brilliant idea for a way to redo one of our weekly eblasts/coordination with the website. So I made two mock-ups and submitted them to the department head. We’ll see what she says…
  • Made some adjustments to the Children’s Library pages which I am building on the test site.
  • Went to an in-house pro development session on Pinterest. I LOVE my colleague’s presentation style.
  • Finish setting up a new Facebook page for a department.
  • Planned the Adult Technology Classes for this summer with my partner. I’ll be teaching Trello again and either Tumblr or WordPress.com.
    Website tweaks.

Thursday

  • Took extra photos and set up a very casual editorial calendar for posting them on our social media outlets.
  • Spent most of the day trying to work through the Drupal 6 Attachments book. I quickly discovered that the uh…problems in the book do not work. After hours of frustration at the very end of the day, I managed to figure it out using other resources. I should post my steps on here…
  • Figured out how to export contacts out of Microsoft Outlook into a CSV file so it could be uploaded into some e-greeting card system.

Friday

  • Finally touched base with people I met at Computers in Libraries.
  • Responded to patron emails.
  • Tried to figure out the 2009 Sony e-Reader. Note: If I was on a desert island, I’d bring it with me. That thing is made of metal, is very tough, and even comes with a built-in style. There does not seem to be a guide on how to use it with OverDrive so I need to write one!
  • Worked in the computer lab for an hour.
  • Showed the events coordinator my efforts from the previous day with attachments.
  • A surprise social media webinar came across my radar so I tuned in while I curated one of our Twitter lists and examining the heat maps for our website.
  • Did some research on creating a dashboard interface for the events coordinator on the website and then dipped my toes in the water of transferring Thursday’s attachment efforts from my personal sandbox site to the Library’s test site.

Chaotic Heartbeat

Today was marked by chaos. I have to leave out why, but it was stressful even just as a bystander. On the other hand, I just have to share this beautiful photo of flowers I took for my Library’s Facebook account.

I sent off an eblast for our annual gala which had a typo. I am really hoping that no one actually calls in to complain because two letters got switched… So far I have created these publicity items:

  • Digital sign
  • Banner ad (the Imagination Gala — not my design, but I had to completely re-edit it)
  • Website landing page
  • E-newsletter
  • Updated social media
  • Two flyers (upcoming)

Then I received word about some new UX software code I was to place on the website. I’ll find out from my boss if I can say what it is, but it is AWESOME! I had to determine which pages I wanted to examine and then figure out the wildcard patterns. I am not sure how that will work. Already though I am seeing awesome results which has me very excited to get to work on more web work.

I then spent some time working on content review. I am getting quicker at scanning posts to decide what should be deleted, what might be useful, as well as discovering what sort of content gets attention. This is the single process which is teaching me the most about our website.

I wound up the day with some miscellaneous activities like populating our e-newsletter archive, discussing the new online resources page with reference (disagreement about what to call a link! I need help thinking of something better. Any takers?), minor brainstorming about the Children’s Library page, combining two images together to make a Library-branded social media profile picture, creating a new Twitter list for the Library, and finally getting some insight from a patron about what sort of tech books I should order.