Under Node path settings, I set Default path pattern as [cat]/[title]. When I create a new node the URL is not correct. It creates the URL http://www.domain.com/[cat]/nodetitle, where the nodetitle is node title. [cat] is not replaced with the category of the node.

Comments

greggles’s picture

Title: Node path settings does not have [cat] » [cat] is now [term]
Version: 5.x-2.0-beta2 » 5.x-2.x-dev
Component: Code » Documentation
Assigned: Unassigned » greggles
Category: bug » task
Priority: Critical » Normal

This is just a documentation problem. [cat] is now [term] I believe.

meatbites’s picture

In a bid to bring further clarity to the project, I respectfully disagree with you, greggles. There's documentation and then there's interface intuitiveness -- I believe this one's the latter, or lack thereof.

'Term' is a horribly ambiguous word. I recommend changing it to something more human-friendly, such as 'section.' I also suggest altering 'catpath' under node path settings, as it's presently a bit confusing (namely, 'As [cat]' -- there is no [cat] in here).

Current node path settings:

[term] Name of top taxonomy term
...
[catpath] As [cat], but including its supercategories separated by /.

Suggested node path settings (altered items are bolded):

[section] Name of node's parent taxonomy term
...
[sectionpath] As [section], but including its parent categories, separated by /

I may have misunderstood what these variables do, but whatever the case, I strongly feel things should be more self-explanatory, including variable names.

greggles’s picture

Category: task » bug

I appreciate you providing feedback and a concrete suggestion rather than just criticizing the module, but...

1) The user interface should not include the words "node" or "taxonomy". If you look in Drupal core that is the always the case. Looking at pathauto that is not consistently the case, but should be.

2) The concept of "parent" means many things to many people and I don't think it ever means "lowest weight" which is what the modules attempt to do.

3) "section" is one interpretation of a term, but terms are only sometimes used to determine "section" of a site. "Term" is the word used most consistently in core and in contrib and in the documentation, so that is the term that Jeff Eaton chose when rewriting the pattern code in Token module. I don't plan on trying to convince him to change that.

So,

How about these changes to improve the usability and to standardize on the way that Drupal core expects us to use the vocabulary:

1) Change catpath to termpath
2) Change the documentation from [cat] to [term]
3) Also document this in an "Upgrading" page
4) Replace the word "node" with "content" and the words "taxonomy" and "category" with either "vocabulary" or "term" as appropriate.

meatbites’s picture

Great to see you're taking an active stance on the interface and documentation. You're right about replacing 'taxonomy' and 'node' -- neither would be expected in an average conversation.

A time-proven synonym to 'term' would be 'label' or even 'tag,' but as you point out, Drupal is inherently steering clear of these. Although I still believe 'term' is a bit ambiguous, as long as the description concisely fills any gaps, it shouldn't cause any UI confusion. For a beast like Drupal, I guess it's wise to use a fairly flexible vocabulary.

Regarding 'parents,' I think it's a much better choice for the description than what's currently in there -- 'supercategory.' It implies that we're in a sub/category. But apparently we're not, because otherwise we'd be talking about those and not terms. Terms and subterms might work, but I gather it's a bit late for those to change.

Anyway, as long as the wording is obvious and doesn't clash with Drupal, we should be just fine. And what you've listed is certainly an improvement -- thumbs up.

greggles’s picture

Aha, we were talking about two different things. You used the word parent for the [term] token and the [termpath] token and in the second case it makes complete sense to me.

So, these guys could now be:

[term] Name of the lowest weight vocabulary term on a piece of content.
...
[termpath] As [term], but including its parent terms separated by /.

Does that sound good?

meatbites’s picture

Ah, righto. Well, we're now on the same page -- sounds perfect!

greggles’s picture

Title: [cat] is now [term] » change name and documentatino for catpath

Fixing title.

This is also slightly complex because for taxonomies token uses [cat] but for nodes it uses [term]. Part of the reason for that is to prevent having multiple tokens with the same name and potentially different meanings. So, I think we need to have two values, actually. One catpath for the taxonomy area and one termpath for the node area.

I'll do that unless someone speaks up with a better solution in the next day or so.

greggles’s picture

Status: Active » Fixed

So, I did this within the recent round of fixes for punctuation. Sorry for not providing a patch and not marking statuses here as I went and what not...

Anonymous’s picture

Status: Fixed » Closed (fixed)