Creating Image renditions?
  • I'm a bit stuck on how to create new image renditions in Newscoop4.

    I've tried to deduce how to do it but it didn't work:

    Using the New Custodian Theme I added to _tpl/img a file called img_320x240.tpl with contents:

    {{ image rendition="articlemainimage" }}
                  <figure class="clearall">
                      <img src="{{ $image->src }}" width="{{ $image->width }}" height="{{ $image->height }}" class="tencol last" rel="resizable" style="max-width: 100%" alt="{{ $image->caption }} (photo: {{ $image->photographer }})" />
                      <figcaption class="clearall">
                          <em>{{ $image->caption }}</em>
                      </figcaption>
                  </figure>
    {{ /image }}
    On Save I get "Application Error". Then nothing much happens!

    Am I missing something?

    Thanks!

  • 5 Comments sorted by
  • Hi,

    This is one of the Known Issues for 4.0.0. I mean saving the template and getting the "Application Error". It happens only for the first time you save a template. The error is presented even though the changes are actually saved.

    However, to get a new rendition working you need a bit more than that. Image Renditions are pre-defined dimensions for the images on your website. In order to create a new rendition, you need:

    1) First to edit the theme.xml file for your theme. theme.xml is the configuration file for the theme. You should add a line like:

    <rendition name="articlemainimage" width="640" height="280" specs="crop" />

    ... to the block of renditions. Adjust the dimensions according to your needs.

    2) In the admin interface go to Configure -> Image Rendering and click on the "Reload renditions" button.

    After that the code you already wrote in img_320x240.tpl file will be functional.

    Hope this helps !

    All Best,

  • Thanks!
    That helps a lot! I was looking for some sort of configuration file, but the theme.xml file isn't visible in the admin theme editor, but found it on ftp.

    Thanks
  • Vote Up0Vote Down DarioDario
    Posts: 18Member
    Hello, I am working with the same theme "the new guard"
    What I get is that the image "square" in "front-morestories.tpl" would be the size 520 *180, and q the title and pass down the deck and deal the same size. if I can indicate thatfiles, plus I have to change theme.xml to get that result.

    Thank you very much.
  • Hey Dario, I don't really understand the question, hablas espanol ? 

    :-)
  • Vote Up0Vote Down DarioDario
    Posts: 18Member
    Hablo español.

    Estoy trabajando con el mismo theme "the new custodian"
    Lo que quiero lograr es que la imagen "square" en "front-morestories.tpl" quede del tamaño 520 * 180, y que el titulo y el deck pasen abajo y ocupen el mismo tamaño. si me pueden indicar que archivos, ademas de theme.xml tengo que modificar para obtener ese resultado.