[SOLVED] Backend: Smart list management (best practice?)

Hi there!

It seems that I’ve a very common question. But I’m still thinking about a “out-of-the-box-best-practice”-solution for Document Node lists in the backend. And I need help to clarify it.

Coming from TYPO3 I’m still affected by TCA and simple list management where I can show always the last created items on top and do not have to think about a high amount of datasets in future.
In my actually case I think about how to manage “News”-Documents. I just have a Document Node “News” and under this an unlimited count of Document Nodes which presents single News-Items. But this is not really a good solution. What will happen, if there are one day 10.000 news-items? Will it kill my site? :wink:

The most interesting thread I found in relation to this topic is this: Neos for large content webpages

I know I could also write a small Flow-Domain-Model-Extension for this to keep it more simple and get a manageable list. But this is not my intention.

So I’m still thinking about, what the currently best practice NEOS-on-board node-based solution for a common matter like this? For simple news management?

Does I really have to create more folders to take the control about the document tree and an unlimited count of News-Nodes? So I have to create under “/News” the Folder “/2020” to add all news of 2020 there. One year later I create the Folder “/2021” and so on?

a) Is this best solution so far without creating some special stuff?

b) And related to this: Is there any possibility to order the news INSIDE THE TREE by their date? Or by their title? I’ve concerns what happen, if some backend users will do whatever they want. How do I control this, that a Document Node list has a fixed order to avoid some mismanagement and confusion? What can I do, that a single News does not disappear between 200 other news?

Kind regards,

Maximilian

Hi Maximilian

In my opinion, the most elegant solution we currently have is the FlatNav package. We use it in a lot of projects for exactly this use case. You can use FlowQuery or Elasticsearch for fetching, sorting and searching the data.

I presented this package at a Neos Meetup, see this video (at minute 129) if you’re interested in learning more. (At this time, search wasn’t integrated yet, in the meantime this is available.)

There’s currently another further development on the way which will allow you to show/hide flat navigations based on roles. This will allow you to e.g. hide the Category tree from normal editors.

Before using FlatNav, we used the Listable package to display such lists in the content area (and only in the backend). This might be an alternative, however I think FlatNav is way better for this use-case.

1 Like

Of course I saw the “Flowpack.Listable” and have it currently installed in Version 3.4.

But the “FlatNav” looks really, really nice. I will try it soon. Thank you!

Just as a side note, but maybe you know that already: In the Node Type definition, you can override how the label of a node is rendered in the backend. So for your news, if there is a date, you can prepend the news title with the formatted date.

Example:

'My.FoobarCom:Page.NewsItem':
  label: "${q(node).property('date') ? Date.format(q(node).property('date'), 'd.m.Y') + ': ' + q(node).property('title') : q(node).property('title')}"

And I would also suggest that you remove the Node Types you have a FlatNav for from the normal page tree:

  Neos:
    userInterface:
      navigateComponent:
        nodeTree:
          presets:
            'default':
              baseNodeType: 'Neos.Neos:Document,!My.FoobarCom:Page.NewsItem'
2 Likes

You can also check out https://github.com/punktDe/archivist to automatically sort news into matching folders.

1 Like

Thank you very much @all. I installed the Psmb.FlatNav package, just copied the given yaml and used the part under “## Example using FlowQuery” (with my custom changes) and it works smoothly.

And a special thanks to @lorenzulrich for this additional hint which was really helpful for me.