Display lengthy legalese/explanation static text in CCK

in

Recently I had a need to make a consent form, basically to show some big block of legalese text before a text field where the user sign. And on display, show that same text and the value of the text field. Something like this:

But CCK fields just don't have any way to include lengthy text. They can have help text which are displayed below the input in gray text. The second problem is I need this text to be shown when the page is displayed but the various modules I found (markup, form_markup) do not show anything on output. So I created the nodeincck module to solve this need.

It fetches another node and displays it both in the node edit form and node output. The markup and form_markup modules on output will be like this:

but nodeincck output is like this:

The main reason to use another node is for ease of site maintenance and flexibility: to change those text, just edit that node. Also the full power of Drupal's node system is used to 1) have any kind of fields and 2) complete theming capability.

About themeing: when a node is displayed in this context, it should, in almost all cases, hide the field label, all the links, submitted, taxonomy etc and just display the title and body. For this, the module makes several template suggestions to override the node template, in order of general to specific:

  1. node-nodeincck.tpl.php
  2. node-nodeincck-<FIELD_NAME>.tpl.php
  3. node-nodeincck-<NODE_TYPE>.tpl.php
  4. node-nodeincck-<FIELD_NAME>-<NODE_TYPE>.tpl.php

For example, I use this as my node-nodeincck.tpl.php:

<div id="node-<?php print $node->nid; ?>" class="node-nodeincck"><div class="node-inner">

  <?php if (!$page): ?>
    <p class="node-nodeincck-title">
      <?php print $title; ?>
    </p>
  <?php endif; ?>

  <div class="node-nodeincck-content">
    <?php print $content; ?>
  </div>

</div></div> <!-- /node-inner, /node -->

this leaves out all the extra stuffs normally displayed in a node and only show the title inside paragraph tag and body.

Any way to have different nodes per organic group?

Chad's picture

This may be a trick, but it would potentially have wide applications. Let's say we have different groups and they all have different agreements based on each group. I would like to have the same content type used by each group, but have a different node included in that content type, depending on the group. Does that make sense? This could be useful for groups with different agreements, but in my case, I want each group to have a mission statement that is inserted into every content type created-- but again the particular node that is inserted should be dependent on the group creating the content. This is the closest to that functionality that I have found. Thank you for any response.

Seems like you want to have some logic to determine...

Alpha Epsilon Delta's picture

...which node to show base on some variable, in your case the group id. I can add a PHP mode where instead of the node id, it's some PHP snippet that returns the node id, something like this:

instead of

---> 34 <----

to show node 34

you enter:

switch $user->group {
  case 1:
    return 737;
  case 2:
    return 747;
  default:
    return 777;
}

and you check the PHP check box.

would that be the way?

Very good post, thanks a lot.

dido's picture

Very good post, thanks a lot.

.

Friend's picture

Große Blog, danken

Simoneau says, “Being a

Friend's picture

Simoneau says, “Being a Daniel Webster Scholar alışveriş gave me confidence in my ability to practice law. More importantly, my employers knew because I was erkek giyim bayan giyim bayan giyim erkek giyim doğal ürünler a Webster Scholar, pet shop I could handle a Supreme Court appeal.” As a Daniel Webster Scholar, giyim he was evaluated each semester by a New Hampshire Bar bilgisayar Examiner, counseled clients under supervision, appeared before judges, and developed his skills and judgment in clinical settings. oto aksesuar The program is unique alisveris in the nation.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Syntax highlight code surrounded by the {syntaxhighlighter OPTIONS}...{/syntaxhighlighter} tags.
  • Allowed HTML tags: <a> <p> <span> <div> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <param> <strike> <caption>
  • Insert Google Map macro.
  • Use [toc list: ol; title: Table of Contents; minlevel: 2; maxlevel: 3; attachments: yes;] to insert a mediawiki style collapsible table of contents. All the arguments are optional.

More information about formatting options