We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

How does File Grid works ?

How Do I?

Dom's avatar
Dom
88 posts
5 years ago
Dom's avatar Dom

Hi Guys,

I tried many times to put a Grid Field form in my frontend EE where i can upload image like below with no success :

{exp:channel:form channel="contact" return="form/ENTRY_ID" entry_id="{segment_3}” error_handling=”inline” dynamic_title=”[info]” include_assets=”no” unique_url_title=”yes”}

name : {field:name} message : {field:message} photo : {field:photo}

<input type=”submit” value=”Submit”>

{/exp:channel:form}

As you can see here, my “{field:photo}” type is a File Grid, and how you guys do normally ?

And can you show me your codes form for Input Uploading File and Output Displaying File (photo) please ?

Regards.

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

In the channel form, the file grid should display and function like a standard grid, so you can’t drag and drop a collections of images and populate multiple rows, but you should be able to add rows just like a normal grid.

I just tested using {field:file_grid_name} and it worked as expected.

Is that what’s happening on your end? And if so, when you save, if you go edit in either the CP or the form, do you see the images you uploaded?

       
Dom's avatar
Dom
88 posts
5 years ago
Dom's avatar Dom

Hi Robin,

Thank you for your help, my {field:file_grid_name} is {field:photo}

I create or add an entry via outside CP, i mean on frontend, like this below :

Step 1 : On frontend, when i add an entry, it shows like below which is strange : **

Step 2 : On frontend, if i don’t fill any datas on those fields, i click directly on Submit button, it displays this : **

Step 3 : On frontend, after clicked on Submit button, i can add several images, which will be like this : **

So as you can see, do you know why on Step 1 displays like that ?

PS : There is also another problem on Step 3, that i cannot Remove File by clicking on it. Do i miss an EE code somewhere ?

Regards.

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

It looks like some css and/or javascript may be missing. Ah- in your opening tag: include_assets=”no” take that bit out. Let’s see what that gets us.

       
Dom's avatar
Dom
88 posts
5 years ago
Dom's avatar Dom

Hi Robin,

I erased that include_assets=”no”, and still same problem. I’ll try to put EE css and js to see and hide some custom JavaScript of mine to see the effect..

I’ll let you know soon 😉

Regards.

       
Dom's avatar
Dom
88 posts
5 years ago
Dom's avatar Dom

Hi Robin,

Yes you right, the problem due to these below :

{aaa}assets/js/jquery.min.js

{bbb}assets/bootstrap/js/bootstrap.min.js

Now it’s fine, thank you Rob 😉

Regards.

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

Aha- good debugging. Glad you got it working!

       
Dom's avatar
Dom
88 posts
5 years ago
Dom's avatar Dom

Yeahhh 😊

Thanks Rob !

       
Dom's avatar
Dom
88 posts
5 years ago
Dom's avatar Dom

Hi Rob,

Sorry disturbing you again and again :p

I forgot to implement this with my File Grid in question below, you know how to implement it please ?

prev_row :

{gallery:prev_row} Previous photo {/gallery:prev_row}

next_row :

{gallery:next_row} Next photo {/gallery:next_row}

It would be great if EE can put some 1 or 2 examples live where we can see how it works here : https://docs.expressionengine.com/latest/fieldtypes/grid.html

Regards.

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

You’re right, I had to experiment a bit to pin it down. I’ll write up an example of paginating. In the meantime, see if this helps (note I hard coded the entry_id).

If you’re not sure about why I did something like I did, just ask.

{exp:channel:entries channel="blog" entry_id="20" dynamic="no"}

<h3>{title} - {entry_id}</h3>

{gallery row_id="{segment_3}" limit="1"}

{gallery:file}


{gallery:prev_row}
    <a href="http://{path=">Previous photo</a>
{/gallery:prev_row}
{gallery:next_row}
    <a href="http://{path=">Next photo</a>
{/gallery:next_row}


{/gallery}

{/exp:channel:entries}
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.