1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Creating a totally new form UI

Discussion in 'Professional Support' started by skyrun, Sep 24, 2019.

  1. skyrun

    skyrun Active Member

    Level: Professional
    i want to use fabrik to maintain a (fabrik) list of items (pricing rules in my case). and when i open the form for that item, i present the user with a totally custom ui that can present a more user friendly way than a tradisional 'form' to populate the form data.

    i tried using a php list plugin to call the .php script that implments the custom data-input approach, but it seems to run outside of joomla and i can't easily get it to run within to joomla/component framework. i also need to put an 'exit;' on the end or it doesn't show any ui. php list plugins are meant to be run in the background it seems, not to present a ui. which is a good use-case.

    so i think the best approach would be to create a custom tmpl that does this. does that sound like the right approach?
     
    Last edited: Sep 24, 2019
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    The 'php' list plugin is a very specific use case, designed to create a custom list button that "does something" within the standard list framework.

    The 'php_events' plugin allows you to hang code off of a number of different hooks within the list processing cycle ... like before loading data (usually used to massage the table(s) in some way, like updating from some external source), or after loading the data, or on various ACL related calls (can edit, can delete, etc), yada yada.

    The 'php' form plugin again allows you to hang code on a variety of hooks ... before loading data, after loading data, inserting top/middle/bottom content into the form, on submission before processing, on submission after processing to the database, etc etc.

    But none of these would by themselves allow you to radically change the UI. They would need to be in conjuction with some template hackery.

    Just be aware, as you probably are, that changing the DOM of the form UI has to be done with great care, as much of the element and form Javascript expects a specific DOM structure to work properly. We make liberal use of jQuery's closest('.foo') and Moo's findClassUp() to find things like wrapper divs, and use many of the class names directly to find things. So while it's possible to fairly dramatically alter the look, the underlying way the elements and form is structured in DOM "shape" has to be preserved.

    You also have to be careful to make sure that all your elements are on the form (even if hidden), and that all our hidden form data is preserved. Leaving stuff out can have nasty side effects when the data is submitted.

    Btw, I'm not sure what you mean by "but it seems to run outside of joomla". I can't offhand think of any of our code that runs outside the J! framework.

    -- hugh
     

Share This Page