Search

I’ve been looking for ways to speed up development of sites by abstracting sections such as news, photo gallery and events. Sections that appear in most websites. I’d like to cut down the time it takes to get these up and running so I can spend my time on the more interesting parts of developing a site.

So I started looking into creating a News Section Extension that when enabled will:

  1. Create a Section with pre-defined settings for fields (will explain in more detail below)
  2. Add in Data Sources for
    • Listing x number of entries (configured in preferences page)
    • Creating a Month/Year Archive
    • Creating an RSS feed
  3. Add in XSLT Utilities for
    • listing x number of entries
    • creating an archive
    • creating RSS Feed

Point 1: I’ve already set up an ensemble with all the necessary Field Type Extensions, my hope is that I could create the section DB tables with the extensions enabled, probably want a check to make sure they’re all there and enabled, I can’t find any php files related to Sections so I’m guessing that all stored in the DB.

Can I just create the necessary tables on enabling the extension?

Point 2: It seems Datasources can be ported into the system by saving them to the data-sources folder in the extension. Is there any problem that could arise there?

Point 3: I don’t see any way of adding Utilities but surely you could leave them in a utilities folder in the extension and call them from your page via the <xsl:import>. Can you use absolute paths?

You’re probably thinking, why not create an ensemble? Valid point. My only problem with ensembles is that they lump everything in together, they backup your entire site as a neat little package (which is awesome) but if you don’t want certain sections of that ensemble, you have to go in and delete/hide sections etc.

I was hoping to create section extensions for a more flexible base to start from. So most websites I build with symphony have a Homepage (Static) section, A Pages section for interior pages and a Contact Page (Static) section with a Form, Google Map and Address/Email/Phone textarea in an ensemble with all my favourite Extensions.

Then I usually start building from there. Create a News/Blog section, Create the Datasources, Build the Pages, Write the XSLT Utilities etc.

Has anyone looked into something like this before or have any ideas/criticism (constructive, of course)… Or I am I just doing it wrong?

Cheers.

I can answer some of your questions :

  • Yes, Sections are stored in the Database (future versions of Symphony do not however)
  • You can port the data-sources by copy and pasting between workspaces but they work by referencing the ID of the sections. So if you create the sections in a different order on each site, they work unexpectedly as they’ll be pointing to the wrong section.
  • Not sure on this one, but yes I don’t see why not. I suppose another option would be to copy the utilities from your extension folder to the /utilities

I guess the easiest way is to create this ensemble before you start to add things that are custom to that site. You could make the ensemble after you create your Homepage, Pages, Contact Page, News/Blogs, Datasources, Pages, XSLT Utilities, before you start to do each site’s customization.

Thanks brendo, I guess its just the lazy developer in me wanting to stop spending time on certain areas of Symphony development. I’m wondering now, would it be worth waiting for 2.1 to set up an import type extension that simply moves the files around into their correct directories and just use your solution for now.

Any idea if this type of wrapping up of entire sections will be easier in 2.1?

It will be very very easy in Symphony 2.1 to do this. Pages and Sections are flat XML files that can be copied between installations, and providing the field extensions are inplace, will be automatically read by Symphony. For more information on Symphony 2.1, check this out. There’s the idea the ensembles could actually act as extensions, providing sections, pages and events. ie. A Blog extension could provide a Blog and Comments section, a Blog Index, Blog Detail, Archives pages and then a Add Comment event. It’s an exciting prospect.

I think it’s worth the wait, creating a white label ensemble that contains your basic sections/data-sources/events/utilities and starting each site using that will accomplish your goal with 2.0.x.

I’ve seen the video and blog posts and to be honest that’s what sparked this idea. I tend to agree with you about the white label ensemble too. Thanks for your help and advice :)

Anytime, best of luck.

I’m so looking forward to Symphony 2.1 for this reason.

In the meantime, I’m building ensembles incrementally with Git. Every time I make a change to the database structure, either by creating a Section, a Page or an Entry, or by enabling extensions, I will export the workspace/install.sql and replace the file in the repository (I’ve created a branch of the Export Ensemble extension to export only this file). That way, every commit I make is a working snapshot. I can check out any state of the ensemble and use it to install a working copy of Symphony.

Using Git also works great for deploying to a live server. Then I’ll have a production branch of the repository that removes the install and update files.

I’m currently using the Forum ensemble as my base install, then building from there. For this ensemble, I’ve created a custom Export Ensemble extension to ensure that all the database tables are properly exported, which also has an install branch just for exporting the workspace/install.sql file.

It’s also a great way to figure out what Symphony is doing behind the scenes, since every change to the database is tracked in the history of the workspace/install.sql file. This is the next best thing to Symphony 2.1.

Oh yeah, another option you could look into is the Smart Setup button used by the Members extension. You can find the button under Members : Setup. As the note says:

Automatically creates a new section, called Members, containing Username/Password, Role, Email Address, and Timezone Offset fields.

It works really well. So, you could use this as a basis for creating your Create a Section Extension.

Holy Crap Bauhouse, that’s an impressive workflow you’ve got there. Unfortunately for me my Git skills are fairly rudimentary, I don’t suppose you’d like to publish how you do that as part of your designprojectx.com tutorials. ;)

Sure, I’d be happy to document my process. I’m just in the process of finishing up phase one of my DesignAdmin project. I’ve taken some time to port my freelance project manager built in Symphony 1.7 to Symphony 2.0.8RC3 as a means of testing out the latest release candidate, and in order to have something to show at the upcoming Symposium in London.

Hopefully, I’ll have time while I’m there. Leaving in a couple days :)

Sorry, this is off-topic, but here’s what happens when your flight is 2.5 hours late and you got to the airport 4 hours before departure. I finally broke down and bought another domain name ‘cause I didn’t think this had a fitting home anywhere else.

Here’s the Git Workflow article I had created a little while ago, but couldn’t think of a good public space to release it to.

Have you guys tried the Database Synchroniser extension? It will log structural changes, much like Bauhouse’s workflow, so you can add an extension and it will log those queries so it can be replicated on another build. The slight caveat is that IDs need to remain consistent, so if you simply run this SQL against a completely different build then it probably won’t work.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details