Add help text (submission guidelines) when creating a node via profile page
msonnabaum - August 20, 2008 - 01:35
| Project: | Node Profile |
| Version: | 5.x-1.4 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Jump to:
Description
I noticed that when you have help text for the nodeprofile node type, it only shows up on the node/add page.
This patch adds the appropriate help info to /user/[uid]/edit/[node_type] by invoking hook_help.
<?php
function nodeprofile_help($section) {
if (arg(0) == 'user' && arg(2) == 'edit' && $type = arg(3)) {
$type = node_get_types('type', str_replace('-', '_', arg(3)));
return '<p>'. filter_xss_admin($type->help) .'</p>';
}
}
?>| Attachment | Size |
|---|---|
| nodeprofile_submit_help.patch | 546 bytes |

#1
That sounds good, but your patch doesn't check whether the given path is really from node profile. This needs to be fixed.