I am using taxonaomy menu with pathauto and I have checked the "Use 'all' at the end of URL" for the taxonomy menu term.
However the url that is generated is not passing through path auto. I receive:
"http://www.example.com/taxonomy/term/1/all"
When i would rather have:
"http://www.example.com/taxonomyalias/termalias/pagealias.html"

I can do it manually but that is not practical on a large website.

Can this be done in pathauto automatically with bulk generate? And if Not I official put a feature request in.

Comments

spgd01’s picture

Title: Unable to auot generate alias for term/all » Unable to auto generate alias for vocabulary or term/all

no one else wants to auto generate a auto path for term/all?

greggles’s picture

Title: Unable to auto generate alias for vocabulary or term/all » Also generate alias for vocabulary or term/all
Category: support » feature

No, this is apparently a low priority...

dave reid’s picture

Priority: Normal » Minor
dave reid’s picture

Title: Also generate alias for vocabulary or term/all » Aliases for taxonomy/term/[tid]/all pages
Component: User interface » Code
Category: feature » support

Vocabularies don't have pages, so remove that from the title. Considering D7 removed the /all, I don't see this happening at all in Pathauto. As such, I'm moving this from a feature request to a support request.

spgd01’s picture

Thanks for the help. So if "list all" is not a good Idea then how do I list all the Terms' pages within a Vocabulary on one page then? And then how do I navigate "link" to it with a proper URL as described above? Taxonomy menu links to "all"

pedro7’s picture

I have a temporary solution for this issue (on postgresql). I don't know if it's applicable to other databases.

The solution is to create a trigger - function, which is called every time the table url_alias is updated. This function duplicates rows with src field 'taxanomy/term/TID' with 'taxanomy/term/TID/all'. Also duplicated the corresponding dst field.

How to create the function and trigger (again, in Postresql!):

CREATE OR REPLACE FUNCTION SCHEMANAME.taxtermall()
RETURNS trigger AS
$BODY$
begin
create temp table taxterm as (select src,dst,language from SCHEMANAME.url_alias where substr(src,1,14) = 'taxonomy/term/');
delete from taxterm where substr(src,1,14) = 'taxonomy/term/' and substr(src,char_length(trim(src))-2,3) = 'all';
delete from SCHEMANAME.url_alias where substr(src,1,14) = 'taxonomy/term/' and substr(src,char_length(trim(src))-2,3) = 'all';
update taxterm set src = src || '/all',dst = dst || '/all';
insert into SCHEMANAME.url_alias (src,dst,language) select src,dst,language from taxterm;
drop table taxterm;
RETURN NULL;
EXCEPTION
WHEN duplicate_table THEN
RETURN NULL;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION SCHEMANAME.taxtermall() OWNER TO MYOWNER;

Create the trigger:

CREATE TRIGGER SCHEMANAME_taxtermall AFTER INSERT OR UPDATE ON SCHEMANAME.url_alias
FOR EACH STATEMENT EXECUTE PROCEDURE SCHEMANAME.taxtermall();

Please, replace strings SCHEMANAME and MYOWNER with your own, depending on your situation.

Now, update anything in url_aliases (for example, insert any url alias). The function will be automatically trigerred and table url_alias updated. You wil be, maybe, happy (as me) :-)

Nothing in drupal code should be modified.

Petr

dave reid’s picture

Status: Active » Closed (won't fix)

I would recommend using something like custom_url_inbound_alter() and/or custom_url_outbound_alter() or Sub-path URL aliases.