Hello, I am fairly new to EE and I am testing out fluid fields. I tried reading through the documentation but was unable to solve my problem. I currently have a fluid field that can take in an image, however when I try and display that image nothing appears on the screen.
I am able to get text output, it’s just the image that I’m having problems with.
My current code is :
{exp:channel:entries channel="results"}
{fluid_field_test}
{fluid_field_test:featured_image}
{content}
{content:featured_image}
{/content}
{/fluid_field_test:featured_image}
{/fluid_field_test}
{/exp:channel:entries}
Any help would be appreciated, thanks!
I think you’re really close. The fluid field is named ‘fluid_field_test’ and the file field is named ‘featured_image’ - right?
If so, try:
{fluid_field_test}
{fluid_field_test:featured_image}
{content}
Extension: {extension}
Upload date: {upload_date format="%Y %m %d"}
URL: {url}
{/content}
{/fluid_field_test:featured_image}
{/fluid_field_test}
That’s good because Robins code works - there’s no img tag in there.
Try this, I’ve replaced values with an image tag:
{fluid_field_test}
{fluid_field_test:featured_image}
{content}
< img src="{url}" width="{width}" height="{height}" alt="{title}" >
{/content}
{/fluid_field_test:featured_image}
{/fluid_field_test}
Sure, the file grid field has a reserved name for the file field, so if featured_image
is the name of your file grid, you could do something like this:
{fluid_field_test}
{fluid_field_test:featured_image}
{content}
< img src="{file}" width="{width}" height="{height}" alt="{title}" > // where {file} is the file grid file field name
{/content}
{/fluid_field_test:featured_image}
{/fluid_field_test}
This didn’t seem to work for me. Not sure why. Is the file grid file field name always {file}? I tried a few different variations of what I thought it could be but no images are displayed.
{fluid_field_test}
{fluid_field_test:fluid_file_grid}
{content}
< img src="{file}" width="{width}" height="{height}" alt="{title}"/ >
{/content}
{/fluid_field_test:fluid_file_grid}
{/fluid_field_test}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.