• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Need help on "Choosing parent_id for an item..."

Hi All,
I have a case (I dont know about PHP) that is unsolvable by myself and would like to ask you all for help.
Case: I have two table that named:
+ Products (ID, product_name...)to keep listing of agricultural products;
+ Product_profile (ID, Product_ID, Parent_ID, Attribute, Description) for storing varying data relating to a product.
Requirements:
+ When adding a profile for a product,
(1) Choose product with a databasejoin dropdown
(2) Choose a parent item from product_profile: for example item 1 - General instruction, I add a new item 1.1 for back ground data (like heading level in Word heading 1, 2, 3...) that takes General instruction as the parent item.
So I would like the dropdown for parent item will only list existing Attributes for the product_id selected from step 1.
In the Data where, joins where and/or order by statement (SQL) field I added
WHERE {thistable}.type = 15 AND {thistable}.product_id = {products_profile___product_id}
And applied for both (add new and edit)
This failed.

In the case of Edit, I would also expect that the Parent_id dropdown will not list attribute of the current editing record itself with
WHERE {thistable}.type = 15 AND {thistable}.product_id = {products_profile___product_id} AND {thistable}.id <> {products_profile___id}
and it works in editing only.
Could you all be so kind helping me in dealing with this.
Thank you very much for your attention!
Yours very faithfully
Dang Dinh ngoc - From Vietnam
 
I have done this with a simple modification:
1. User a CDD dropdown
2. Add Where query with
{thistable}.type=15 AND {thistable}.id <> {products_profile___id_raw||0}
Thank you all for attention.
Solution came from a topic in this forum. Great thanks to all!
 
You beat me to it, I was going to suggest a CDD.

You could do it with a join, using a WHERE filter and updating on AJAX, but that's what a CDD is built to do.

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

Thank you.

Members online

Back
Top