Search

A new Extension, “Static Section (Field)” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

Provides a simple means to set individual sections as static.

Once a section has been set as static the interface for that section is locked down to ensure that only the primary entry for that section can be edited (or created if none exists).

COMPARISON

Standard Sections
Standard Sections allow the section (with its various fields) to be created as multiple individual entries.

Static Sections
Static Sections only allow one entry of the section to be created (if none exists) and for only the primary entry to be edited.

WHY
This extension removes the need to explain to your client why they shouldn’t create new entries or delete the existing one in your psuedo-static sections.

DOWNLOAD
The latest version can be downloaded from GitHub at: http://github.com/knupska/static_section/tree

USAGE
Once installed, all you have to do is go to the ‘Preferences’ page and select which sections you would like to make ‘static’.

In a nutshell it’s for those cases where you only want to provide a single page of options to be edited eg. site-wide settings, metadata or even just content for single use pages.

NOTES
1. If you add it to apply it to a section that contains more than one entry to begin with, it will not modify your additional entries, it will only hide them from being viewed/edited. 2. As the extension does not modify the data services, if you do have additional entries as per note (1) these entries will still be exported by any data service you that create.

DISCLAIMER
I’m actually a Flash Developer by trade so if any of the PHP I’ve written somehow causes eyes to bleed I apologise in advance :-)

If I’ve done anything completely wrong in regards to accessing internal Symphony properties/methods (read: taken the long way around), please point me in the right direction so that I can optimise.

Best of luck with it & I hope it is of some use to the community!

One word: #win.

@Knupska - this is a great idea! Thanks for sharing!

@Knupska: I concur, genius. The less I have to explain to clients the better :p

@Knupska: Wow!

Obviously your extension has the same goal as skeary’s Page Fields extension, but is much more lightweight.

If you download the extension from GitHub, it will not appear in Symphony’s extensions overview because of naming conventions. I had to rename the extension folder to “static_section” in order to make it work. The ZIP from GitHub will unpack with a name like “…static-section-field…”, which could be a showstopper for some people. So maybe you can rename the repository? [EDIT]: Ok, I see, if you read the README, this shouldn’t be a problem…[EDIT END]

I see some limitations in this solution, e.g.: Removing the “delete” button for the visible entry via JavaScript is not very “bullet-proof”. But I do not really care, because I love simplicity. (So please don’t even think about changing this!)

So all in all this extension is, hmmm, let’s put it this way: super-cool! Thank you!

Insanely great. Thanks!

Thanks for the kind comments everyone :-)

I’ve updated the extension in github to address michael-e’s concerns above and have also fixed an additional issue that he raised in github.

Incredible idea! Great thinking and execution.

@Knupska Just one problem, the content of first field appears in title.

@rainerborene: Can you explain this issue further?

@michael-e For example, my static section has a textarea field and his content it’s appearing in page’s title. I think it’s better appear the name of section. What you think?

Ah, in the Backend (aka Symphony admin)! This is the Standard Symphony behaviour. If you go to a standard section (without Static Section field) and choose an entry there, you will have the same page title systematic. So the extension simply does not change the Symphony page title logic, I guess. (Unless I have overseen s.th. – Knupska will maybe know better…)

@michael-e I tried to change this behaviour and the results wasn’t as I expected. The method setTitle of AdministrationPage class creates another title tag instead of replaces the text of current title. However, it’s a great extension!

Yes, it is. Knupska did a great job.

@rainerborene Thanks for pointing this out. I’ve now modified the extension to always display the name of the static section as the page heading. This also has the added bonus of overwriting the ‘Untitled’ heading that was previously being displayed before the entry was added for the first time.

Now I see you were talking about the h2 on th edit page. I was talking about the page title (element), which appears in the title bar of the browser window. The latter is completely OK for me, as it is “Symphony standard” and it probably won’t distract authors.

Changing the h2 is indeed a good idea. Thanks.

This is going to be really handy. Quite often we create a “Settings” section that houses global content such as global title, footer text, a telephone number etc. This will make it much easier to prevent clients creating new entries :-)

I am afraid that knupska is no longer an active Symphonian, since he has not cared for the bugs I posted on GitHub (nor has he been active in the forum for a long time).

I made another try, forked the repo and sent two pull requests.

My repo is here: http://github.com/michael-e/static_section

Have you tried contacting Nathan directly?

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