 |
|
Wednesday, September 29. 2004
Not at all Syntax related but I was looking at PHP Presents today and am quite impressed by the range of presentations available. Does anyone know if there are similar presentaion repositories available for HTML, MySql, or other LAMP components?
Monday, September 27. 2004
Version 1.1.1 of Syntax CMS is available Syntax CMS 1.1.1. This release bundles a number of bugfixes and minor feature improvements:
- Various fixes to make syntax less dependent on register_globals being on
- Added :hover styling for rows in navigation widget to make it easier to pick out where to publish/feature content.
- Added htmlarea textarea WYSIWG editor as an available widget.
- Display fixes in Site Administration application.
- Added _link() method to simplify outputing href tags.
- Standardized use of NAV_ROOT_EL to build out section paths, breadcrumbs, etc.
- Improved CSS style of Site Administration app.
Thursday, September 16. 2004
The ListWidget class goes a long way towards making it easy to work with input widgets for lists of options. One of the most common uses of it is for building filtering interfaces based on a picktable in your syntax database. Usually, to do so you have to jump through a small number of hoops.
pxdb_import( 'content.output.pxdb_picktable' );
$picks = new pxdb_picktable( 'topics' );
$topics = $picks->get_listwidget_array();
// add default 'All' option at top
$topics = array_unshift( $topics, array( 'value' => '', 'label'=>'All' ) );
$topicsList= new ListWidget( $topics, 'topic' );
Now in cvs, is a single function that replicates the above lines. Its signature is list_from_picktable( $form_element_name, $pick_table_name, $additional_elements). The $additional_elements parameter is primarily there for adding a default or 'All' element at the beginning of your list.
$topicsList = list_from_picktable( 'topic', 'topics', array( 'value' => '', 'label'=>'All' ) );
Tuesday, September 14. 2004
One of the task's we're often asked to do is save input from a form to the database and also send a notification message to a recipient. Recently I had to do that and include the record's data as part of the email message. While it's easy enough to build a custom message each time, the following solution builds the message body based on a defined view for your datatype. You'll need a newer copy of the metadata.pxdb_view class as I had to add a method to it allowing you to create a pxdb_view object based on the datatype id and view name. The main benefit to this approach, beyond it's flexibility is that we can add new fields to our view and the email sent out will automatically include those too without further intervention on your part.
if( $rec_id = $adm->save() )
{
pxdb_import( 'content.output.pxdb_record' );
pxdb_import( 'metadata.pxdb_view' );
// success! -- $rec_id is saved (or added) record id
$view = "success"; // for redirection later
// now get the just saved record back out of the database
$record = new pxdb_record( $rec_id );
// start building our email message
$msg = "A new feedback message has been sent:\n";
//get the 'public' view for the FEEDBACK datatype. We used
// this view to present a form to users.
$view = pxdb_view::fetch_object_view( DATATYPE_FEEDBACK, 'public' );
// build the rest of the message based on the fields used
$viewfields = $view->arr_typesfields();
while ( list(,$viewfield) = each( $viewfields ) )
{
$msg .= "\n ".$viewfield['displayname'].': '.$record->get_field( $viewfield['identifier'] );
}
// send it off to the intended recipient
mail( FEEDBACK_RECIPIENT, FEEDBACK_SUBJECT, $msg, "auto@".$_SERVER['SERVER_NAME']."\r\n" );
} // end if
Friday, September 10. 2004
Version 1.1.0 of Syntax CMS is now availabler for download as a gzipped tar file: Syntax CMS 1.1.0
The PHP source is also available to anyone via anonymous cvs:
export CVSROOT=:pserver:anoncvs@cvs.tigris.org:/cvs
cvs checkout -d syntaxSandbox syntax-cms/src
Thursday, September 9. 2004
The listwidget class depends on register globals being on to determine what value(s) in a list is selected or checked.
if($currSelected === false) {
global ${$elementName};
$this->selected = ${$elementName};
} else {
$this->selected = $currSelected;
}
Friday, September 3. 2004
Filtering by a parent object, such as a seciton, was previously a needlessly complicated process that involved setting up a parent filter and adding it to your main filter via add_parent, as show below:
$sectionFilter =& pxdb_search::filter(DATATYPE_SECTION);
$sectionFilter->add_value('id', $Request->getVar('in_section'));
$content_filter->add_parent($sectionFilter);
The latest CVS snapshot simplified add_parent by allowing it accept either a pxdb_search filter, a pxdb_record or descendant object, a numeric record id, or a record's idnum value. This makes it easier to filter by parent objects since any of the following are now valid calls. The add_parent() method will handle all the filtering internally.
$content_filter->add_parent( $Section ); // seciton is a pxdb_record descendant
or
$content_filter->add_parent( $Section->get_id() );
or
$content_filter->add_parent( $pxdb_record->get_field( 'idnum' ) );
Wednesday, August 11. 2004
I've updated the source code documentation to reflect the changes and additions we've made to get it ready for release.
Monday, August 9. 2004
For Sections, breadcrumb trail is automatically set based on the hierachy of sections and the page title is set to the last section in the trail. When you're working with modules, to add elements to the breadcrumb trail and set the page title you only need to do one thing: add a trail point to the Request object. Its probably best to only do this if the request is not an internal module request:
if (!$Request->isIncluded())
{
$Request->addTrailPoint( array( 'url'=>$_SERVER['REQUEST_URI'], 'crumb'=>$Record->get_field( 'name' ) ) );
include_once(SITE_TPL_PATH . '/header.tpl');
}
Wednesday, August 4. 2004
This post is mostly to test is the Images feature of serendipity is working. Below is a fuzzy screencap of the latest version of Context, the admin tool used in syntax cms. It has come a long way from ugly html table hacked layout to more CSS friendly layout. I particularly like the fact that content types with content waiting to be approved are bolded ala email programs. Of course, that may be because I added that feature.
Wednesday, August 4. 2004
We've got a Freshmeat listing for Syntax if you want to be keep up on releases via there.
Friday, July 30. 2004
Syntax CMS now lives on Tigris, which we'll be using to coordinate and communicate with other developers. We're pleased to announce that we are releasing Syntax CMS 1.0.0.
Friday, July 30. 2004
James Robertson is starting what should be an interesting series of postings on Content Management System myths. This particular article, CMS Myth #1: Installing a CMS must be hard, highlights what a client or CMS user should expect when setting up a new system.
Nowadays, however, many organisations have pretty simple needs. They want to publish a website, containing mostly static content with a handful of extra features (such as secure login, online events calendar).
If you fall into this category, then you can reasonably expect CMS products to install out-of-the-box. That's not to say you won't need some vendor assistance during the initial project, you will. What you won't have to do, though, is customise the product.
While we can't claim that Syntax CMS is super easy to install out-of-the box, once it is up and running, I think we hit the majority of the do's and don'ts he highlights. Out-of-the box you get the authoring interface, publishing system and can start creating your own pages and putting content on them. You would still have to update the templates to give your site its own particular design.
Wednesday, July 28. 2004
It might be good to use the thumbnail generating class at http://phpthumb.sourceforge.net/ as the thumbnail processor available. It has a number of features that would be nice to enable via parameters or wrapper processors:
- A border (configurable color & width) can be applied.
- Thumbnails can be a fixed dimension regardless of source aspect ratio and background filled with configurable color.
- Border corners can optionally be rounded (independant horizontal & vertical radius)
Tuesday, July 27. 2004
Most of the time when you're building a web site, you are pullng information from a database according to some criteria and then formatting for output, usually HTML but it could be RSS or XML or something else entirely. The way to handle this in Syntax CMS is to create a list capability within a module. You'll probably end up having a module per datatype to handle the various individualities of working with different datatypes. This tutorial shows you a general approach to writing flexible, reusable, and powerful list capabilities that can then be called from section templates or even other modules.
Continue reading "HOWTO: write a powerful list capability"
|
|