Ubercart items on sale
Here's a snippet to filter Ubercart products that are "On Sale" - that is, where the Sell price is less than the List price.
(The 0.005 (half a penny if GBP currency) is included because sometimes the VAT module rounds the prices so a price of £10.42 can appear in the database as 10.41667.)
<?php
$node_ids = array();
$result = db_query("SELECT nid FROM {uc_products} WHERE sell_price < list_price - 0.005");
while ($row = db_fetch_array($result)) {
$node_ids[] = $row['nid'];
}
return $node_ids;
?>Bean
This page contains documentation for the Bean module.
Bean is an acronym that stands for Block Entities Aren't Nodes. This is a play on the numerous "nodes as blocks" modules that were common practice in Drupal 6.
How Beans interface with Blocks
Each bean instance has a corresponding block. Users interact with them in the same way they might use any other block in Drupal. The Bean module does not attempt to interface with the placement of blocks. Bean deals only with the creation of customized, fieldable blocks.
Block Types
Like "Content Types" for nodes, beans have Block Types. A block type is the bundle for a set of block entities (aka beans). Block Types define the configuration model for each individual bean.
How to make a Block Type
Users can create new block types through using the Bean UI or they can program new block types as bean plugins in code within their modules.
How to make a Bean
Placeholder
Developer Documentation
Placeholder
Themer Documentation
Placeholder
Plugins, Examples and Blog Posts
Read moreMetro Reservoir Anglers, Inc. - All electric Bass Tournament Fishing League
Metro Reservoir Anglers
This is a simple drupal site used to manage and create a community around a club. This is a professionally run bass tournament club thats unique in that only electric motors are allowed (due to regulations on the reservoir/lake circuit). However, the site is an example of just a few features, easily implemented that could be used to create a club site of any kind (e.g. soccer team/club, running club, dieting, whatever.)
Template files
Assuming that:
- view name = myfeed
- current display = feed_1
- display plugin = feed
Views RSS provides following template suggestions:
- Style output (these are also listed in Theme: Information on admin view configuration page):
views-view-views-rss--myfeed--feed-1.tpl.phpviews-view-views-rss--feed-1.tpl.phpviews-view-views-rss--myfeed--feed.tpl.phpviews-view-views-rss--feed.tpl.phpviews-view-views-rss--myfeed.tpl.phpviews-view-views-rss.tpl.php
- "Row" output (Views RSS module does not use a row plugin, hence these suggestions are not listed in Theme: Information, although still can be used by copying original views-view-views-rss-fields.tpl.php file from theme subdirectory in module directory):
views-view-views-rss-fields--myfeed--feed-1.tpl.phpviews-view-views-rss-fields--feed-1.tpl.phpviews-view-views-rss-fields--myfeed--feed.tpl.phpviews-view-views-rss-fields--feed.tpl.php
Simple Field
You can read the basics of the module on the project page.
The Simple Field module provides a simplified UI for adding fields and instances, and it also removes some of the complexity of the standard Field UI. One of the important things that is removed is the ability to assign different instances of a field different settings.
When first installing the module, you, as a site builder, should decide what type of users will be using which features. You have a choice in that you can limit users to only create new instances of pre-existing fields, or you could allow them to actually create fields themselves using the simpler interface. You'll also need to decide which types of entities you want to take advantage of the UI, and which ones are admin-only and can keep the standard Field UI module interface.
As a site builder, you will also have to decide what types of fields should be available to different people. Some types are provided by default, but it is likely that you will need to provide more.
Defining types
Currently, the only way to define new types is through code. One big TODO is to make a module to allow admins to create new types. This will only go so far though, because some types that require custom user input when the field is created, which will be tough to define through a UI.
Read moreAdding Functionality Entityforms through other Modules
Module Integration
The aim of the Entityforms is to create a form creation method that leverages the power of entities and fields. For this reason instead of writing custom code it's goal is to leverage the power of other modules that work with entities and fields.
Below are examples of ways to add functionality to through the use of modules that add the functionality to any Entities or Fields
Creating Multi-page forms with Field Group
The Field Group's "Multi-page" feature will allow you to create Entityforms that span multiple pages. View this screencastMultipage feature in field_group. Although it doesn't deal directly with Entityforms the process is the same.
Reacting to Entityform submissions with Rules
The Rules module allows site administrators to define conditionally executed actions based on occurring event conditions ("Event-Condition-Action", see: ECA-rules).
Rules can me used to make custom reactions to events such as submitting Entityforms. It could be used for example to add a Role to a user depending on the value they submitted in an Entityform.
Read more