Joomla 4 - View with multiple parents - joomla

I'm trying to setup the router configuration for the first time in Joomla 4 and ran into a problem. I want to show the same item below different parent views. The parent views generate lists with items and for details i want to show the items on the same url, below the parent.
There are three Views a user could add in the menu: Listing, Search and Item.
These URls should be possible to generate:
/search/item1
/listing/item1
/item1
The problem is that i can only generate these urls if i set something like
$itemView->setParent($searchView)
Or
$itemView->setParent($listingView)
But i need both, depending on the Menu-Item where the item should be displayed. Without setParent i get URLs like /search/?view=item&id=xx.
I'm happy for any ideas!

Related

Recommendations for developing Laravel User account pages as SPA?

Looking to rebuild account pages for users of a Laravel 8 based application using something like Inertia/Livewire, Vue/React to make just the account area an SPA. User accounts currently have many pages in which to manage their items and have a dashboard that summarises item data that link to item listing pages for managing.
Ideally the new dashboard will have component based widgets which would load the HTML with temporary place holders for the items whilst the data is being requested. Not sure what would make a better user experience, having the whole page show temporary place holders for dynamic data and then all populate at the same time or populate each component as and when the data is ready.
Would it be more efficient to have each component request its own data individually or should each component specify what data it needs to the parent component (dashboard) which then does one request for all widgets?
The widgets would link to item listing pages where users can manage items. The way the listing pages should work is very similar to that of Asana, when an item is selected it opens a panel to the right of the list which loads the data related to that item. Again, when the panel opens it has place holders until the data requested has been fetched.
With Inertia the data can be queried in the controller and then passed as props to the view that Inertia renders. Items would be passed in this way and then listed on a listing page component. The URL should update from /items to /item/123 when clicking an item so it would have its own dynamic route that passes the item id to the relevant action.
Would this have its own action separate from the one that gets the initial list of items?
The list still needs to be there and used to click between items so was thinking it could actually use the same action?
Items could be in the thousands and will have filtering options so pagination and throttling will be necessary.
Been looking at Inertia with Vue so far and it looks to meet requirements, can’t change from using Laravel 8, just wondering what approach would be most suitable or if there is another approach that should be considered. Interested to hear how others might go about it.

Cannot set selected elements for the list module on Joomla Fabrik extension

I am using free version of Fabrik extension on Joomla. Both my Joomla and Fabrik are the latest version
I have already done with the Fabrik structure part such as create the form, elements, group, list, and set the form order, validations, appearance, and make them all works. Any registered user can submit the data using the form and it'll be stored into a table on the database
On the front-end, the idea is the user can view two different list view modules through his/her profile, a private list and a public list
Module A lists only entries submitted by the user. The list show the whole entry's data
Module B lists all of the entries submitted by everyone. The list show only selected data from selected field from each entry
This where the problem came from. When I gonna create a module for the list view (Fabrik List Module)
Module Manager > New > Fabrik List Module > Advanced
After I set the title and the list, when I clicked on the 'Select' button for attribute 'Elements', it just response me like I just clicked on 'Cancel', and redirect me to the modules list table instead. If it is just an unfixed bug, I can do nothing about it, but I guess it'll be a lot easier if I can just set something directly using database admin
Finally, after some little hacking, i've succesfully figured it out. Go to [pre]_menu.params (for menu item) or [pre]_modules.contents (for module), and you'll see some json like this
{"calculations":"0","listlayout":"bootstrap","resetfilters":"0","list_elements":"null", ....}
Just replace list_elements value from "null" to this
"{\"show_in_list\":[...]}"
[...] contains the list of elements id (inside table [pre]_fabrik_elements) we want to select them on module view, for example [1,2,3,4,5]
updated :
It's very unpractical solution to just modify the joomla data directly on database. Actually, especially in similar case to mine (sure it is a bug), you can select the elements for a list view (as asked) by simply creating a new separated list apart from the auto generated list which is generated by default on form creation.
That new list will automatically generate new set of elements with new ID based on database table structure, and plus they will not shared their setting with the default list. Alter the default list should definitely be avoid as it will totally change the behavior of the form
On the new list, you can simply un-"show in list" any elements you don't want to show, and create either menu item or module linked to the new list. This is also the best way if you want to alter the list displaying such as change the list header field title, change the list description, or join others elements to the list

