Drupal 6, Redirect automatically when selecting deepest item from a hierarchycal tree, like:
Drupal 6,从一个hierarchyycal树中选择最深的项目时自动重定向,如:
Tree Parent
.|_Child 1
....|__Child 1.1
.|_Child 2
Tree Parent。| _Child 1 .... | __Child 1.1。| _Child 2
Redirect action must occour only on the last items: Child 1.1 and Child 2 Destination of creat different content types, will be defined in js array. But how to send hierarchical select value to, destination add content type? Maybe like redirect_url?tid_value=value123. I have to save all taxonomy path, but it would be enouth to get deepest one tid value. Should i use multipage approuch here?
重定向操作必须仅在最后一项上出现:子项1.1和子项2创建不同内容类型的目标,将在js数组中定义。但是如何发送分层选择值,目的地添加内容类型?也许像redirect_url?tid_value = value123。我必须保存所有分类法路径,但是获得最深的一个tid值将是最好的。我应该在这里使用多页面approuch吗?
1 个解决方案
#1
0
Answering to my question:
回答我的问题:
create new module, like 'enter_content'.
创建新模块,例如'enter_content'。
In this module i am loading javascript file, which binds ...bind('change-hierarchical-select', ... with custom js function, to all hierarchical select field elements.
在这个模块中,我正在加载javascript文件,它将...绑定('change-hierarchical-select',...与自定义js函数绑定到所有分层选择字段元素。
When happens On change event, js checks for element class ...hasClass('has-no-children').
当发生更改事件时,js检查元素类... hasClass('has-no-children')。
So when there is no childrens i am doing redirect to my desired create content type form.
因此,当没有孩子时,我正在重定向到我想要的创建内容类型表单。
#1
0
Answering to my question:
回答我的问题:
create new module, like 'enter_content'.
创建新模块,例如'enter_content'。
In this module i am loading javascript file, which binds ...bind('change-hierarchical-select', ... with custom js function, to all hierarchical select field elements.
在这个模块中,我正在加载javascript文件,它将...绑定('change-hierarchical-select',...与自定义js函数绑定到所有分层选择字段元素。
When happens On change event, js checks for element class ...hasClass('has-no-children').
当发生更改事件时,js检查元素类... hasClass('has-no-children')。
So when there is no childrens i am doing redirect to my desired create content type form.
因此,当没有孩子时,我正在重定向到我想要的创建内容类型表单。