Is it possible to insert some kind of text block with links in node edit form?

Let's say I have "press-release" node type, all my users have rights to add press-release. On the top of my node/add/press-release page I want to place a text block with all rules and restrictions with links to certain help pages.

Is is possible?

Thanks.

Comments

markus_petrux’s picture

Version: 6.x-3.x-dev » 6.x-2.x-dev
Status: Active » Fixed

Yes, you can. For example:

1) Implement hook_form_alter() to insert a #markup element with the contents you wish.
2) Implement hook_content_extra_fields() to allow you to move this element to the top of the form in "Manage fields" screen.

Another option:

Search for markup module.

Equ’s picture

Nice, thank you!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nonzero’s picture

Status: Closed (fixed) » Active

Where is the best place to add these hooks? Forgive my ignorance, but I assumed I would have to add it to a custom module, which I think is overkill. My next idea was to add page-node-add-some_type.tpl.php (change "some_type") to the theme folder, but I feel that's too much also because a lot of the markup is duplicated from page.tpl.php.

My current solution is to use THEME_preprocess_page in template.php add add help text from another node:

function NGSS_TRS_preprocess_page(&$vars, $hook) {
  if ((arg(0) == 'node') && (arg(1) == 'add') && (arg(2) == 'some_type')) {
    $vars['title'] = t('Title of form');
    $vars['help'] = node_view(node_load(10)); // replace 10 with whatever node has your help text
  }
}

Any better ideas?

markus_petrux’s picture

Status: Active » Fixed

Re: Any better ideas?

Nope. If it works, then that's fine too.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.