Search

Hi symphonians.

I have recently (finally) gotten around to finishing a personal site that I am happywith, and I am trying to write a post/article at least every few days.

I intend to tweet every time I publish an article, but it occurred to me that this could be automated with an extension.

For example - the trigger criteria could be the saving of a piece of content within a certain section, and where certain fields equal certain values.

In my case, it might by the saving of an “article” where the “published” checkbox field is equal to “yes”. This could make a simple call to the twitter API and post a pre-formatted tweet on my account.

Is this something that would appeal to users here? Any input on how to make this useful is welcomed.

Interesting idea! In order for this being interesting for others too, this should be put into an Extension that hooks into entry saving delegates and enables the user to select certain External Triggers for certain Sections (much like you select Events for Sections and frontend forms).

Those triggers should look similar to Events: A custom PHP class that basically does anything you like.

Filtering new entries from edited entries should be done in the trigger file as well (the class provides member variables that enable you to do so). Same goes for editing form values: The trigger fires before the entry is being saved, enabling you to edit values on the fly or blocking saving if any operation (like feeding something to Twitter) has failed.

I’ve done a very similar thing for the Search Index extension. You configure an index for each section, which manifests itself much like a Data Source UI. You create an index for a section, specifying which fields to include, and any filters to run (so you can exclude un-published entries, for example).

When an entry is created or saved the entry passes through the filters. If it succeeds then the included elements are used to build the XML representation of that entry. The XML then has a simple XSL transformation applied to it which outputs the text values of the included fields.

I went the whole way and made the indexes/filters editable through the UI (like creating a Data Source) but the end result is all just stored as an array in config.php for simplicity.

http://github.com/nickdunn/search_index

There is also the old Ping-O-Matic extension which doesn’t do any filtering, but sends out a ping every time you save an entry (regardless of section).

http://github.com/nickdunn/pingomatic

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