开发者

How to customize content type forms depending on the access

开发者 https://www.devze.com 2023-01-16 01:18 出处:网络
Is there a way to customize a edit page form in Drupal depending on the menu link ? (or by passing additional parameters to the edit page url ?

Is there a way to customize a edit page form in Drupal depending on the menu link ? (or by passing additional parameters to the edit page url ?

i.e. I have a children "Add new product" item in both menu items "Catalog1" and "Catalog2".

I want to hide 2 different CCK fields in the product content type depending on which menu item has been clicked.

Or eventually can I pass parameters with the url ? and use these parameters in hook_form API to decide which CCK field to hide ?开发者_如何学JAVA

Thanks


You probably want http://drupal.org/project/prepopulate.

Hiding the fields, however, is a different thing. You will need to create your own module that uses hook_form_alter to change the type of tields from text/input/select to hidden.


You can try http://drupal.org/project/conditional_fields to hide the CCK fields too.


I've actually solved by passing an additional php parameter from the menu item "Add Product" stating which catalog it should belong to.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号