Use Tab Tamer module to remove the tabs (Drupal defaults in the system) that you dont want.
for example, EDIT tab in user page.
Friday, April 22, 2011
User Editview module to change views to be editable
Futhuer more, modify or add templete.php in the theme to make the fields showed vertically:
( if you do not know about templete.php, you can refer to template.php: Overriding other theme functions):
Soure: http://drupal.org/node/581488#comment-4378324
That was my fix, and it works well. Ideally, this theme function should be rewritten to remove the logic-work out into its own function, and leave the theme_...() function as only showing how to display the data. That would make overriding the theme function less clunky.
Futhuer more, modify or add templete.php in the theme to make the fields showed vertically:
( if you do not know about templete.php, you can refer to template.php: Overriding other theme functions):
Soure: http://drupal.org/node/581488#comment-4378324
- override the theme_editview_node_form() function (by copying it into my template.php file, and renaming it to MYTHEME_editview_node_form()).
- comment out or delete this line:
$header[] = $field->label(); - Add this line...
$cell['data'] .= "";
...just before this one:
$cell['data'] .= $value; - Change...
$row[] = $cell;
... to
$rows[] = array($cell); - Change...
return theme('table', $header, array($row), array('class' => 'editview-row')) . $buttons;
... to
return theme('table', $header, $rows, array('class' => 'editview-row')) . $buttons;
That was my fix, and it works well. Ideally, this theme function should be rewritten to remove the logic-work out into its own function, and leave the theme_...() function as only showing how to display the data. That would make overriding the theme function less clunky.
Tuesday, April 19, 2011
Add a link(such as add to my favorite) to make the node referenced with View
source: http://drupal.org/node/765562#comment-2822990
my related post: http://wadmin.blogspot.com/2011/04/display-suite-module-for-customizing.html
source: http://drupal.org/node/765562#comment-2822990
my related post: http://wadmin.blogspot.com/2011/04/display-suite-module-for-customizing.html
The use of a View to restrict the list of nodes simply reduces the nodes that may be referenced. Maybe you'd want to make a list of referenceable nodes that only includes content created in the last 30 days, content promoted to the front page, or some other arbitrary properties. In your case it sounds like you wouldn't use this functionality since "feedback" nodes should be able to reference any "proof" node. This functionality doesn't have anything to do with adding links to the display of a view.
If you want to add a link to "Add feedback" to a piece of content, add the Node: NID field and then rewrite it so that it is a link "Add Feedback" with the path "node/add/feedback/[node_nid]". Assuming you've set up the feedback content type with a Node Reference URL Widget, it will pull the nid from the URL and prepopulate the field.
THAT IS:
Make Node: NID to be a link by "rewrite the output of this file" and "Output this field as a link"
If you want to add a link to "Add feedback" to a piece of content, add the Node: NID field and then rewrite it so that it is a link "Add Feedback" with the path "node/add/feedback/[node_nid]". Assuming you've set up the feedback content type with a Node Reference URL Widget, it will pull the nid from the URL and prepopulate the field.
THAT IS:
Make Node: NID to be a link by "rewrite the output of this file" and "Output this field as a link"
Translation of the name of the content type.
Source: http://drupal.org/node/763536
Use translation interface to translate the name of the content type. However, there is a bug in i18n. When you click content create, the content names are not translated.
Solution: with following patch.
Source: http://drupal.org/node/763536
Use translation interface to translate the name of the content type. However, there is a bug in i18n. When you click content create, the content names are not translated.
Solution: with following patch.
# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: \sites\all\modules\downloaded\i18n\i18ncontent
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: i18ncontent.module
--- i18ncontent.module Base (BASE)
+++ i18ncontent.module Locally Modified (Based On LOCAL)
@@ -156,13 +156,16 @@
*/
function i18ncontent_menu_alter(&$menu) {
$menu['node/add']['page callback'] = 'i18ncontent_node_add_page';
- // @TODO avoid iterating over every router path.
- foreach ($menu as $path => $item) {
- if (!empty($item['page callback']) && $item['page callback'] == 'node_add') {
+ //fetch valid node types
+ //we just copy the behavior in node_menu()
+ $ntypes = node_get_types('types', NULL, TRUE);
+ foreach ($ntypes as $type) {
+ $type_url_str = str_replace('_', '-', $type->type);
+ $path = 'node/add/' . $type_url_str;
+ if (!empty($menu[$path]['page callback']) && $menu[$path]['page callback'] == 'node_add') {
$menu[$path]['page callback'] = 'i18ncontent_node_add';
- $arg = arg(NULL, $path);
$menu[$path]['title callback'] = 'i18nstrings_title_callback';
- $menu[$path]['title arguments'] = array('nodetype:type:'. $arg[2] .':name', $item['title']);
+ $menu[$path]['title arguments'] = array('nodetype:type:'. $type->type .':name', $type->name);
}
}
}
Monday, April 18, 2011
Modules for relations of nodes and display them
Use node reference, node reference view, view attach and corresponding node reference to make related blocks beside the node.
Corresponding node reference is helpful for bidirectional relations. Note: Corresponding node reference may have problem with a translated node to a non-translated node.
Use Node reference url for users to establish referred relation between nodes.
Use display suite to adjust the desplay of them.
Use node reference, node reference view, view attach and corresponding node reference to make related blocks beside the node.
Corresponding node reference is helpful for bidirectional relations. Note: Corresponding node reference may have problem with a translated node to a non-translated node.
Use Node reference url for users to establish referred relation between nodes.
Use display suite to adjust the desplay of them.
Sunday, April 17, 2011
If you want a separate block for the exposed filter, this should be set to Yes. If you want the filter to be in the View's Block display, make sure that the Block display's "Exposed form in block" option is set to No.
Depening on the configuration you're attempting to achieve, you might want to override your default settings.
Depening on the configuration you're attempting to achieve, you might want to override your default settings.
Show nothing with empty argument
source: http://drupal.org/node/358546
Add an argument of type "Global: Null". (This argument doesn't alter any behaviour directly).
Configure the new argument to:
When you visit your view with any argument (e.g. mysite.com/myview/start) the validator will run, find exposed_input empty and display your view's empty text. Once you hit submit on the filter it'll run as usual.
In my case I can live with the extra argument. Hopefully you can too, or at least this'll give you something to start from.
source: http://drupal.org/node/358546
Add an argument of type "Global: Null". (This argument doesn't alter any behaviour directly).
Configure the new argument to:
- display all values if the argument is not present
- display empty text if the argument does not validate
// The exposed_input array has values only when
// the exposed filters have been submitted.if (count($view->exposed_input)) {
return TRUE;
}?>In my case I can live with the extra argument. Hopefully you can too, or at least this'll give you something to start from.
Subscribe to:
Posts (Atom)
Views: Using explosed filter to make a search form.
source: http://drupal.org/node/545592