20 Posts
imendes
6 years ago
22
Topic

How can I add a list to a content view form, and make the necessary field links (relationships)?

Is there any tutorial that you can point?

Thank you.

Get a Book for SEBLOD
1283 Posts
Bucklash
6 years ago
0
Level 1

Hi

1

Add a list view to another view ie

list view to content view

https://www.seblod.com/resources/tutorials/create-a-dynamic-list-within-a-list-item

2

"And make the necessary field links (relationships)"

How do you mean?

Jon

20 Posts
imendes
6 years ago
1
Level 1

Ok, but that option is only avaliable with two plugins that are not avaliable on the Seblod installation.

I saw that is possible with the field type 'module', but I'm having some troubles.

Here is my goal:

I have a list with all the users requests (for quotes). In each line I have a 'View' button. When a company click on that button, I open the content view form, with all the data for that request. What I want is to show a list below that content with all the quotes for that user request. And the users (companies) can add new quotes for that user requests.

I use custom content. So the link must be done with the article id in requests content, and I have created a field request_id in quotes content. So, my problems:

1. how can I link those two fields? (article_id in requests content and request_id in quotes content)

2. how can fill automatically the field request_id in quotes content when the user creates a new quote for a request?

Thanks again.

4229 Posts
Kadministrator
6 years ago
0
Level 2

If you are not using using list field you can only use variables that are in the URL for search - as article id is there so it should work. I suggest you read about live values 

20 Posts
imendes
6 years ago
1
Level 1

Even with SEF enabled?

In the url there is no id.

4229 Posts
Kadministrator
6 years ago
0
Level 2

With sef enabled you don't see it, but it is there.

20 Posts
imendes
6 years ago
7
Level 1

I can't put it to work :(

I have a content with 4 fields. One of them is the request_id (text). Storage is 'Standard-  Article - introtext'

Then I created a list with that 4 fields in the list. On the Search Form I put that field 'request_id' and in the live value I choosed 'Url'->Variable and I configured to 'Type'=Int and 'Variable'=id

Then, I open my list and put a value in the search field that I know is on my content (article id), but I get a message that 'There is no results'.

What I'm doing wrong?


1283 Posts
Bucklash
6 years ago
6
Level 2

 

1283 Posts
Bucklash
6 years ago
5
Level 3

Hi

I have a content with 4 fields. One of them is the request_id (text). Storage is 'Standard- Article - introtext'

Bad move.

Introtext is where Seblod connects to Joomla. It does this by adding the id from the #__cck_core table wrapped in Seblod syntax ie ::cck::introtext::567 etc (or something like that) This requires storage for introtext to be Custom.

On the Search Form I put that field 'request_id' and in the live value I chose 'Url'->Variable and I configured to 'Type'=Int and 'Variable'=id

Type is not an integer...

See above.

Are you storing just the id of something in introtext?

Be much better off creating a new field like:

Field Title: Request Id

Field Name: request_id 

Field Storage: standard | Article | request_id | ALTER int

Make Sense

PS I wrote a lot of other stuff but deleted it as it was crap

20 Posts
imendes
6 years ago
4
Level 4

Thank you for your help!

 

Maybe I didn't explain myself clear.

 

I want that request_id field to be filled automatically with the article id of the 'requests' content, when a user creates a new quote for that request (to link the two contents). One request could have several quotes.

 

So, the user (a company) opens a list with all the users requests (done).

 

He chooses to view one of that requests. A content view form is open with all the data for that request. Above that content view form, I put the list with the quotes (using a module). That list must show only the quotes for that request, but the list is empty.

 

I use the article_id for the request_id field in the requests content. Works fine.

 

So, to test if the list is working I add some records (articles) in the quotes content. I fill the request_id field of the quotes content wirh the article_id of the requests content, and I made a menu item to open that list. In the search field I wrote a number (article id), that I know is on the requests content, but still get the message 'There is no results'.

 

Today I use your solutions, just to test the list of the quotes:

 

Create a new field:

Field Title: Request Id

Field Name: request_id

Field Storage: standard | Article | request_id | ALTER int

