Showing related list records inside of a form

laztech

New Member
Showing related list records inside of a form - How To

Alright. I have two lists, one for incident reports and one for subject files.

What I want is for the subject file, when viewing the data as a form, to show a list of incident reports on the form that are related to that subject.

Example.

Bob vila breaks into this old house(See what I did there? :p). He's been caught and the security officer is writing up a report. The security officer notes the subject, Bob vila, in the incident report. The security officer also creates a subject file for Bob vila.

When the security officer goes back at a later date to view all data on Bob vila, I want them to be able to look up the name, bob vila, click on his subject file and view it. In that view, it should show the details of what was filled out in the subject file, as well as links to the "this old house breakin" incidident report.

I've been doing a lot of looking around and it looks like related data and database join might be the method I want to use, but I'm unsure and still slightly unclear how to make it work even after watching and reading the tutorial and wiki. I'm sure something similar to this has been done before, so I'm looking for someone to guide me in the right direction of what I want to use to procure this result.

Thanks in advance!
 
You should be able to add a call to the Fabrik Joomla content plugin in the form's intro or outro text.

So say you're incident report list has an element called subject_id, which contains a reference to its assocaited subject file record.

You are viewing the subject form, so we have a placeholder 'rowid' that contains a reference to the current subject form.

You can embed the list and filter the subject_id on the current rowid with this code:

Code:
{fabrik view=list id=X incident_report___subject_id_raw=[rowid]}
 
It seems I'm close, it is interpreting the rowid in the line properly, however, it's not producing the form, just the line of text. I even copied the full element name right out of the element.

I've attached an image of what appears, is this a glitch? Or am I doing something wrong?
 

Attachments

  • almost there.png
    almost there.png
    25.2 KB · Views: 454
I just realized I was looking at it from the back end, and that didn't work last time, but I just made it so I could observe it from the front end and it still doesn't work as you can see.
 

Attachments

  • notiteither.png
    notiteither.png
    109.2 KB · Views: 441
ah I forgot to mention to check that under the options tab the '
Process Joomla plug-ins' option is set to 'detail and form view'

I'll move that option into the details tab, as it effects the intro and outro text, it makes more sense for it to be there.

-Rob
 
With this update, when I change it to detail and form view, everything goes into chaos when I view a form. See the image.
 

Attachments

  • detailandform.png
    detailandform.png
    31.5 KB · Views: 433
I dont see that, in fact i didn't see any list outputted as for the default bootstrap template we were missing the echo $form->outro from the end of the template> I've now corrected that in github

What url is this on? What placeholder ({fabrik.....}) text are you using?
 
The screen I showed only seems to appear in the backend view of the data. The front end does show the form, however also shows some errors.
 

Attachments

  • awesomerrors.png
    awesomerrors.png
    99.3 KB · Views: 369
However, while the form does seem to be appearing, the incident report that the subject is named in, does not seem to be appearing as you can see in the image.
 
ahh back end!
That should be fixed, if you are updating by downloading files and not git then you will need to delete all files named
administrator/components/com_fabrik/views/list/tmpl/bootstrap*

these are replaced with the 'admin_bootsrap*' files.

However, while the form does seem to be appearing, the incident report that the subject is named in, does not seem to be appearing as you can see in the image.
works for me - what {fabrik......} statement are you using?
 
ahh back end!
That should be fixed, if you are updating by downloading files and not git then you will need to delete all files named
administrator/components/com_fabrik/views/list/tmpl/bootstrap*

these are replaced with the 'admin_bootsrap*' files.


works for me - what {fabrik......} statement are you using?

{fabrik view=list id=3 incident_report___subject_id _raw=[rowid]}
 
I've removed all files in that folder starting with Bootstrap and now when I load the view data from admin view it shows the image below for subject reports
 

Attachments

  • newerror.png
    newerror.png
    148.1 KB · Views: 383
You should no longer have a folder components/com_fabrik/views/list/tmpl/admin/

The default admin tmpl for fabrik lists in 3.1 is 'bootstrap' and not 'admin'. So edit the list and select 'bootstrap' for the lists' admin template.

It would be better if you could update via github pull request rather than ftp as you have lots of files now that are no longer in use and are causing issues such as this.

If that's not possible then I'd suggest deleting the fabrik files on your server before updating.
 
Im apparently misunderstanding the update frkm github concept. I thought by using ftp to upload the github files that i was updating via github. If not, could you please explain how i update from github?
 
I've been reading up on this update method, yet I can't seem to find any direct explanation. Any chance you can walk me through the process of setting up to update from github? I also want to make sure I won't lose any of my forms and lists and elements I already have by switching update methods.
 
Hi
there's a video tutorial that someone made:
http://screencast.com/t/J7nqNouTY which does an excellent job of describing things.
The way described in the wiki works well for fabrik 3.0 where the file structure is pretty stable, but with 3.1 being not yet at a beta release things are a bit more volatile with regards to the file structures specifically when dealing with differences between Joomla 3.0 and 2.5

-Rob
 
I've gone through the video, it seems to make sense from a locallly hosted site, however when running all of my sites through an online host, I'm not sure how to translate the process here.
 
Good point.
If you have set things up locally as per the video - then on your remote site you would need to delete :

components/com_fabrik/
administrator/components/com_fabrik/
media/com_fabrik/

and reupload the files to those folders from your local machine.

Alternatively there are online services such as deployhq (http://www.deployhq.com/) which sync github repositories to ftp locations
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top