Mercurial > hg > rr-repo
annotate sites/all/modules/ctools/ctools_plugin_example/help/Context-plugins--Creating-a--context--from-an-argument.html @ 11:b0ee71395280
deleted .DS_Store files
author | danieleb <danielebarchiesi@me.com> |
---|---|
date | Mon, 28 Oct 2013 16:12:13 +0000 |
parents | ff03f76ab3fe |
children |
rev | line source |
---|---|
danielebarchiesi@0 | 1 <div id="node-13" class="node"> |
danielebarchiesi@0 | 2 |
danielebarchiesi@0 | 3 |
danielebarchiesi@0 | 4 |
danielebarchiesi@0 | 5 |
danielebarchiesi@0 | 6 <div class="content clear-block"> |
danielebarchiesi@0 | 7 <p>Now that we have a plugin for a simplecontext argument, we can create a plugin for a simplecontext context. </p> |
danielebarchiesi@0 | 8 <p>Normally, a context would take an argument which is a key like a node ID (nid) and retrieve a more complex object from a database or whatever. In our example, we'll artificially transform the argument into an arbitrary "context" data object. </p> |
danielebarchiesi@0 | 9 <p>plugins/contexts/simplecontext.inc implements our context.</p> |
danielebarchiesi@0 | 10 <p>Note that there are actually two ways to create a context. The normal one, which we've been referring to, is to create a context from an argument. However, it is also possible to configure a context in a panel using the panels interface. This is quite inflexible, but might be useful for configuring single page. However, it means that we have a settings form for exactly that purpose. Our context would have to know how to create itself from a settings form as well as from an argument. Simplecontext can do that.</p> |
danielebarchiesi@0 | 11 <p>A context plugin can also provide keywords that expose parts of its context using keywords like masterkeyword:dataitem. The node plugin for ctools has node:nid and node:title, for example. The simplecontext plugin here provides the simplest of keywords.</p> |
danielebarchiesi@0 | 12 |
danielebarchiesi@0 | 13 </div> |
danielebarchiesi@0 | 14 |
danielebarchiesi@0 | 15 <div class="clear-block"> |
danielebarchiesi@0 | 16 <div class="meta"> |
danielebarchiesi@0 | 17 </div> |
danielebarchiesi@0 | 18 |
danielebarchiesi@0 | 19 </div> |
danielebarchiesi@0 | 20 |
danielebarchiesi@0 | 21 </div> |