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
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>';
  }
}
?>

AttachmentSize
nodeprofile_submit_help.patch546 bytes

#1

fago - September 29, 2008 - 20:53
Status:needs review» needs work

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

 
 

Drupal is a registered trademark of Dries Buytaert.