Export Adobe Illustrator Artboards to PNG and PDF

Thanks to Matthew Ericson, here’s are a couple of Illustrator scripts to save artboards to PNG and/or PDF format. The original script exports to PNG only. The new and improved version provides options to export artboards, layers, or combinations of the two while specifying output filename prefix and suffix.

Enhance Graphene Theme’s Edit Link Text to Reflect Custom Post Type

Note: This issue appears to have been resolved in Graphene 1.6.

Admin Bar is Correct

Fig. 1: Admin Bar is Correct

Custom post types provide a way of organizing your content more efficiently. They’re a breeze to create, especially with the Custom Post Type UI plugin. At times, however, the Graphene theme may still refer to the custom types as “posts” behind the scenes. They are still “posts,” after all, in the database/blog scheme of things, just with different labels and perhaps some other properties (some might argue that they might be better thought of as Custom Content Types). From a Content Management standpoint, this can prove distracting, even unsettling, particularly for content editors rather than site administrators, not to mention those of the anti-blog mindset (they’re out there!). In this illustration, we have an Event Website rather than a blog. The event has speakers, sessions and tracks, so it makes sense to create custom post types for “Speakers” and “Sessions.” Note that the WordPress admin bar correctly reflects the custom post type (Fig. 1).

Edit Link Text

Fig. 2: Link Text

When viewing the custom post type, note how Graphene handles the Edit Link Text (Fig. 2). The WordPress admin bar, however, still displays the custom post type correctly.

Inspecting the link text (in this case, “View Speaker”) reveals the surrounding code generated by WordPress.

 

Inspecting the Admin Bar Link Text

Inspecting the Admin Bar Link Text

Digging into the WordPress wp-includes/admin-bar.php reveals the following:

 

admin-bar.php

WP Admin Bar Edit Menu Code (admin-bar.php)

The highlighted function should come in handy, assuming $post is the current post being passed to get_post_type_object. The goal here is to modify none of the WordPress or active theme’s core files, opting instead to overload them through the child theme.
Examining loop.php from Graphene’s core reveals the following:

 

Original loop.php

Original loop.php

There’s the “Edit post” link text hard coded into the loop.

Copy loop.php into the same relative location in your child theme and edit the code as follows:

 

Adjusted loop.php

Adjusted loop.php

The result?

Corrected Edit Post Link

Corrected Edit Post Link

jQuery/Google Analytics Script to Track Outbound Links

Google Analytics does not track outbound links by default.

Usage

Assign link-outbound class to any trackable external links on the page. As scripted here, your outbound links will appear in Analytics as /outbound/ with the full URL of the outbound link appended. This can be modified to suit your reporting needs.

Example

External link:

<a class="link-outbound" href="http://www.externalsite.com">Link to externalsite.com</a>

Script block (assumes jQuery and Google Analytics are both loaded):

<script type="text/javascript">
<!--
$(document).ready(init);
function init() {
$('a.link-outbound').click(function () {
_gaq.push(['_trackPageview', '/outgoing/' + $(this).attr('href')])
});
}
-->
</script>

SEO and CMS: Proof Your Custom URLs

Any content management system (CMS) these days should enable you to tailor your search engine optimization (SEO) on a per page (or post, if you’re publishing an article or blog in WordPress) basis. Permalinks are often overlooked, as a CMS will generally create one based on the page title. It is worth noting that a CMS may also strip out commonly used or single-letter words, often replacing them with hyphens if anything at all. Thus, a URL can easily contain a string of 3 or 4 hyphens in a row, such as:

http://www.skillzdesign.com/blog/explaining-why----useful/

This is suboptimal for a number of reasons:

  • It’s immediately obvious to anyone familiar with content management systems that you were either too lazy to take the extra step and optimize your URL, or you simply overlooked it.
  • The URL stub will not be conducive to any human-readable, “URL’s as Sentences” scheme (check your address bar for a live example).
  • The URL will be a challenge at best to speak to someone over the phone or voice recognition software.
  • Perhaps most importantly, it looks ugly.

Dreamweaver and WordPress Content Management Workflow

In our case, our live site is running WordPress with a customized Graphene Child Theme. We’ll load a standard content page (our “About Us” page) which has all the components we need to develop a template, mainly the wrapper (including sidebar) and our variable content. We’ll save the page locally, open it in Dreamweaver, make sure we have a local site created to at least partially mirror our live site (you’ll need to do this in order to build site-specific templates), save the page as a template, and add a couple of editable regions. We will then create a page based on the template, fill it with sample content, and preview the local page in a browser.

We’ll click on <mminstance:editable> in the tag selector at the bottom of the Dreamweaver code and design window to select everything within the editable region, copy the selection from the code pane (not the design view!) to ensure we capture all the HTML, and paste it into the Source view of a new page in our CMS.