Zum Hauptinhalt gehen

Getting media information from stored content

Kommentare

1 Kommentar

  • Zendesk API User
    Author: ndegoeij - 9/16/2014 15:45

    Sorry community members for the late response. But I would like to share a possible answer which we implemented for our customer.

    1.) First we created a template (section template) which can be used to upload a picture (lets call it photo_for_serie):

    <CMS_MODULE>

      <CMS_INPUT_TEXT name="st_title" allowEmpty="no" hFill="no" singleLine="no" useLanguages="yes">

        <LANGINFOS>

          <LANGINFO lang="*" label="Image title"/>

        </LANGINFOS>

      </CMS_INPUT_TEXT>


      <CMS_INPUT_PICTURE name="st_image" allowEmpty="no" hFill="no" imagePreview="yes" lean="mandatory" upload="yes" useLanguages="no">

        <LANGINFOS>

          <LANGINFO lang="*" label="Image"/>

        </LANGINFOS>

        <PROJECTS>

          <LOCAL name="."/>

        </PROJECTS>

      </CMS_INPUT_PICTURE>

    </CMS_MODULE>

    Then we have created a table (it has to be stored in the database) which has a column of the type xml. Based on this table

    we have created a second template (Database schemes lets call it photo_series) in which we defined a content arealist which again is based on our previously created template:

    <CMS_MODULE>

      <CMS_INPUT_CONTENTAREALIST name="db_photo_images" allowEmpty="no" rows="5">

        <LANGINFOS>

          <LANGINFO lang="*" label="Photo Images"/>

        </LANGINFOS>

        <SOURCES>

          <TEMPLATE name="photo_for_serie"/>

        </SOURCES>

      </CMS_INPUT_CONTENTAREALIST>

    </CMS_MODULE>

    In this same template we defined the jsp tab in which we loop over the photos:

    <div id="fotoserie" >

        <ul>

            $CMS_FOR(foto,#row.foto)$           

                  <li>

                    <div class="foto-container">

                        $CMS_VALUE(foto)$

                    </div>

                  </li>       

            $CMS_END_FOR$

        </ul>

    </div>

    Eventually we didn't need the xml, but with this same example you can easily create an xml of the output.

    I hope this is usefull for the community.

    Best regards,

    Nando

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.