Flow-Community / Community.News

Node-based news extension for Neos CMS
15 stars 6 forks source link

adjust dependency for stable neos 2.0 series #8

Closed testbird closed 8 years ago

dimaip commented 8 years ago

@testbird hey thanks! There's more stuff coming with Community.News, stay tuned.

@Weissheiten hey Flo, hope you don't mind I merged those PRs, seemed legit.

testbird commented 8 years ago

Great, I am just getting started with Neos. What is the stuff you are working on with Community.News?

I am attempting to have two separate blogs and also add event items to my site (to link the news to events). Then, listing the related event news on the event pages, list all news except those of the special blog on the homepage, and list just the ones for the specialized blog one on the separate blog page.

What is your approach in setting up the author, category, and news item nodes of the package in a site? Am I correct in assuming the news item nodes can be created/archived anywhere in the node tree, and the writing permissions for news items may be managed according to the position in the tree?

dimaip commented 8 years ago

@testbird we're going to re-write Community.News on top of https://github.com/sfi-ru/Sfi.Listable

What is your approach in setting up the author, category, and news item nodes of the package in a site? It depends on the project really. Usually I just have something very custom. One thing you have to understand Community.News and Neos packages in general, is that there's not much going on there at all: just a bunch of nodes, selected and listed with different FlowQuery operations: you are free to do absolutely whatever you want, just have to catch the glimpse of TypoScript and Neos.

testbird commented 8 years ago

Thanks for explaining.

What is the benefit of introducing special Sfi.Listable syntax? I do not yet see one over using the shorter standard query syntax, like for the menu in your example: https://github.com/sfi-ru/KateheoDistr/blob/master/Packages/Sites/Sfi.Kateheo/Resources/Private/TypoScript/NodeTypes/PageMain.ts2#L29

The pagination view helper could benefit from a patch for nicer URIs and maybe ajax paging like here: http://zenadmin.org/en/blog/post463.html

dimaip commented 8 years ago

@testbird the idea behind Sfi.Listable is to abstract away the logic for listing things into a separate package, which may be used for a lot more than just News (e.g. blog, list of some records etc).

Didn't quite get what you said about shorter FQ syntax, I think it uses just it: https://github.com/sfi-ru/Sfi.Listable/blob/master/Resources/Private/TypoScript/Api.ts2#L34 You can override the whole collection with any FQ you like.

Pagination already has nicer url, you just have to enable them like so: https://github.com/sfi-ru/KateheoDistr/blob/master/Configuration/Routes.yaml#L13 Soon it would be possible to do it just with setting, but for now it's needed to include the routes from the package manually to main Routes.yaml.

As for AJAX pagination: yes, why not. It's just that I never needed it myself, as I do ajax pagination with turbolinks like here: http://sfi.ru/sfi-today.html

Join us at slack.neos.io if you're interested in providing more feedback and moving this package forward.

testbird commented 8 years ago

Thanks for responding. I think I got it now, with Sfi.Listable one does not need to define typoscript anymore, but can add lists as content elements...

As feedback:

I could not find offsets (skipping to list the first n items (as they may be rendered in full lengh just above the list).

Allow to limit and paginate based on date propertiy? For example, show only past/next month or year, and paginate to past/next year.

Maybe it is also possible to allow defining a custom collection query as list node property?

testbird commented 8 years ago

Ok, I think I finished evaluating, and appreceate Sfi.Listable today. Please take your time as needed to respond to the additional ideas / issues I filed.

When are you planning to switch Community.News to using Sfi.Listable? Does it make sense if i wait a little, to help you test the switch?

testbird commented 8 years ago

Coming back after looking at other packages and Fluid, I'd rather like Community.News not to use Sfi.Listable.

I just don't see a benefit, but rendering details would get defined in a typoscript controller, users may get a wrong impression, and not see flow/neos best practice.

dimaip commented 8 years ago

rendering details would get defined in a typoscript controller, users may get a wrong impression, and not see flow/neos best practice.

What's a typoscript controller? Which Flow/Neos best practice do you refer to? My own best practice, with which most of the core team agree, is to have Fluid templates as logicless as possible, and keep all the logic in TS code. Also I don't see the need of big packages for Neos that try to do everything for you, but rather like to build up my solutions from small reusable blocks that do one thing well. Building one monolith package goes very well against to what I see a neos best practices.

I currently see Community.News a small demo package, showcasing what could be done on top of Sfi.Listable. In real large production projects, you would not want to use something like Community.News, but rather build one yourself, on top of Sfi.Listable or re-implementing the listing logic from scratch. Of course I can leave the Community.News as is, and use some other namespace for this new package. Anyways, @Weissheiten would decide such stuff as he's really the creator of this package.

Weissheiten commented 8 years ago

I agree with what dimaip said - keep the Fluid templates as slim and logicless as possible. We are working on something (possible a talk, might result in a document or at least slides) with our suggestions on best practices for a Neos package in our opinion - in any way: Community.News was designed to be a showcase on creating news for your page showing some basics while being extensible - not as out of the box solution. (and yes - the readme should reflect that which it doesn't at the moment, we're on it :))

testbird commented 8 years ago

To compare, this basic community news package already started to provide out of the box:

1) News document nodes without rigid content restrictions like here: http://www.webwash.net/drupal/tutorials/build-blog-drupal-8-content-types-and-fields

2) News content listing nodes as configured here: http://www.webwash.net/drupal/tutorials/build-blog-drupal-8-using-views However, not yet with configurable node properties (experimental in Flowpack.Listable:List or TitledList? if title is not a content node of its own).