Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Doubts about phprad, textarea fields and related tables (Read 905 times) previous topic - next topic

Doubts about phprad, textarea fields and related tables

I am new to PHPRad. I currently use PHPRunner. I have some questions:
1. I can't see the HTML editor in a textarea field
2. What editor is it? I think the best one is ckeditor and I don't know if it can be installed myself later
3. I don't know how one-to-many relationships are handled. For example, in PHPRunner I have a "News" table, a "Documents" table and a "RelNewsDocs" table that relates, with the key fields, a news with several documents. The question is whether this can be done in PHPad and how. Thank you


Attached image of how it looks in phprunner
I would appreciate an image or example

Re: Doubts about phprad, textarea fields and related tables

Reply #1
@alfonsog
Please read the Phprad docs here: https://docs.radsystems.io/
Component Gallery here: https://docs.radsystems.io/gallery/gallery

1. You have to turn it ON by setting UseHtmlEditor to True
2. it uses a quill editor. And yes you can install the CKEditor later if you know how to install it.
3. The One-to-Many Master Details Relationship means that a Master table has a column in the Details table reserved for linking records to it. E.g if you have a Master table called Invoice and a Details table called InvoiceItems, Invoice would have columns called id or number, invoice_details, status, and date, while InvoiceItems table would have columns like this id, item_name, item_price, item_quantity and a column that relates the InvoiceItems record to the Invoice table called Invoice_id or Invoice_number that entails that the current record is related to a record in the Invoice table that has the same id or number as the InvoiceItems Invoice_id or Invoice_number.

Re: Doubts about phprad, textarea fields and related tables

Reply #2
Thanks. I put True in htmleditor but I only see a textarea without editor

Solved. I can't see html editor in PHPRad, but I can see it in Browser

Re: Doubts about phprad, textarea fields and related tables

Reply #3
@alfonsogphprad uses the internet explorer as its browser and some of the plugins used in phprad do not support the browser and sometimes you get such issues as you reported above. To avoid such issues, please always use modern browsers like chrome, edge, edge chromium, firefox, opera, etc, to preview your phprad project.

Re: Doubts about phprad, textarea fields and related tables

Reply #4
I try to explain what I have done to see if it is possible to do it in PHPRad:
1. A news "table" with: id_new, title, text, main_photo
2. A "docs" table with: id_doc, title_doc, file_doc
3. A "photos" table with: id_photo, title_photo, file_photo
Now what I want is that news, documents or photos can be added (no problem in that). My question is:
1. How can I relate several documents to a story?
2. How can I have several photos related to a story?
3. What I want is for a document to relate to different news, for example

In PHPRunner I have two new tables:
1. a "rel_docs_new" table with: id_rel, id_new_rel, id_doc_rel
2. another similar to relate the photos

I ask if the approach is correct and how to do it later in PHPRad

Thanks

Re: Doubts about phprad, textarea fields and related tables

Reply #5
Any idea or solution?

Re: Doubts about phprad, textarea fields and related tables

Reply #6
@alfonsog
1. By relating it to the new/story that owns it. the "docs" table with: id_doc, title_doc, file_doc would have another field called news_id, that will relate it to the story using a master details relationship.
2. The"photostable with: id_photo, title_photo, file_photo would have another field called news_id, that will relate it to the story using a master details relationship.

Re: Doubts about phprad, textarea fields and related tables

Reply #7
As you say in point 1, if we have a document that we want to relate to several news, how would it be done? What fields would be necessary? So far we are doing it with a table that relates the news to the documents

Re: Doubts about phprad, textarea fields and related tables

Reply #8
The same would happen, I think, with the photo chart. If we add a "news: id" field, I think that only one photo could be related to a story. I don't know how it would be necessary to be able to relate a photo with a lot of news

Re: Doubts about phprad, textarea fields and related tables

Reply #9
@alfonsog‍ it is the same way you relate it for a single image, but in this case, the details page would be a List Page, you will see the options in the Master-Details configuration window.

Re: Doubts about phprad, textarea fields and related tables

Reply #10
Ok, but I would like to add/edit/delete in the same window, if possible