Interspire Website Publisher Blog
Adding categories support into Website Publisher
Adding the Categories functionality into Interspire Website Publisher was quite easy, this is how I did it.
The first thing I did was to create the class that interfaces between the user and Interspire Website Publisher. This class extends upon the API that already has most of the functionality I need (such as loading specific categories or saving them). This provides me with a quick way of getting things going. So, I call it iwp_admin_categories and save it as /admin/includes/classes/class.categories.php.
class iwp_admin_categories extends iwp_categories {
private $Instance;
// etc...
}
With this newly created class I can now begin adding functions as needed. For viewing the categories list, I add a function named View and give it no parameters. This is picked up automatically by Interspire Website Publisher, when the action in the URL is view. What I mean specifically, is the URL structure is dynamic, meaning you can add functions and then use those within the URL. Adding a function named View() will allow an action of view to be used.
public function View() {
echo "Within the View() function.";
}
Within my View function now, I need to designate the template file to be displayed, and set any content that needs to be displayed within it (such as the categories list). The template file will handle the loading and displaying of the categories, interfacing back into this categories object. We've designed the template engine to handle almost any use-case, the categories page is a special instance that we've had to accommodate for specifically. With the use of a foreach loop, and the wonders of recursion, we have a quick and easy way of building the category tree.
{foreach from=%admin_categories.GetCategoryList:'0' key=k item=row id=ViewListLoop}
// Formatting the output of each category here
// Recurse into any children
{recursion=$row.categoryid}
{/foreach}
Regarding the template code specifically, we will be releasing in-depth documentation for it with the release of Interspire Website Publisher and also within further posts in the near future.
All in all, this presents us with a category list that works wonders.
Questions? Comments? I'd love to hear them, just post below and I'll be sure to read and respond.
Introducing Interspire's CMS: Website Publisher
With all the front page news about Interspire Shopping Cart and Interspire Email Marketer (formerly SendStudio) you might be saying "Hey Interspire! You’ve forgotten about your coolest application, ArticleLive!". Well, my overly assumptious friend, you couldn't be more wrong (and try not to use so many exclamation marks next time). We're working hard on transforming ArticleLive into a fully fledged Content Management System. We're taking this transformation in a few steps.
The TransformationAs current customers will know by their product downloads, the first step has been to rename ArticleLive to "Interspire Website Publisher". We believe this more accurately depicts what the product does, rather than restricting it to just an "article manager". It also reflects the direction of the program as it will have a much larger range of practical application. You'll still be able to use it as an article manager, but you will also be able to use it for many other purposes such as a standalone blog script, a small business website, a community website and pretty much anything you can think of.
The second step in the migration to CMS land will be Interspire Website Publisher 5.0
which has a major overhaul of the code in addition to changing how things work
within the application. Interspire Website Publisher 5.0 will require PHP 5.1.2 or above. We're pushing this up as we expect most hosts
to migrate to PHP5 (a lot already have) as PHP4's end of life nears in August. In addition to this is PHP 5’s
superiority over PHP 4 which allows us to do so much more than we could before.
If your host does not have PHP 5.1.2 or above, you'll need to request they install it or find another host who has it. A lot of hosts currently have the option to use either PHP 5 or PHP 4. You can check what version your host has by checking your control panel or asking them. The current version of Interspire Website Publisher (4.5) will work with PHP 5, so if PHP is upgraded preparation for Interspire Website Publisher 5.0 your website will still function properly in the mean time.
Over the coming weeks I'll be going into detail about the new features and functions of Interspire Website Publisher 5.0. Future posts will cover the new template system, modules and lists/menu generation. In this post I'll give you a peek at what we are currently calling "Content Types".
Before I jump into any details, please note that the application is still under *heavy* development, so any (or all) of the features mentioned or pictured here may change significantly before the final release.
Content Types
'Content Types' is our current term for a set of rules that define what a group of content items is made up of. The best way to think of it is to use the current state of Interspire Website Publisher where there are articles, news items, pages and blogs. Think of each of those as a “content type”, where they each have different fields and options in addition to being displayed differently. In Interspire Website Publisher 5.0 these content types will be dynamic, i.e. you’ll be able to create your own content type or edit an existing one.
Creating/Editing a content type consists of choosing which fields the content type will have, then selection options for each field. For example, you might just want a simple ‘pages’ content type which just has a title, content and meta content. For that you’d select your fields and toggle the options for each one. Title won’t have options, but for content you can select to toggle whether to use a text area or a WYSIWYG editor. For the meta content you can choose to automatically generate it or allow the option to enter it manually.
I’ve got here a screenshot of where we are at. This is of course an early shot, so may or may not look like this in the final release. As you can see adding or removing fields consists of dragging or dropping them into a list where you can also group fields and even put them into additional tabs. This constructs what fields the content piece has, as well as what structure the create/edit page will take.
Once the Content Type is saved, then you will be able to create a piece of content within that Content Type. Using the ‘views’ system we have in Interspire Shopping Cart, you’ll be able to view all content pieces of a certain type, that match a search term or other criteria. Managing a website will have never been easier.
All current features will exist in the new release, so when upgrading you won’t be losing anything. When upgrading from the current ArticleLive/Interspire Website Publisher 4.5, the process will automatically recreate pages, blogs, articles and news items (unless empty) using the content types system. From there you will be able to edit each of those content types to add or remove fields. Want categories for blogs? Drag the categories into a group in the blogs content type page and you’re done!
When installing from scratch you’ll have the option for advanced mode or simple mode, where simple mode asks you what you will use your website for and constructs the content types automatically for you based on your selection.
I hope you’ve enjoyed this sneak peek into Interspire Website Publisher 5.0. Next week I’ll have more information on another section of this major overhaul. If you have any comments or questions I’ll be happy to answer them in the comments section.
