TYPO3 - Different models for different actions in ExtBase - typo3

I would like to adress different models for different actions in the same controller and the same type of objects.
For example, in List view I need some additional previews of thumbs, and in Detail view I need more fields. In JSON view I need some additional properties.
So, could we organize Models on per action basis, keeping same data tables behind ?

Related

How to include list view BackPack with other components or widgets?

I would like yo add something to the list view in order to make a report.
Is it possible without override the view and had some components or widgets below ?
How can I include the list view several times on a page ?
Thanks for your help
You can easily add stuff to the List page using Backpack Widgets. They basically allow you to include a view within an existing page. You can of course include a custom view (aka custom widget) instead of an existing one.
You CANNOT however include the list view more than one time per page. It's not coded in a way that allows that.

Typo3, Multiple News Details & Lists on one page

I want to use the News system extension from Georg Ringer like this:
Multiple News Details & Lists All on one page
the Detail view on top of the "cards" of the List view should show the Detail of the item clicked on
The behavior seems like to allow multiple list but only 1 detail view
Detail View of "Services"
List View of "Services"
------ other stuff
Detail View of "Projects"
List View of "Projects"
------ other stuff
Detail View of "Sectors"
List View of "Sectors"
Has anyone experience with this?
I would change the list view to handle the first news entry with much more information. In Fluid you have access to all needed fields for displaying it like in detail view.
Then, you only need three list views on the page with your special template. No need for a detail view.
In general it's possible what you desire but you've to adjust the detail-view in the plugins statically to a special detail or you always will only be able to display one detail at a moment, no matter which category because news is like probably all TYPO3-extensions not programmed with the ability to transfer parameters for several plugins on a page at once.
Many years ago when extensions still have been programmed fundamentally different I had some similar desires related to other extensions and programmed something which transferred the parameters always related to each plugin on a page, so it was possible to regulate several plugins of the same type on a page separated. Today it will be harder probably to implement something like that.
What you can do is to look in the manual about the AJAX-posibilities of news. There might be still an option to fetch the detail for each of the categories separated, perhaps even on page-load already, but it will be a nifty setup which takes probably some time.

How to create a form with a header and detail section

Does anyone know of any resources I could access that would show how i'd make a custom form, that allows for a single header section of data, but with a repeating detail section? Such as in an order header with multiple order lines (for example).
I'd like to use the Custom Forms module, and have it so that the end users can create their own header\detail forms without the need for any programmer. The resulting forms would then be exported onto into an integration layer.
Could you be a bit more specific? Are you trying to use the custom forms module for that? or is it your own?
Orchard can use your own Views and Controllers, if you want to.
If it is public-faced you only have to decorate it with [Themed] and instead passing the entire view, can return just a shape.

Controllers, Action helpers, or View Helpers for multi-level tabbed interface

This question is related to the question asked here, regarding the best practice for handling tabbed interfaces. It made reference to a blog post titled, Why the Zend Framework Actionstack is Evil, which outlined that you should use partials and view helpers for elements that will be reused. This is fine until the element has to handle some input, in which case view helpers are not the answer. This is where you use action helpers, Matthew Weier O'Phinney talks about a use case for this in his blog post titled, Using Action Helpers To Implement Re-Usable Widgets.
After reading these viewpoints I seem to be more confused on the best course of action for my interface. The site will consist of three major tabs, Cases, Staff, & Departments. Each of these tabs will follow a similar layout consisting of a selector/search table, a (Case|Staff|Department) summary, and then another area with vertical tab menu. The main tabs will have some vertical tab items that are identical except for the information being displayed.
The question is how do I structure the views, helpers and controllers around this interface. I was thinking of having an index, case, staff and department controller. Creating an action helper which will reuse a view for each major tab, but use the request data to determine the currently selected (Case|Staff|Department). Using the individual tab controllers to handle jQuery ajax requests for the vertical tab content and delegate the output to a view helper which will reuse a common view. And also use the individual tab controllers to handle jQuery ajax crud operations.
Is this the best way to do this, or are there better more efficient methods?
I'd create separate controllers for each of your three main tabs. The vertical tabs you describe would correspond to actions on those controllers.
For rendering all those navigation tabs - top-level and the verticals - it sounds like the answer is.... Zend_Navigation (more info).
You can place all the structured navigation data - probably read from a INI file or from an XML file or even from a structured array - into a single Zend_Navigation container and then render the "active" branch.

Managing multiple views and interactions

I have a table that contains 4 varying types of data and depending on the type of data that is selected by the user, a specific edit view is shown. One of these views has one edit field, a second one has 2 edit fields, a third one uses a picker, and so on. What's the best way to handle these varying views without an explosion of classes and without too 'switch'ing to figure out which data I'm working with?
One way I can think of is to have 4 different view controllers with respective views and then launch each one when the specific item is selected in the table but is there another elegant way to do this?
You can either go with the four different view controllers, or have one view controller that accepts an argument in the initialization for which content to create. The second approach seems to work better when the views are very similar (different numbers of the same controls, etc.)
For your case, some views have pickers, some have text fields... It seems that it might be best just to create a different view controller for each. With this you get added flexibility down the road, even though there is slightly more code to maintain.