[SOLVED] What Fabrik syntax can I use to display data from a table on to a web page?

antonitus

Member
I'd like to display data from a form straight into an article or a module, however I don't know how to do this outside a form.

Is there some kind of Fabrik syntax I can use to display this data?
e.g. {fabrik}tablename___data_to_display{/fabrik}
(this is of course just an example and not the real syntax as I was hoping something like this exists to achieve this data display in articles/modules.

Thanks,
Tony
 
Thanks dimoss.
Although this tutorial is interesting, it's not entirely what I am looking for. I'd like to pull data from various forms that already hold data and just show those parts I specify from the data, e.g, show name & username of user already logged in, etc., into a web page. I hope this makes sense?
 
As you can see in the link dimoss mentioned you can display filtered lists and single element content.

Additionally you can create as much lists as you need, all pointing to the same DB table but showing different columns in list view, have different prefilters applied etc.
Then you can display such a list via content plugin in an article.
 
Thanks for your response.

I tried different variants of the code in the link that dimoss gave me, but I couldn't find a way to show just one part of data of an element.

Can you please give me an example code that shows just the name of a user. The element name is: 'registration___Full_Name'. Once I know the exact code for this, then I can use it for other element names. It also has to be the element that belongs to a logged in user.

Thanks
 
This depends on your setup.
Assuming you want to show some parts of the user's registration record (and this list has an element storing the userID)
I would
- copy your registration list (will give you a new list/form/group/elements linked to the same DB table)
- disable all new elements you don't want to show in your article
- in your article show the (reduced) registration details with
{fabrik view=details id=the-new-form-id rowid=-1 usekey=your-userID-element}
(rowid = -1 is pulling the logged-in user's ID)

If you want to show only a single element I think (I didn't test) you can do it without copying the list
{fabrik view=element list=your-list-id rowid=-1 usekey=your-userID-element element=registration___Full_Name}

But you shouldn't use this element method to show a lot of elements.
 
Hi troester, thank you for your speedy response. You're a genius, the second method works brilliantly, so thank you for that. I haven't tried the first method as yet, but the second method is just what I was looking for. Just out of interest, why shouldn't I use the second method as it works so well for me. I listed 3 fields with data pulled from my registration form without any issues and it's quick too.

Thanks,
Tony
 
I assume 3 fields is ok.
As far as I can remember somebody got issue by using really "a lot". It's loading the complete list every time to display just one element.

What was your problem with method 1? The layout?
You can additionally create a custom Fabrik template and call it via
{fabrik view=.... layout=your-layout}
But yes, if it's working then it's easier to use the editor in an article.
 
You got it spot on, it's the layout which is the issue. I already created my own bootstrap template for my forms, but basic. I have an idea for another project I started in 2000 and the fields have to be placed in several places and not in a smart line.

I suppose the issue that person had was low memory, slow connection on a local server, etc. I think today's web servers can handle such a load, although it depends on the hosting package limitations. I don't want to use many, a max of 3 fields in all. I'll have a go at the first method and design a template to go with it.

Thanks for all your kind help troester and you too dimoss.
 
I now have another issue, these codes do not seem to work in modules, only articles. Is there a way to make them work in a module, if possible?
 
I've been using Joomla for years and I never noticed that option, still I'm learning Joomla 3. Thank you once again troester. You have helped me so much today and it's much appreciated.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top