I am working on a site that uses Subdomain/Pathauto to write user's blog entries to subdomains. Ex: http://username.example.com

My Feed Importer is set to have feed items inherit their author from the feed node. That works. But the path alias for imported items is not being written correctly. My Pathauto for these items is set to
~[subdomain]/[yyyy]/[mm]/[dd]/[title-raw]

Instead of the expected
http://username.example.com/2011/04/13/my-node-title
I'm getting
http://.example.com/2011/04/13/my-node-title

I tried moving the aliasing from Pathauto to Rules, and using the token [author:user-raw] to write the subdomain instead, but I get the same broken URL with no username. The only thing I can think of is somehow the author gets assigned after the path, but I'm not sure how to figure out if that is what's happening.

Has anyone else had this issue? Any help is most appreciated. I'm pulling my hair out over here.

Comments

jenna.tollerson’s picture

Desperately bumping this up.

jenna.tollerson’s picture

Who knows why the Pathauto pattern doesn't work correctly when Feeds is involved, but I was finally able to solve this with the Rules module. Here's my rule:

ON event After saving new content
IF
Content has type blog entry
DO
Create a URL alias (choose action "Create or delete an URL alias")

Create a URL alias looks like this:

Existing system path:
node/[node:nid]

Path alias:
~<?php $output = "[node:author-name-raw]/[node:yyyy]/[node:mm]/[node:dd]/".preg_replace("/[^a-zA-Z0-9\s]/", "", "[node:title-raw]"); $output = strtolower($output); echo str_replace( " ", "-", $output); ?>

Hope this helps someone.

twistor’s picture

Issue summary: View changes
Status: Active » Closed (outdated)