rss image size
  • is there a way of increasing the size of the rss images

    this is the code but i cant find where it gets its size from

    {{ list_article_images length="1" }}
    <img src="{{$gimme->article->image->thumbnailurl}}" border="0" align="left" hspace="5" />
    {{ /list_article_images }}

  • 18 Comments sorted by
  • Vote Up0Vote Down Micz FlorMicz Flor
    Posts: 184Administrator
    Hi Mark,

    good question, I would have thought it was set in the system settings, but it is not.

    My next guess is that it actually comes from the image renditions of the theme. Check the wiki
    https://wiki.sourcefabric.org/display/NsLingo/Image
    And here some information to add a rendition to a theme:
    http://en.flossmanuals.net/newscoop-4-cookbook-en-4-0/making-your-templates/creating-a-newscoop-theme/

  • Vote Up0Vote Down Micz FlorMicz Flor
    Posts: 184Administrator
    You might be better off, though to use the "per image" way of scaling images:
    https://wiki.sourcefabric.org/display/CS/Image+Resizing+and+Zooming
  • Hi micz

    Must admin i expected it to be in the system settings

    but it seems to be an automatic thumbnail generation

    the image ratio works but its a low res picture

    I need the thumbnail to be bigger than it is now or ideally when you go to attach picture and media archive - that size - unfortunately i cant find the codng for that

    I have tried adding a rendition but that did not work
  • Vote Up0Vote Down Micz FlorMicz Flor
    Posts: 184Administrator
    I have to leave this lying around, unfortunately, I don't have a working Newscoop installed on my machine to try.
  • As Micz said. You can use renditions or scale image in code like that:

     {{ list_article_images length="1" }}
            <img src="{{ uri options="image $gimme->article->image->number" }}&ImageWidth=210" />
     {{ /list_article_images }}
  • It is for rss.tpl and the & was making it fail

    simply changed to 

    &lt;img src="{{ uri options="image $gimme->article->image->number" }}" width="210" border="0" align="left" hspace="5" /&gt;

    sorted

    thanks guys



  • Vote Up0Vote Down Micz FlorMicz Flor
    Posts: 184Administrator
    Hmmm. If you think so, but I believe that what you did should not solve the problem. Tomek's tag reads:

    <img src="{{ uri options="image $gimme->article->image->number" }}&ImageWidth=210" />

    Yours has at that crucial point now:

    age->number" }}" width="210"
    where it needs to say:
    e->number" }}&ImageWidth=210" />

    If the & makes it fail, try to replace it with &amp; or &#38;
  • To have better control of image sizes in rss, you can use existing image renditions, or create new one just for this purpose. Rendition definition is created in theme.xml file, and then you also need to go to Configure/Image rendering and press button 'reload renditions'. Last step is changing template that generates rss output; this is what creates <img> tag with image of right size:

                    {{ image rendition="rss" }}
                    <img src="{{ $view->serverUrl($image->src) }}" width="{{ $image->width }}" height="{{ $image->height }}" alt="{{ $image->caption }}" hspace="5" />
                    {{ /image }}

    This {{ $view->serverUrl($image->src) }} is used instead of {{ $image->src }} to get full (not relative) path to the image. Width and height are those from rendition definition, although you can change them here (if you do so, change them proportionally).
    --
    Ljuba Rankovic
    Senior Front End Developer, Sourcefabric
    ljuba.rankovic@sourcefabric.org

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric
  • www.blmforum.net/en/static/rss

    We have started using mailchimp for our daily newsletter and want to automate the task

    the rss itself (above) worked fine but mailchimp could not find the pictures - the code according to them was
    <img src="/get-img?ImageId=2671" width="150" border="0" align="left" hspace="5"

    so i just added the domain and now all fine

    &lt;img src="http://www.domain.name{{ uri options="image $gimme->article->image->number" }}" width="150" border="0" align="left" hspace="5" /&gt;


    Thanks Ijuba - i might actually do that so each image a set size
  • Hi Ijuba

    I have used your exact code but changed rss to square which is actually the picture size i want

    unfortunately the rss feed does not show the pictures

    http://eastmidlandsbusinesslink.co.uk/en/static/rss

    when i look at the code its fine
    <img src="http://eastmidlandsbusinesslink.co.uk/images/cache/150x150/crop/images%7Ccms-image-000000038.jpg" width="150" height="150" alt=" An ius nemore pericula" hspace="5" />

    and if you copy and paste the link it takes you to the picture

    can you think why this is not working

  • Hi, feed on this link http://eastmidlandsbusinesslink.co.uk/en/static/rss shows pictures when you subscribe to that feed through some rss reader (I tried with Google Reader). If you take a look at the source code of this page (on the link you sent) all <item> elements have image defined inside, but in old 150x100px dimensions, not square. Can you paste your rss template code here?
    --
    Ljuba Rankovic
    Senior Front End Developer, Sourcefabric
    ljuba.rankovic@sourcefabric.org

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric
  • sorry i had changed it from square to thumb to see if that made a diffeence

     

    i am using IE as i know if that can read it so can mailchimp

     

    code:

     

     

    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
    <title>{{$gimme->publication->name}}</title>
    <link>http://{{$gimme->publication->site}}</link>
    <description>{{$siteinfo.description}}</description>
    <language>{{ $gimme->language->code }}</language>
    <copyright>Copyright {{$smarty.now|date_format:"%Y"}}, {{$gimme->publication->name}}</copyright>
    <lastBuildDate>{{$smarty.now|date_format:"%a, %d %b %Y %H:%M:%S"}} +0100</lastBuildDate>
    <ttl>60</ttl>
    <generator>Newscoop</generator>
    <image>
    <url>{{ url static_file="_img/logo.png" }}</url>
    <title>{{$gimme->publication->name}}</title>
    <link>http://{{$gimme->publication->site}}</link>
    </image>
    <atom:link href="http://{{ $gimme->publication->site }}/en/static/rss" rel="self" type="application/rss+xml" />
    {{list_articles length="20" ignore_issue="true" ignore_section="true" constraints="type is news" order="bypublishdate desc"}}
    <item>
    <title>{{$gimme->article->name|html_entity_decode|regex_replace:'/&(.*?)quo;/':'&quot;'}}</title>
    <link>http://{{$gimme->publication->site}}/{{ $gimme->language->code }}/{{$gimme->issue->url_name}}/{{$gimme->section->url_name}}/{{$gimme->article->number}}</link>
    <description>
    {{ image rendition="thumb" }}
    <img src="{{ $view->serverUrl($image->src) }}" width="{{ $image->width }}" height="{{ $image->height }}" alt="{{ $image->caption }}" hspace="5" />
    {{ /image }}

    {{$gimme->article->deck|strip_tags:false|strip|escape:'html':'utf-8'}}
    &lt;br clear="all"&gt;
    </description> <category domain="http://{{$gimme->publication->site}}/{{ $gimme->language->code }}/{{ $gimme->issue->url_name }}/{{$gimme->section->url_name}}">{{$gimme->section->name}}</category> <atom:author><atom:name>{{ $gimme->article->author->name }}</atom:name></atom:author><pubDate>{{$gimme->article->publish_date|date_format:"%a, %d %b %Y %H:%M:%S"}} +0100</pubDate><guid isPermaLink="true">http://{{$gimme->publication->site}}/{{ $gimme->language->code }}/{{ $gimme->issue->url_name }}/{{$gimme->section->url_name}}/{{$gimme->article->number}}</guid></item>{{/list_articles}}</channel></rss>
  • yes so template code seems to be ok

    btw to generate link to article you can change

    <link>http://{{$gimme->publication->site}}/{{
    $gimme->language->code
    }}/{{$gimme->issue->url_name}}/{{$gimme->section->url_name}}/{{$gimme->article->number}}</link>

    with

    <link>{{ url options="article" }}</link>
    --
    Ljuba Rankovic
    Senior Front End Developer, Sourcefabric
    ljuba.rankovic@sourcefabric.org

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric
  • is there no way i can get it to work then using the image rendition - will i have to go back to the


    &lt;img src="http://www.domain.name{{ uri options="image $gimme->article->image->number" }}" width="150" border="0" align="left" hspace="5" /&gt;

  • where is the output generated by template which uses image renditions? the one you sent is still 150x100px
    --
    Ljuba Rankovic
    Senior Front End Developer, Sourcefabric
    ljuba.rankovic@sourcefabric.org

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric
  • the one i sent uses thumb rendition - now changed to square

    <img src="http://eastmidlandsbusinesslink.co.uk/images/cache/150x150/crop/images%7Ccms-image-000000063.jpg" width="150" height="150" alt="Grand Slam" hspace="5" />

     

    everywhere else on the site that uses the renditions uses code like

    {{ include file="_tpl/img/img_150x150.tpl" where="section" }} (from cont-section.tpl)

    and not rss / square / thumb etc

  • ok, according to feed validator http://validator.w3.org/feed/check.cgi?url=http://eastmidlandsbusinesslink.co.uk/en/static/rss this '<' symbol is the problem (some readers understand this, obviously MC and IE don't like it in that format), so instead of

    {{ image rendition="XXXXXX" }}

    <img src="{{ $view->serverUrl($image->src) }}" width="{{
    $image->width }}" height="{{ $image->height }}" alt="{{
    $image->caption }}" hspace="5" />
    {{ /image }}

    try using this

    {{ image rendition="XXXXXX" }}

    &lt;img src="{{ $view->serverUrl($image->src) }}" width="{{
    $image->width }}" height="{{ $image->height }}" alt="{{
    $image->caption }}" hspace="5" /&gt;
    {{ /image }}
    --
    Ljuba Rankovic
    Senior Front End Developer, Sourcefabric
    ljuba.rankovic@sourcefabric.org

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric
  • thanks for that a real big help

    cheers