Display lengthy legalese/explanation static text in CCK

in

Often there is a need to make some big block of text in the middle of a CCK input form. And on node display, show that same text and the value of the text field. Something like this:

An important requirement is your site admin (often your non-technical client) can edit the text. Any sort of CCK form widget require permission and change to the form. Not easy for plain user.

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 的頭像

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 的頭像

...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 的頭像

Very good post, thanks a lot.

.

Friend's 的頭像

Große Blog, danken

Really good trick! Thansk

Provigil's 的頭像

Really good trick! Thansk dude! But why are you using return 777 here?

Really good trick! Thansk

Provigil's 的頭像

Really good trick! Thansk dude! But why are you using return 777 here?

Really good trick! Thansk

Provigil's 的頭像

Really good trick! Thansk dude! But why are you using return 777 here?

I think the use of multiple

patent infringement's 的頭像

I think the use of multiple nodes makes sense. In particular, due to the seriousness of legal contract language, it is imperative that, if working for clients, everything is in proper order. After all, the digital sphere as well the physical world has it's share of people looking to take advantage of others who are not protecting their assets to the fullest. Thus, having a safety net, such as a written contract or disclosure form could be advantageous in the event of a legal/property rights battle.

marvelous source of info...

Phone Lookup's 的頭像

I visited this page first time and found it Very Good Job of acknowledgment and a marvelous source of info.........Thanks Admin!

marvelous source of info...

Phone Lookup's 的頭像

I visited this page first time and found it Very Good Job of acknowledgment and a marvelous source of info.........Thanks Admin!

Your blog is so rich with

Find Name By Phone Number's 的頭像

Your blog is so rich with nice content.I think you have done a great job with your blogs.Why don't you add a translator so that people from other countries can read this awesome blog of yours.

having a safety net, such as

allopurinol side effects's 的頭像

having a safety net, such as a written contract or disclosure form could be advantageous in the event of a legal/property rights battle.

having a safety net, such as

what is citalopram's 的頭像

having a safety net, such as a written contract or disclosure form could be advantageous in the event of a legal/property rights battle

I think you have done a great

paroxetine dosage's 的頭像

I think you have done a great job with your blogs.Why don't you add a translator so that people from other countries can read this awesome blog of yours.

發表新回應

這個欄位的內容會保密,不會公開顯示。

Navigation

使用者登入