Making Sense of the *title Breadcrumb Template Tags

Currently, there are several, closely related template tags that each exhibit slightly different behaviors. These are: %title%, %htitle%, %ftitle%, and %fhtitle%. As their names suggest, they will be replaced with the resource’s title. However, how this title is processed differs between the tags.

Note that the “Max Title Length” setting is deprecated. Hence, both %ftitle% and %fhtitle% are deprecated and not recommended for use. They are included in this discussion for the sake of completeness.

Below is a table outlining the behavior of these tags for the same title with the max length set to ~10 characters and with the max length setting disabled.

Template Tag Max Title Length1 Title Result
%title% 10 Hello <em>World</em> Leaders Hello <em…
%htitle% 10 Hello <em>World</em> Leaders Hello <em…
%ftitle% 10 Hello <em>World</em> Leaders Hello World Leaders
%fhtitle% 10 Hello <em>World</em> Leaders Hello <em>World</em> Leaders
%title% Disabled Hello <em>World</em> Leaders Hello World Leaders
%htitle% Disabled Hello <em>World</em> Leaders Hello <em>World</em> Leaders

%title% and %htitle%

Notice that the resulting strings for the standard %title% tag and the %ftitle% tag do not contain HTML tags. Thus, they are safe for use within HTML tag attributes (e.g. the title attribute). To maintain HTML tags present in the resource’s title, use the %htitle% tag.

%ftitle% and %fhtitle%

Note that the Max Title Length setting does not affect the resulting string for the %ftitle% and %fhtitle% template tags. In fact, by design, they are the same as %title% and %htitle% when “Max Title Length” is disabled. However, note that since the Max Title Length setting is deprecated, these template tags are as well.

Lastly, note that when using the Max Title Length setting, HTML tags may be left open or even incomplete. Therefore, it is strongly recommended that CSS is used to trim the breadcrumb title length rather than the deprecated Max Title Length setting. An additional benefit to using CSS is it does not mess with the actual content of the breadcrumb trail, allowing search engines to pick up on the full titles rather than the trimmed ones.

-John Havlik

[end of transmission, stay tuned]

Notes:

  1. Note that use of the Max title Length setting has been deprecated in favor of using CSS to trim Breadcrumb titles lengths.

Supermicro X10SDV-7TP4F Heatsink Swap

After assembling my new home server, I ran into a bit of a heat issue. The Xeon-D SOC would get quite hot under load (80C), and was a little warmer than desired while idling (40C). Attempting to cool itself off, the motherboard kept the chassis fans spinning fast enough to be annoyingly loud. Since the heatsink installed on the motherboard was designed for 1U compatibility, and the case I’m using is 2U tall, it was not getting the airflow it was designed for.

Continue reading

Repairing the 24 Pin ATX Power Connector

As part of my new home server build, I picked up a used Super Micro SC216 chassis. This chassis has 24x 2.5″ drive bays in the front, 3x 80mm fans in the mid-plane, 7 half-height expansion slots in the rear, and dual PSUs. While dual PSUs are overkill, the rest of the features should make for a nice Xeon D based storage chassis.

Once the chassis arrived, I noticed that the previous owner had mutilated the 24 pin ATX power cable. The PS-ON, and the GND pin next to it, had been clipped at the connector and spliced together with a crimped pigtail splice. Typically, this is done so that the PSUs are always on when using the chassis as an external JBOD box. Since I would like the soft power button to function properly on the case, this needed to be fixed.

Luckily, I had an 24 pin ATX power cable from a dead PSU. Using that cable as a donor, I replaced the PS-ON and GND pins in the power connector. Then, I made a solder splice between the PS-ON (and GND) in the power distributor and the corresponding replacement in the connector. With the lines reconnected, I was able to power up my test board (an old core 2 duo board). Now the chassis is ready for a Xeon D motherboard.

-John Havlik

[end of transmission, stay tuned]

Tagged:
Updated:

How to Add a Custom Breadcrumb Template Tag

Since version 4.4.0, it has been possible to add additional custom template tags to supplement the defaults included in Breadcrumb NavXT. Adding a custom template tag is relatively easy. All one has to do is write a function that hooks into the bcn_template_tags filter and adds the new template tag.

bcn_template_tags has three parameters, two for helping identify the resource the breadcrumb represents, and one for the actual replacement set. Today, we’ll focus on the first parameter, the $replacements array. This associative array has the template tag as the key and the value is the actual value that should replace the tag in breadcrumbs. To add a new template tag, simply add a new key-value pair to the array and return the modified $replacements array.

For example, to add a breadcrumb template tag that inserts the current theme’s directory, one could use the following:

function my_bcn_template_tag($replacements, $type, $id)
{
    //Add the %template_directory% template tag
    $replacements['%template_directory%'] = get_bloginfo('template_directory');
    //Return our new set of templates and replacements
    return $replacements;
}
add_filter('bcn_template_tags', 'my_bcn_template_tag', 3, 10);

In the code above, %template_directory% is the breadcrumb template tag being added; its value is retrieved using the get_bloginfo() function. Simple, right?

-John Havlik

[end of transmission, stay tuned]