Hello,

This may be a little obscure (sorry) and I'm not a coder, so I'm having trouble figuring this one out. First a little background: I manually insert a RSS feed (icon link) into my Taxonomy Term pages that I display using Panels and Views. I do this because AFAIK there's no other way. In a custom content pane, I do:

drupal_add_feed('/taxonomy/term/' . arg(2) . '/0/feed', 'RSS - ' . arg(2));

And this gives me a lovely dynamic RSS feed icon link - both the URL and the <a> title. But my problem is, even though I have Pathauto set up to make aliases for feeds, the alias does not appear when I use the above code. It ends up: /taxonomy/term/999/0/feed and my title: "RSS - 999".

Without using Panels/Views and the above custom code, everything is cool and all my RSS feed icon links have nice aliased URLs and the <a> title is also the Term Name and not the TID. So Pathauto is working with normal Drupal, but not with my amateur code. ;)

What am I missing in my code to manually apply Pathauto to my home-cooked feed URL?

Any help would save me much hair-pulling - thanks!

Comments

dave reid’s picture

Status: Active » Fixed

Very simple, use url(). :)

In your case that would be:

drupal_add_feed(url('taxonomy/term/' . arg(2) . '/0/feed'), 'RSS - ' . arg(2));
greggles’s picture

This is mentioned in the Pathauto README.txt

jrstmartin’s picture

Oops. Thanks Dave!

Status: Fixed » Closed (fixed)
Issue tags: -taxonomy, -views, -panels, -Feeds, -custom code

Automatically closed -- issue fixed for 2 weeks with no activity.