Argument-Plugins--Starting-at-the-beginning.html 1.0 KB

1234567891011121314151617181920
  1. <div id="node-12" class="node">
  2. <div class="content clear-block">
  3. <p>Contexts are fundamental to CTools, and they almost always start with an argument to a panels page, so we'll start there too.</p>
  4. <p>We first need to process an argument.</p>
  5. <p>We're going to work with a "Simplecontext" context type and argument, and then with a content type that displays it. So we'll start by with the Simplecontext argument plugin in plugins/arguments/simplecontext_arg.inc.</p>
  6. <p>Note that the name of the file (simplecontext_arg.inc) is built from the machine name of our plugin (simplecontext_arg). And note also that the primary function that we use to provide our argument (ctools_plugin_example_simplecontext_arg_ctools_arguments()) is also built from the machine name. This magic is most of the naming magic that you have to know.</p>
  7. <p>You can browse plugins/arguments/simplecontext_arg.inc and see the little that it does.</p>
  8. </div>
  9. <div class="clear-block">
  10. <div class="meta">
  11. </div>
  12. </div>
  13. </div>