link to details of a row in a different table

enzo2016

Member
Hi,
I would need to have a link to detail in another list. So for example, by clicking the link to detail, it should appear the detail of a record in another list linked through a databasejoin. The scheme should be the same of the link to detail here in Fabrik when clicking the link of a received reply.
So I have two tables: "Reply" and "Thread". "Reply" is a list with the related data to "Thread". "Reply" is linked to "Thread" through the databasejoin {Reply___title}.
I would like that by clicking on the Title on the Reply list, the related thread appears.
So I wrote in the customized link to detail box:
index.php?option=com_fabrik&view=details&formid=x&rowid={Reply___title_raw}
where x= form id
So in the frontend when I click on the link, it appears the detail of the related list, but it shows only the labels of the form, not the data filled in the form.
How could the code above be amended in order to see correctly the related thread?


Thanks,

-- Enzo
 
The URL appearing is: localhost/websitename/index.php/reply/details/26 (it is the id of the form "Thread")/titleofthereply (it is the content "taken" by the databasejoin element)

The URL has not a rowid maybe because I haven't added it in the code. The rowid should be variable (not always the same) because it depends from the databasejoin.

Thanks,

Enzo
 
Does that join element store the 'id' of the joined table as the value? So in your join element's config, where you select "Value" and "Label", are you storing the 'id' as the value?

-- hugh
 
Thank you very very much for the questions. They helped to find the error.
Yes, the databasejoin had userid as value; I have changed it to id and then looked at the URL and noticed that the the "{" after rowid= was missing, so added it and now it is working ok.The code written in the first post is good. The error was only in my backend because I forgot to add a "{" in the code.
I have seen that the details view does not include the related data referring to the list, so I would need a "link to list" not a "link to details". I have tried the new list plugin "link" and copied the code in the first post (of this thread) as link, but it seems not working.
How can I create a "link to list" (not to details)?

Thanks,

Enzo
 
Well, the link url would be index.php?option=com_fabrik&view=list&listid=X

But I'm not sure what "related date" you want to show. You'd need to add a filter to that URL, like &thread___something={replay___something}, but I don't know what field on threads is relating to what field on replies.

-- hugh
 
Yes, I have tried the following links:
1) index.php?option=com_fabrik&view=list&listid=5(idlist)&thread___id={reply___date_time}
2) index.php?option=com_fabrik&view=list&listid=5(idlist)&thread___id={reply___title_raw}

Both of them worked, but not always. The second should work better because "title" is the databasejoin linked to the thread list. Both of the links seem stop working when the Reset filter (in the menu option) is activated.

Either the first and the second link sometimes are not working because, when the link is clicked on: the following page appearing is the correct list, but the record is blank. It should be maybe normal when the link is set on the date-time element because the URL appearing is:
websitename/index.php/listname(reply)/list/3 (it is the id number)?thread___id=date

but the URL appearing after the link 2) is:
websitename/index.php/listname(reply)/list/3 (it is the id number)?thread___id=id (it is the rowid number)

Is there a way to let work the link also when the Reset filter is activated? Why sometimes does the page appearing (after clicking the link) show a blank record?

Thanks,

Enzo
 
Last edited:
Well that first one with the date isn't going to work. You can't filter on the 'id' as a date ... it's not a date.

You probably need to add &resetfilters=1 to that second one.

-- hugh
 
The databasejoin linking the Reply list to the Thread list is not shown in list, so I could not use it as element for linking the list because I would not prefer to show it in the list. Maybe the only chance would be to use the Link plugin, but it seems not working for me. It is published and I can see the icon on the list, but when I click it: no reaction.
The code I am using for the Link plugin is: index.php?option=com_fabrik&view=list&listid=26(it is the id)&thread___title_id={Reply___title_raw}

Thanks,

Enzo
 
You can put a 'details link' on any element, that uses placeholders for any other elements. If the element you want to use as a placeholder isn't displayed in the list, just make sure "include in list query" is set to Yes.

Can you point me at the list and I'll work out why your Link plugin isn't working. I know I originally missed out a file in the XML manifest for it, spo the Javascript files didn't get installed if you installed it from the ZIP. That got fixed a couple of weeks ago, so you might try just downloading the zip and installing it again, or doing a github update.

-- hugh
 
Thank you very much. About the list plugin, I have just downloaded and installed the last version. Now when I click on the link button, an appearing popup shows: "Select a row".
Then I can only close the popup.
Is a different code needed for the link?

Thanks,

Enzo
 
Last edited:
Yeah, that's an issue I'm trying to solve atm.

The problem being, the list plugin code as-is assumes that the checkboxes will be there. If they aren't (because the user doesn't have delete access and you don't have any other selectable plugin on the list), then you get that problem.

I'm working on it.

-- hugh
 
Thank you very very much Hugh. Will I need to update from Github? I would want to complete the website with Fabrik 3.7 because I am using it. I am going to update to 3.8 after having completed it before to publish online.
Is this update available from the zipped file plugin?

Thanks,

Enzo
 
No, it's not available as a ZIP. Changes in github only get folded into the install ZIPs during a release build. We can individually build plugins for previous releases with fixes from the current release, as the code changes in the plugin may rely on other code changes elsewhere in Fabrik.

Your only option is to do a full github update (so you'll basically be running 3.8.1, the next release). This is always the case with github changes. You can't "cherry pick" them, it's all or nothing.

My advise would be to update now, so you you are testing the code you are going to release on during development.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top