Search

Hi, I have a question for you guys. This seems to be a common issue so I hope you find a great solution ;)

I must make a CMS of a promotions section for my client.

The problem is that there are 3 kinds of promotions:

  • category: an image, and link
  • booklet: a link to the PDF reader
  • a single product: a title, text and an image, price before, price now

All categories has a “short title” and “short description” in common.

The problem is that they are all displayed together and there must be a possibility to order them together. “Order entries” extension doesn’t work in this case.

One solution could be to have a single section with a “promotion type” select box. But then, there would be tons of unneccesary fields for any type. A booklet doesn’t need an image, a category doesn’t need a text, a single product doesn’t need a link, and so on. My client obviously doesn’t accept that.

My idea is to write an extension that hides unneccesary fields depending on the choice in a “type” field. But it doesn’t seem to be an easy task (especially the part responsible for “creating the field”).

Publish tabs! They would be helpful. I haven’t seen them but they seem to be a great stuff. I could send every promotion to a seperate tab. But no stable Symphony 2.2 so far…

What would you do?

I probably would create a container section (with the general fields) and link entries from the promotion sections (with the specific fields) with either the Subsection Manager extension or the Selectbox Link field into it. This way you your datasource output is much simpler and easier, e.g. you don’t have to combine entries from different datasources into a single stream of entries.

It seems clumsy to me.

  1. Creation of a new promotion demands two entries.
  2. Creation of the second entry demands looking for the first one. In my case, there is a one-to-one relation between general fields entry and specific fields entry so I don’t think that any subsectioning or linking is ok.

Can you fully outline/describe the sections? I’m a little confused as to what the content actually is.

If you want to use Publish Tabs it’s a teeny tiny update to 2.1.1 to get them working - one line of code.

Can you fully outline/describe the sections? I’m a little confused as to what the content actually is.

Sure. Three kinds of promotions:

CATEGORY:

  • Short title
  • Short description
  • Image
  • Hyperlink

BOOKLET:

  • Short title
  • Short description
  • Hyperlink

PRODUCT:

  • Short title
  • Short description
  • Title
  • Description
  • Image
  • Old price
  • New price (the better one, I have no doubt :P)

If you want to use Publish Tabs it’s a teeny tiny update to 2.1.1 to get them working - one line of code.

Wow, I’m blind. I’ve changed the line, installed the extension, added tabs and… there tabs visible but all fields are shown together and when I click on any tab, nothing happens :(

Here is my solution, it’s a bit clumsy but I haven’t figured out anything better:

There is one section with all necessary fields. I show on a publish page only the fields which all promotions have in common.

I created a little extension which loads a JavaScript script. The script tests whether we are on a promotion edit/create page. If it is true, then it shows/hides different fields depending on a selectbox field with a promotion type. It is absolutely inflexible because I identify fields by their ID which is hardcoded in the script.

But for my little purposes it works nicely :)

Thank you for all your help!

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