5.4 Creating new ops or features

The first question you are probably asking if you are new to Scoop development is, what exactly is an `op' and how would I use it?

From the programmers perspective, an op is a way of representing the primary function that will be called to handle a particular page request. The relationship between an op and the function that will handle that page is defined using the Ops Admin Tool (A.16), as are a few other important details such as how the path after the op name is translated into CGI arguments.

From the user perspective, an op is the first directory of the page they're requesting, and indicates what the page they request will do, in general - for example, the `story' op will display a story. When creating new ops and features, it is important not to confuse this expectation.

Features and ops don't always correspond directly; sometimes features will use more than one op (like advertisements, with showad and submitad), others will use exactly one op (like hotlist), and still others won't have an op at all (like spellchecking).

When planning features, make sure that your feature fits the way Scoop does things. If you have an idea for a feature and would like feedback on its design within Scoop, feel free to post a detailed description of your idea and how you plan to do it to http://scoop.kuro5hin.org/ or the scoop-dev list (1.4) for comments.

Whatever the feature is, anything that can be configurable should be, via Site Controls, Blocks, whatever else is appropriate. At the absolute minimum, a new feature should have an ``on-off switch'' set by default to ``off'' so existing sites don't have their functionality changed without the admin knowing about it.

Any HTML output by the feature should be either in a box or a block. We're in the process of taking all the HTML out of the code, so please don't put more in! In general, the HTML will be handled easily by blocks, sometimes with special keys as required and very occasionally by boxes. Typically the HTML will be in a block, special keys are filled with values from the database (usually not formatted; the formatting should happen in the block), and for certain form elements (such as a SELECT) that need to have a particular default selection, a box would be appropriate.


janra
2004-03-26