Search

I have a feeling this has been asked before, but searches didn’t reveal anything obvious.

I have a page displaying a list of dog entries. Each dog has a subsection manager field holding flea items with a significant amount of content in each. When the user selects a dog, I want to display the dog, a simple list of its fleas, and the entire content of its first user-ordered flea (as a default). A different flea’s content is viewed when selecting one from the list.

The url for the dog and default:

root/page/dog/

The url for a specified flea:

root/page/dog/flea/

The subsection manager field can be used to generate the flea list and the entire content for the selected flea by returning all the content for all the fleas, but that would unnecessary and rather inefficient.

I can output a dog’s fleas as a list of ids for ds chaining and return the first flea in the list from the source flea section (thus acquiring a flea’s full content), but I can’t control the order of those parameter ids or know which flea the user has ordered as the first in the list.

Does anyone know a good way to get the dog’s first user-ordered flea and all its content without returning all the content for all the dog’s fleas?

If you can scratch my itch, thanks in advance.

Symphony v. 2.1.1 Subsection Manager v. 1.0.1

I’m not sure if I can follow: How should the desired output look like?

Simplified:

I need to:

  • Create a navigation for an entry’s subsection items listed in their subsection order.

<entry#1>
  <subsection>
    <item>
      <name>

<entry#2>
  <subsection>
    <item>
      <name>

etc.

  • Display the first item in that list with all its fields.

<entry>
  <subsection>
    <item>
      <name>
      <field>
      <field>
      <field>
etc.

  • Do the above 2 without returning all the fields for all the subsection items.

  • Do the above 3 without the user explicitly selecting which subsection item to view.

The approach I had hoped to use was to output the entire subsection in its simplest form to create the ordered navigation.

Then I would have output a ds parameter from the entry using the subsection manager field, chaining another ds to fetch the first subsection item with all its fields. But the ds parameter is actually a list of ascending ids that do not reflect the order set in the subsection manager field.

Ah, I see. So your problem is that you need to know the first (ordered) item as a fallback when the item has not explicitly set by the user (= by a page parameter). Right?

Exactly.

I think you’ll need a custom data source that fetches the first item. The sort order should be stored in sym_fields_subsectionmanager_sorting (version 1.0) or sym_fields_stage_sorting (version 1.1beta).

Thanks, Nils.

This was my first custom data source, and it turned out to be a lot less effort than I thought it would be.

My next goal will be paginating the ordered subsection items, but I think that may take a little more exploring.

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