I think that episode is one of their best. The bit with Senna jumping out his car to help the other driver was inspiring.
Expression Engine, Adding Images and Captions to Articles

Expression Engine is a great CMS to use for large enterprise scale websites and small personal websites alike, but there is one thing that always gets on my nerve and that is the image handling for adding images to articles.

Currently out of the box there is no way to attach images to an article and assign captions to those images and then display those images and captions in the template using tags. But there is a way using extensions available. nGen File Field for FieldFrame.

Follow the instructions for the two extensions to install and set any configuration options.

Now, if you want to add the ability to upload images and add captions to those images you need to do the following…

  1. Go to CP Home  ›  Admin  ›  Section Administration  ›  Field Groups  ›  Custom Field.
  2. Fill in the details for the field name, field label, field instructions. For the Field Type choose FF Matrix.
  3. If you want to set a limit to the number of images you can attach to the article enter a value for Max Rows.
  4. Fill in the values for the matrix configuration.
    Matrix configuration
  5. Make sure you give each field the correct type and specify the file upload location.
  6. Save your changes and go to create or edit a page and you’ll see the new options.
    Image options
  7. To access the image attachments in your template you can use the following code.
    {if customfield_name}
    {
    customfield_name}
    <image caption=”{caption}”><img src=”{image}” /></image>
    {/
    customfield_name}
    {/if}

    customfield_name is the name you gave to the custom field in step 2, caption is the name you gave to the caption cell and image is the name you gave to the image cell in step 4 respectively.

Still, not the best solution, but it does go someway to improving image attachments for articles. Almost the way Wordpress works.

Leave a Reply