How to make a table in a content item?

More
10 years 10 months ago #43629 by igcorreia
:) Can you try to put on this forum a DESIGN? I help you get it done. with the design I give you the PERFECT solution.

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #43630 by gkhn

igcorreia wrote: :) Can you try to put on this forum a DESIGN? I help you get it done. with the design I give you the PERFECT solution.

design is this

getbootstrap.com/css/#tables-responsive

Table head
user can add anything text only (text field)
for the rows user can add image and/or text
so for example
productname- image- features - description

or

productname - features - descrtiption

(for the second option he can have add his product name and image in the table)

And this table is displayed in the item view.

I am not displaying them in the category or anything.

Thank you.

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #43632 by igcorreia
I see what you mean, you need a custom field,
that has be required by everyones.

You want this right?

1 - IN the item VIEW
2 - You have 1 field that is called Table
3 - and the user can add the number of rows that he wants

Right?

I have done this in the past for many clients. If you want in the item view this is the only way.

----

This solution that I am going to explain now is as a more complicated solution to implement but it works the same.

1 - Create a category called PRODUCTS
2 - Create a relate item and assign it to the item view
3 - In the item the client can select with a RELATED field the Products that he want to shoe in the item
4 - Create a Module with a custom template that load the Related Field Inverse and SCOPE IT by the CURRENT ITEM and the respective RELATED FIELD
5 - Create a custom template that for the item and the you have to do a FOREACh for every FIELD you want.
6 - Resume: the client create the products in the products category and in the ITEM only selected the related ones, the module with do the job.

:) Did you get this?

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #43633 by gkhn

igcorreia wrote: I see what you mean, you need a custom field,
that has be required by everyones.

You want this right?

1 - IN the item VIEW
2 - You have 1 field that is called Table
3 - and the user can add the number of rows that he wants

Right?

I have done this in the past for many clients. If you want in the item view this is the only way.

----

This solution that I am going to explain now is as a more complicated solution to implement but it works the same.

1 - Create a category called PRODUCTS
2 - Create a relate item and assign it to the item view
3 - In the item the client can select with a RELATED field the Products that he want to shoe in the item
4 - Create a Module with a custom template that load the Related Field Inverse and SCOPE IT by the CURRENT ITEM and the respective RELATED FIELD
5 - Create a custom template that for the item and the you have to do a FOREACh for every FIELD you want.
6 - Resume: the client create the products in the products category and in the ITEM only selected the related ones, the module with do the job.

:) Did you get this?


Pheww I think I got it but there should be an easier solution.

Would the code below work in this situation

user creates a table header(4 columns) using frontend submission text fields (you can add multipl text)

i am ok up to this point. I even tested it and I can add infinite number of columns without even creating a table each time i create an item...

Anyways coming to the point.
Code:
<?php if ((isset($item->positions['tablerowimage'])) || (isset($item->positions['tablerowtext']))) : ?> <?php foreach ($item->positions['tablerowimage'] as $field) : ?> <?php foreach ($item->positions['tablerowtext'] as $field) : ?> <tr> <?php echo $field->display; ?> </tr> <?php endforeach; ?> <?php endforeach; ?> <?php endif; ?>

I will assign image field to the tablearrowimage and text field for the tablerowtext.

user creates a row using text field and or image field.
if he creates a second set of these fields and adds his content (click add for text and add container for the image field) would it be created on the second column same row?

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #43646 by gkhn
Finally got something working
It took me a while but this is exactly what i needed..
Code:
<?php if ((isset($item->positions['tablehead'] ) ) ) : ?> <div class="row"> <div class="col-sm-12"> <div class="table-responsive"> <table class="table table-bordered table-hover"> <?php foreach ($item->positions['tablehead'] as $field) : ?> <thead> <tr> <?php echo $field->display; ?> </tr> </thead> <?php endforeach; ?> <?php endif; ?> <tbody> <tr> <?php if ((isset($item->positions['tablerow1col1'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow1col1'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> <?php if ((isset($item->positions['tablerow1col2'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow1col2'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> <?php if ((isset($item->positions['tablerow1col3'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow1col3'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> <?php if ((isset($item->positions['tablerow1col4'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow1col4'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> </tr> <tr> <?php if ((isset($item->positions['tablerow2col1'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow1col1'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> <?php if ((isset($item->positions['tablerow2col2'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow2col2'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> <?php if ((isset($item->positions['tablerow2col3'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow2col3'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> <?php if ((isset($item->positions['tablerow2col4'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow2col4'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> </tr> <tr> <?php if ((isset($item->positions['tablerow3col1'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow3col1'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> <?php if ((isset($item->positions['tablerow3col2'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow3col2'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> <?php if ((isset($item->positions['tablerow3col3'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow3col3'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> <?php if ((isset($item->positions['tablerow3col4'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow3col4'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> </tr> <tr> <?php if ((isset($item->positions['tablerow4col1'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow4col1'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> <?php if ((isset($item->positions['tablerow4col2'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow4col2'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> <?php if ((isset($item->positions['tablerow4col3'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow4col3'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> <?php if ((isset($item->positions['tablerow4col4'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow4col4'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> </tr> <tr> <?php if ((isset($item->positions['tablerow5col1'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow5col1'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> <?php if ((isset($item->positions['tablerow5col2'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow5col2'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> <?php if ((isset($item->positions['tablerow5col3'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow5col3'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> <?php if ((isset($item->positions['tablerow5col4'] ) ) ) : ?> <td> <?php foreach ($item->positions['tablerow5col4'] as $field) : ?> <?php echo $field->display; ?> <?php endforeach; ?> </td> <?php endif; ?> </tr> </tbody> </table> </div> </div> </div>

Loading each column with a different text area :)

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #43652 by igcorreia
Once you enter the FC framework you can do everything.

YOu only need to understand the framework and all the possible feature and combinations. Glad you made :)

Now I am struggling.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.434 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline