I would like to add dynamic pair of fields into a Joomla module for configuration as follows:
field1(checkbox)-field2(menuitem)
field3(checkbox)-field4(menuitem)
.
.
.
As many as rows my DB table has.
Is there any way to accomplish this?
Thank you!
Related
i am getting data from different different tables and i displayed all those in one section that section contains search button also, i want to add another resource field as a searchable item in nova ,i am trying to add based on the relation of the particular table but it's throwing an error undefined column, How to add please help..
public static $searchable=['id','name','account.type'];
Basically, the search by relationship is not possible through Nova.
A package well made for your needs is this one: LaravelNovaSearch
This package includes both relationship search but also has other useful features making the search much more comprehensive.
Another package, which I have not personally tested, but which seems to be useful for your needs: NovaSearchRelations
My advice is to use LaravelNovaSearch, more maintained and more complete.
I wanted to implement multi level data table structure with Laravel Backpack. Please see the images for more information
structure - https://ibb.co/i9Qfud
initial view - https://ibb.co/h8SFSy
trip expanded - https://ibb.co/cm027y
city expanded - https://ibb.co/ej3N7y
day expanded - https://ibb.co/iGffud
Is this possible with Laravel backpack ? Any references where i can find a solution?
Thanks in advance :)
There's a Backpack functionality called Details Row that will help you achieve the first [+] button, but I'm afraid that's about it - the next ones are up to you.
You will have to:
in your TripCrudController::setup():
$this->crud->enableDetailsRow();
$this->crud->allowAccess('details_row');
$this->crud->setDetailsRowView('details_row.expanded_trip_details_row');
create the blade file that outputs the table with cities, days and attractions (let's say resources/views/vendor/backpack/crud/details_row/expanded_trip_details_row.blade.php); shouldn't be very difficult, you have the current trip as $entry inside this file and you can drill down using Eloquent relationships into $cities = $entry->cities, then $days=$city->days etc;
include some javascript so that subsequent [+] signs work, inside your public/vendor/backpack/crud/js/list.js; alternatively, you could do this with inline javascript inside the same blade file, might be cleaner that way; but remember that this blade content is put inside the details row with AJAX, so new DOM elements and events need to be registered;
Hope it helps.
Tabacitu has provided the right answer but i've observed in my case that the details_row template should be called this way :
$this->crud->setDetailsRowView('backpack::crud.details_row.expanded_trip_details_row');
I used MVC before. Now I am a learning HMVC.
I have product, product_category, product_description and product_images tables in my database.
I want to display list of products in my website with basic product information. Clicking on a product will redirect to a different page and will display all the product related information.
What is the best way to achieve this according to HMVC(Modular MVC) pattern?
Should I create different modules for each table like product module, product category module etc..?(In this case I will have one model class in each module/model. I found this idea when searching internet)
Should I create one module called products and put all the files related to this in that module? (In this case I will be having all the product, product_category, product_description product_images model classes under products/models)
Should I follow a completely different implementation from the techniques I've mentioned above? (Please provide specific details to build this module)
(I'm using codeignitor for my development)
Thanks a lot!
Lets simplify the things for you.
If you have category as menu (Same as magento), i will recommend you to create new module for cateogry
Coming back to product, you can manage all things with the 1 product controller.
In category, category will have its own model to interact with database.
In your product model, you can manage all kind of transactions in one model because they are part of product only.
If you want to move bit advance, you can have a sql folder in each module so that you can install the and create tables when you just drop folder to modules. For this you can create a small script where, in regular interval of time, it will check the new modules, and if that script found some new modules, it will install the .sql file in the sql folder, which will update the database schema.
Hope this will help you
I know how to make a simple joomla component using one table. I can display all the records from that table as well as add, edit and delete records. I want to know how can i do it using two tables.
Thanks.
Khubruy Mehta
You have to use two models, it can be a good start point:
http://docs.joomla.org/Using_multiple_models_in_an_MVC_component
I am using joomla's jomsocial & I want to add a custom field on group creation. Has anyone played with it before?
jos_community_groups is the table where we have information related to jomsocial groups you will have to alter this table. com_community>templates>default>groups.create.php will be the file where you will need to add this new field. You need something else let me know. We have used it heavily.