In the live value of the field: type=int  and variable=id

 

Didn't work.

 

change the storage to custom | article | introtext

In the live value of the field: type=string and variable=id

 

Didn't work :(

1283 Posts
Bucklash
6 years ago
3
Level 5

Hi

If I put this in to my words, is it correct?

1

Content Types

Request

Quote

2

One Request can have multiple quotes

ie 

Request: New Kitchen Design

Quote1: $20,000

Quote2: $23,000

Quote3: $4,000,000

3

When Viewing a list of Requests, each request links to it's content view 

ie

<a href"my-site.com/requests/new-kitchen-design">New Kitchen Design</a>


4

On the page showing the content view for 'New Kitchen Design' there is a list of Quotes that are for that request  

ie 

Quote1: $20,000

Quote2: $23,000

Quote3: $4,000,000

5

In the quotes content type there is a field that stores the id of the relevant Request Id

ie

#__cck_store_form_quote.request_id

Storage | Article | request_id ALTER INT

6

In the search form you do 'live value' on the request_id field as uri variable: id

This is is in the uri as it is the id of the content in the content view

1283 Posts
Bucklash
6 years ago
0
Level 6

It would be good to add screenshots.

Confused on these points:

use the article_id for the request_id field in the requests content. Works fine.

- What works fine?

Content View Form

-  Which View: Form or Content?

Request Id

- What is your storage for request Id?

A content view form is open with all the data

- Do you mean Modal or a new Page?



20 Posts
imendes
6 years ago
0
Level 6

Everything is correct as you describe.

20 Posts
imendes
6 years ago
0
Level 6

Confused on these points:

use the article_id for the request_id field in the requests content. Works fine.

- What works fine?  -  I mean the requests form and list works fine

Content View Form

- Which View: Form or Content?  -  Content View

Request Id

- What is your storage for request Id?  - in the quotes content is Standard | Article | request_id  Alter INT

in the requests content is Standard | Articles | id

A content view form is open with all the data

- Do you mean Modal or a new Page?  - in the same page (_self)

1283 Posts
Bucklash
6 years ago
8
Level 1

Also, and just guessing here:

You want to make sure your introtext data is correct 

Is Seblod syntax in there and is it correct?

Do you have request_id stored as it's own column in database in the #__cck_store_form_ quotes table?

In your search form, it is this request_id field you are using?

Mmmm screenshots is a must :)

20 Posts
imendes
6 years ago
7
Level 2

Sorry about the language. It's Portuguese, but I made some note for you.

 

This is the list of all Requests: 

  This is the content view, when the user clicks on the 'View' button:

  This is the list of fields in requests content view:

 

This is the list configuration:

 

The request_is field configuration:

  The live value:

4229 Posts
Kadministrator
6 years ago
6
Level 3

Do you use related article or some other field to store related articles ids to pedido_id in each quote? Or what is stored in pedido_id?

20 Posts
imendes
6 years ago
5
Level 4

In pedido_id I want to store the article_id of the request content.

1283 Posts
Bucklash
6 years ago
0
Level 5
Sorry about the language. It's Portuguese, but I made some note for you.

I'm lucky everyone has to speak English!

What about some Database screenshots

Is your introtext column looking good?

Is the storage in #__cck_core_fields all good for the relevant fields? etc

4229 Posts
Kadministrator
6 years ago
3
Level 5

You have put pedido_id in the search form, this means you have to have some records already that have this value stored. Search form is for searching records, not for storing them.

You need add pedido_id in your quotes content type form using related articles field and create few records, then you can search by this value.

20 Posts
imendes
6 years ago
2
Level 6

Yes, I know that, and I did that, just to test the list. I added some records (articles) on the quotes content, and I filled the pedido_id with the article_id of the requests content. Didn't work.

4229 Posts
Kadministrator
6 years ago
1
Level 7

It should work, you have en error somewhere.

20 Posts
imendes
6 years ago
0
Level 8

Well, you were right. Something should be wrong in database. I delete the form and the list, and created new ones. Bingo! Everything works as expected.

Thank you so much for your help, Amazing support here!

Get a VIP membership