Hi!

On the page I`m creating I`m using cck and workspace modules.
For one of the fields in the help text I wanted to put a link to 'my workspace'.
The problem is that I have to put the $user->uid into the link. Is it possible to put php code in the HelpText edit box?
Or is there some other way to do this?

Thanks

Comments

rooby’s picture

Status: Active » Fixed

This is way old, but you can make a custom module with hook_form_alter()

For example:

<?php
/**
 * Implementation of hook_form_alter().
 */
function MYMODULE_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'FORM_ID_OF_FORM_TO_ALTER') {
    $form['YOUR_FIELD_ID']['#description'] = t('Your help text goes here. You can do whatever you want to generate this text, including adding a <a href="@url">hyperlink</a>.', array('@url' => 'path/to/link/to'));
  }
}
?>

Status: Fixed » Closed (fixed)

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

darrellduane’s picture

Project: Content Construction Kit (CCK) »
Version: 6.x-2.7 »
Component: General » Code
Issue summary: View changes
Status: Closed (fixed) » Needs work

I've got to believe that a module could be made which brings PHP to all of the help/description fields. Anyone want to work on it? I am switching this to Drupal 7 core because this part of Drupal that has the fields and help text is a part of core AFAIK.

rooby’s picture

I doubt the proposition in #3 will ever be a part of drupal core.
A contrib module would be able to implement this though.

darrellduane’s picture

@rooby agreed. Is there a project name for desired contributed modules that have yet to be created that I could set this too?

rooby’s picture

Not that I know of.

There is an issue queue for new projects (by new maintainers) at https://www.drupal.org/project/issues/projectapplications but for that you have to post the already working module, it's not a wishlist.

avpaderno’s picture

Notice that this issue has been posted in issue queue for a sandbox project without code. It's not an issue queue to ask support for, or post bugs in, Drupal core or third-party modules.

Despite the project name, this sandbox project is not linked to Drupal core in any way, and it may be removed at any time.

avpaderno’s picture

Status: Needs work » Closed (outdated)

Project: » Lost & found issues

This issue’s project has disappeared. Most likely, it was a sandbox project, which can be deleted by its maintainer. See the Lost & found issues project page for more details. (The missing project ID was 1345390)