SEF urls are not takinf alias.html name of menu item in joomla1.5

I have two menu links of my component com_listing whose links are as follows
index.php?option=com_listing&view=catlist&Itemid=134
index.php?option=com_listing&view=catlist&Itemid=135
Both menu item have component menu item specific parameters of parent category and child category .by setting these two parameter values each link will show different data although they are the same link but their menu item specific parameter in menu item is different.
They are working fine and showing different data for their links
index.php?option=com_listing&view=catlist&Itemid=134
index.php?option=com_listing&view=catlist&Itemid=135
according to Itemid i am retriving the parameter values and hence getting different data on the same link on different itemid but when i am accessing above menu links in SEF then it is creatiing the same url as "catlist.html" .I am using the SH404 Component for SEF
on the url catlist.html it is showing only one type of data means itemid is coming same for both of the urls and also the url should be blog.html and catelog.html since the alisa
of those items are blog(for Itemid 134) and catelog(Item id 135).I have done lot's of surfing but not getting any results and please do mind i can not use create links of type "menu alias" because of the different parameters please help
Your problem is because you do not have unique title aliases in your menu items. When you have SEF URLs turned off, you have the itemid as part of the query string so Joomla knows which menu item to use to pull the parameters.
When you turn on SEF URLs, there is no query string so Joomla has to use the title alias catlist.html to figure out which menu item to use. Since it has 2 menus with the same alias, it just uses the first one that is returned in the query since there is no other way to tell them apart. Change the title alias of one of the menu items to catlist2 and you will have 2 unique URLs that both show what you want.

Dynamically modify itemid based on current menu

I have a site where a series of articles need to show up under two different menus. Depending on the active menu, different modules are displayed. The problem is that the internal links in the articles have an itemid in them which ties them to only one menu.
The solution I have in mind is to modify index.php for the template I use for those menus, and do a search and replace for all internal links - setting the itemid based on the current id. Keeping in mind that mod_rewrite won't work in this situation, is there a graceful way to do this in Joomla?
I suspect that I'd need to take
<jdoc:include type="component" />
and, instead of just including the component, read the content into a variable, do the search and replace and spit it back out. How might I go about doing this?
Are there simpler approaches to this problem?
Just remove the item id from the internal links. By default, the item id should be inherited from the current item.

Orchard How can I style the summary of list items different in a page versus a widget

I am new to the orchard project, and have not been able to track down how this could be done (assuming its possible).
I have a data list called "Events" in which I have attached a list of custom data type objects which are of type "Event". I then have put a view of this list in a widget on my homepage - as well as displayed the list view page by adding it to my main menu.
I have found the information to update the summary of these list items by adding the proper view
for example adding the following view:
\Themes\PeaceCamp\Views\Items\Content-Event.Summary.cshtml
<div class="event">
<b>#Model.Title</b><br />
</div>
however this seems to update the view in the widget, as well as in the list view page. Since pagination only affects the page view - I presume there is a way to summarize them different in the two different areas - hoping someone could explain or direct me to the proper location to do that - Thanks!
My solution is all local at this time, so I cannot provide links as examples - and the only thing not done in the CMS would be the view added above.
You could add your own IShapeTableProvider (the stuff you describe comes from the Shapes class in Orchard.Core.Contents) that walks up the shape tree to find a parent zone and adds alternates accordingly.
This post might give you some ideas on how to do that:
http://weblogs.asp.net/bleroy/archive/2011/01/10/orchard-shapeshifting.aspx

Resources