ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

SOLVED! How to use one of the files uploaded with FF Matrix + nGen File Field type as a preview to use it in another weblog?

November 10, 2009 6:10am

Subscribe [1]
  • #1 / Nov 10, 2009 6:10am

    Lyubov Berezina

    42 posts

    I have two weblogs: press and news.

    In the press weblog there’s a custom field named “gallery” which is FF Matrix field+nGen File Field type. I use it to create a mini gallery for interviews I post on my website.

    In the news weblog I post news about new interviews in press weblog (don’t ask me why I need this fuss 😊 What I want in this weblog’s entries is a small preview of the gallery of a spoken interview (just one of the images from the gallery) to show near the news title and summary.

    Right now I’m using a custom field in press weblog of FF Matrix+ nGen File Field type to upload a preview (which actually is the same as one of the images in the gallery field) and then a custom relation field in News weblog which pulls this preview into ne news template.

    But I feel this is a huge overload as I need to upload one of the files twice - one instance into the gallery and one into the preview field. I wonder is there any way to “mark” one of the gallery’s images while uploading (during creating entry in Publish tab) for using as “preview” so that I can pull this preview into _another_blog_ entry?

  • #2 / Nov 11, 2009 8:12am

    Lyubov Berezina

    42 posts

    So I’ve finally come with 2 solutions for this. Everything that was needed is to RTFM! 😊

    1. Always use the 1st pic from the gallery by incorporating limit=“1” parameter for the FF Matrix tag, e.x.:

    {related_entries id="link_to_article"}
      {image_upload limit="1"}
        {exp:imgsizer:size src="{image}" width="100" height="100" alt="{alt_descr}"}
      {/image_upload}
    {/related_entries}

    This is easy but requires you to always upload the required_for_preview image first, and this maybe unappropriate sometimes when pics order is essential.

    2. Choose one of the images by incorporating search: parameter of FF Matrix:
    so I’ve created a new column in my FF Matrix field, named it “choose_for_preview”. When I compose an entry, I leave all the cells in choose_for_preview column blank except the one that is in a row of the image I want to use as a preview (in this sell I just type “yes”, without quotes of course).
    Then in the template:

    {related_entries id="link_to_article"}
      {image_upload search:choose_for_preview="yes"}
       {exp:imgsizer:size src="{image}" width="100" height="100" alt="{alt_descr}"}
      {/image_upload}
    {/related_entries}

    This one allows to upload all the images in whatever order you need and then simply choose the one which will be used as a preview in another weblog. Hurray!

    So the lesson learned: RTFM, guys 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases