Grayside.Org - prepopulate http://grayside.org/taxonomy/term/28/0 en Node Form Dominos via Node Reference and Prepopulate http://grayside.org/2010/09/node-form-dominos-node-reference-and-prepopulate <p>I like Prepopulate. I like to have that pseudo-RESTful way of preloading a form to minimize the amount of work a user has to do to get to the point of submitting a form. But I also like clean URLs. This post reviews in detail a technique to use a single prepopulated nodereference field to prepopulate a bunch of other fields based on that reference. Since <a href="http://drupal.org/project/prepopulate">Prepopulate&#8217;s</a> recent 2.0 release, it because a whole lot more difficult to use the <a href="http://drupal.org/node/37775">Form <span class="caps">API</span></a> to work magic on what it&nbsp;provides.</p> <p>I use this in conjunction with nodereference to tailor node forms for their relationship with the referenced&nbsp;node.</p> <p><a href="http://grayside.org/2010/09/node-form-dominos-node-reference-and-prepopulate" target="_blank">read more</a></p> http://grayside.org/2010/09/node-form-dominos-node-reference-and-prepopulate#comments drupal6 nodereference prepopulate ux Thu, 02 Sep 2010 20:47:04 +0000 grayside 88 at http://grayside.org Prepopulate Group Audience http://grayside.org/2010/04/prepopulate-group-audience <p>This trick does not use the very fine <a href="http://drupal.org/project/prepopulate">Prepopulate</a> module at&nbsp;all.</p> <p>By appending <code>?gids[]=&lt;group nid&gt;</code> to your node/add URL, you can specify the group audience. By throwing in a comma-delimited list of nids, you can specify multiple audiences. It&#8217;s just that&nbsp;simple.</p> http://grayside.org/2010/04/prepopulate-group-audience#comments drupal og prepopulate Thu, 01 Apr 2010 17:28:16 +0000 grayside 61 at http://grayside.org Overriding Prepopulate: Do Not Use hook_form_FORM_ID_alter http://grayside.org/2010/02/overriding-prepopulate-do-not-use-hookformformidalter <blockquote><p> <strong><span class="caps">EDIT</span>: As of Prepopulate 2.0, you cannot directly use hook_form_alter() anyway. See <a href="http://grayside.org/2010/09/node-form-dominos-node-reference-and-prepopulate">Node Form Dominos</a> to learn about using #after_build to work with Prepopulated values. &#8212;&nbsp;2010/09/09</strong> </p></blockquote> <p>The <a href="http://drupal.org/project/prepopulate">Prepopulate</a> module works some great magic to preload forms from <span class="caps">URL</span> variables. But suppose you need some extra magic to modify the titles it puts in&nbsp;place?</p> <p>You can always use <tt>hook_form_alter</tt> (and <a href="http://drupal.org/node/651106">here</a> is one of countless little tutorials on&nbsp;that).</p> <p>If you already know about that, you might be someone that enjoys the use of <tt>hook_form_FORM_ID_alter()</tt>. If you do, you <strong>cannot</strong> use it to override Prepopulate-set fields. It turns out that regardless of module weight, <tt>hook_form_FORM_ID_alter</tt> is called before <tt>hook_form_alter</tt> for any given form, meaning that the more specific function will always set the value, then Prepopulate will come along and reset it to your <span class="caps">URL</span>&nbsp;value.</p> <p>There is a nice issue (<a href="http://drupal.org/node/300481">#300481</a>) that details this problem, and hopefully will find itself fixed in Drupal&nbsp;8.</p> <p><a href="http://grayside.org/2010/02/overriding-prepopulate-do-not-use-hookformformidalter" target="_blank">read more</a></p> http://grayside.org/2010/02/overriding-prepopulate-do-not-use-hookformformidalter#comments drupal drupal6 drupal8 hook_form_alter prepopulate Fri, 12 Feb 2010 19:31:30 +0000 grayside 54 at http://grayside.org Prepopulating Casetracker http://grayside.org/2009/11/prepopulating-casetracker <p>The <a href="http://drupal.org/project/prepopulate">Prepopulate</a> module for <a href="http://drupal.org">Drupal</a> is a nifty little tool that resets the default values of forms on their way to the browser. This is particularly useful for crafting links to create nodes with pre-set values. You can even prepopulate <a href="http://drupal.org/project/casetracker">Case Tracker</a> form values to help users create cases filled out as you would&nbsp;like.</p> <p><a href="http://grayside.org/2009/11/prepopulating-casetracker" target="_blank">read more</a></p> casetracker drupal prepopulate Tue, 03 Nov 2009 19:32:41 +0000 grayside 43 at http://grayside.org