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
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- rgasch created topic »Using PageUtil::addVar() to load script code« 11:48 AM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Images in News Block/Recent News Articles
-
- Rank: Registered User
- Registered: Aug 24, 2010
- Last visit:
- Posts: 28
-
- Rank: Registered User
- Registered: Aug 24, 2010
- Last visit:
- Posts: 28
@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 -
- Rank: Developer
- Registered: Aug 23, 2003
- Last visit: May 31, 2010
- Posts: 1428
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
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 -
- Rank: Registered User
- Registered: Aug 24, 2010
- Last visit:
- Posts: 28
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 -
- Rank: Registered User
- Registered: Aug 24, 2010
- Last visit:
- Posts: 28
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
- Moderated by:
- Support
Users on-line
- 0 users
This list is based on users active over the last 60 minutes.
