Fork me on GitHub

Images in News Block/Recent News Articles  Bottom

  • I want to include a thumbnail image associated with a News article in a News Block or in Content's "Recent news articles." I cannot figure out the code to place in news_block_storiesext_row.htm or newsarticles_view.html to access any of the images associated with the News article. Any ideas?

    --
    km
  • @espaan, I could use your help.

    From what I can gather, there are no images associated with each article in stories.php or storiesext.php. Is there an easy way to access the thumbnail created for news_user_index.htm?

    Any help is appreciated.

    --
    km
  • Hi, To be honest I dont exactly follow what you are trying to do. All is possible, so no worries there. As long as you have images uploaded with the basic image upload facility in News you have access to them with code in the templates.

    What version of News and Zikula are you using? So that I know where to look icon_smile
    The code for the News images can be seen in news_user_articlecontent.htm,

    look for $picupload_enabled AND $info.pictures gt 0 There starts an if and the code runs to the next closing /if.
    The images are just a reference to the location of hte images on the disk. If you only want to display a thumbnail then just
    copy and play with that part.

    In my local copy I do have images in the news_block_storiesext_row template. I can send you the file that has the image code in the template.



    Edited by espaan on Nov 21, 2011 - 08:49 PM.

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • Thanks for the reply! What I am trying to do is access thumbnail photos associated with my articles when displaying recent headlines in a block.

    I am using News 2.6.2 and Zik 1.2.7.

    I will play with news_user_articlecontent.htm and see what I can do. If I can't manage to hack it I'll write back. Thanks!

    --
    km
  • Ok, I definitely still need help.

    I am trying to create either a block or a section in a Content page that lists my most recent articles and displays a small thumbnail next to each one. The part I cannot achieve is the thumbnail image.

    When working with a block, I have tried adjusting news_block_storiesext_row.htm and news_storiesext_scrollpause.htm. When I enter code like

    Code

    <div class="news_pictures">
            <!--[section name=counter start=1 loop=$info.pictures step=1]-->
                <div class="news_photoslide news_thumbsslide">
                    <a href="<!--[$picupload_uploaddir]-->/pic_sid<!--[$info.sid]-->-<!--[$smarty.section.counter.index]-->-norm.jpg" rel="imageviewer[sid<!--[$info.sid]-->]"><span></span>
                    <img src="<!--[$picupload_uploaddir]-->/pic_sid<!--[$info.sid]-->-<!--[$smarty.section.counter.index]-->-thumb.jpg" alt="<!--[gt text='Picture %s for %s' tag1=$smarty.section.counter.index tag2=$info.title]-->" /></a>
                </div>
            <!--[/section]-->
        </div>


    the output is no picture, just the alt text which incidentally says "Picture 0 for 0."

    The same happens when working with Content and newsarticles_view.html

    --
    km
  • 0 users

This list is based on users active over the last 60 minutes.