Search

What's the best way to allow empty values for section link select menus. For example, I have a Select Box field for a section called "Items" that which dynamically lists entries from a section called "Entries". An item can be one of several Types (also a section):

  • Applications
  • Bookmarks
  • Books
  • Files
  • Images
  • Sites

So rather than have a section for each with several fields that are very much the same, I can have a single section and specify the type of asset along with all the related metadata.

  • Title
  • URL
  • Type
  • Entry
  • Description
  • Body
  • Date
  • Category
  • Tags
  • Image (stored in images)
  • File (stored in uploads)

I need enter only the data that applies to each asset. The XML neatly outputs only the elements and values that are entered, keeping the data optimized, which is brilliant. I can also relate several different types of assets to a single entry and categorize them by type. I discovered that the order set in the section list view becomes the order of the data in the XML. Also brilliant. I suppose that the display of data could change on the front end inadvertently unless an xsl:sort instruction was explicitly given for displaying the data.

The same data order, however, does not apply in the case of section link menus. It appears that these items are listed according to the date/time the entry was saved. Any chance these items could inherit the same order set by the selected sort column and order?

Also, what is the best way to specify an empty value. I have assets that I do not necessarily want related to a specific entry. You have allowed both Static Options and Dynamic Options for Select Box fields. Again, brilliant. I tried a space character as a Static Option, which did not register as a valid value. I used "-- None --", which worked, but did not seem to me to be very elegant.

So, I ended up using  , and this seemed to work best. Would that be the recommended method of displaying an empty value?

It appears that these items are listed according to the date/time the entry was saved. Any chance these items could inherit the same order set by the selected sort column and order?

I agree. I think it would be correct and more flexible to have the order of the sections based on their sort order in the admin. I would file this as a bug.

Would that be the recommended method of displaying an empty value?

I think the very nature of a select boxes that a value must be chosen, even if the value is none. The following appears to be advocated by the W3C:

<OPTION selected label="none" value="none">None</OPTION>

Thanks, Lewis. I'll file the bug and follow the W3C recommendation.

I discovered that the order set in the section list view becomes the order of the data in the XML.

Are you sure this isn't just coincidence? Data sources let you specify which field to sort by, so whether or not these are the same is up to the developer.

Any chance [dynamic select box options] could inherit the same order set by the selected sort column and order?

It seems they're currently ordered by system date, which is a bug. I believe they should be ordered alphabetically rather than sorted by the field set on the section's entry list page. Consider the following scenarios:

  1. The user tries to select a particular category from a list. If the list is ordered by something other than the displayed category name, the user is required to check each item sequentially until finding the right one.
  2. The user changes a section's entry list sort order/field to aid locating a particular entry. Suddenly the edit pages for all of that section's entries look different because all select box fields' options have be rearranged.

I think alphabetic sorting should be the default option for all select box and tag list fields due to this scanability/usability reason. The only exception should be static options, so select boxes should be displayed according to [static options in order listed] [dynamic options sorted alphabetically].

Does this sound like a reasonable solution?

Maybe it was a coincidence. I didn't spend a lot of time testing the entry list sorting. I just noticed that when I changed the sort order in the back end it also changed on the front end. So I thought it was an intended behaviour. It did concern me that a user could inadvertently modify the front end by changing the sort order of the section entry list.

I think alphabetic sorting would be best as well. That does sound like a reasonable solution.

On the other hand, I suppose there might be times when I would prefer to list items in descending order, in the case of a list of dates, for instance, or project numbers, where I would rather have the latest first. Is it possible that this could be set as a preference for a select box field? If not, I suppose creating a custom admin page would be best in this case.

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