Vivvo CMS Support Forum Home | Free Trial | Online Demo | Docs and Manuals | Order Now   

Go Back   Vivvo CMS Support Forums > Code and Template Customizations > Customizations & Templates

Customizations & Templates Various hacks and customizations for Vivvo 4 branch. Template repository and all related template customization discussions.

Reply
 
Thread Tools Display Modes
Old 05-21-2012, 05:46 PM   #1
worldobservers
Senior Vivvo User
 
Join Date: May 2012
Location: Australia
Posts: 116
Rep Power: 1
worldobservers is on a distinguished road
Default images for the first post

need help creating custom left box

i did create custom tpl file that shows images with all post

i need help modify the code in order to grab image only for the first post and other posts to be title only.

here is the code:


Code:
<vte:template>
	<div class="short">
		<div class="short_holder">
			<h2 class="article_title"><a href="{article.get_href}"><vte:value select="{article.get_title}" /></a></h2>
			<vte:if test="{article.image}">
				<div class="image">
					<a href="{article.get_href}">
                        <vte:if test="{article.get_image_caption}">
                            <vte:variable name="image_caption" value="{article.get_image_caption}" />
                            <vte:else>
                                <vte:variable name="image_caption" value="{article.get_title}" />
                            </vte:else>
                        </vte:if>
                        <img src="{VIVVO_STATIC_URL}thumbnail.php?file={article.get_image}&amp;size=summary_medium" alt="{image_caption}" /><br />
                    </a>
				</div>
			</vte:if>
			<p>
				<vte:value select="{article.get_summary}" /> <vte:if test="{article.body}">...</vte:if>
				<vte:if test="!{article.get_link}">
					<vte:if test="{article.body}">
						<a href="{article.get_href}"> <vte:value select="{LNG_FULL_STORY}" /></a>
					</vte:if>
					<vte:else>
						<a class="visit" href="{article.get_link}"><img src="{VIVVO_THEME}img/external.png" alt="{LNG_VISIT_WEBSITE}"/></a>
					</vte:else>
				</vte:if>
			</p>
		</div>
	</div>
</vte:template>

Last edited by Micha; 05-22-2012 at 08:11 AM.
worldobservers is offline   Reply With Quote
Old 05-22-2012, 08:16 AM   #2
Micha
Administrator
 
Micha's Avatar
 
Join Date: Feb 2006
Location: Belgrade
Posts: 2,661
Rep Power: 10
Micha will become famous soon enough
Default

The code above looks like summary template code only.
I suggest you look into default category template, where you can find code example of how to make first article different from others (it's foreach statement with start and loop variables).

For example, within box article list module, you can have something like this:

Code:
<vte:foreach item = "article" from = "{article_list}" start="1" loop="1">
    Code for the article with image (you can even include summary/default.tpl template here)
</vte:foreach>
<ul>
  <vte:foreach item = "article" from = "{article_list}" start="2">
    <li><a href="{article.get_href}"><vte:value select="{article.title}" /></a></li>
  </vte:foreach>
</ul>
__________________
--[Read Forum Rules and Guidelines before you post!!!]--

Djole, Djole, bas si bezobrazan sto si se pravio da si mali zekan. Zato cu te dobro kazniti...
Micha is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Order now:

Order your copy of Vivvo now and get:
bullet Six months free upgrades
bullet Free support
bullet Full source code
bullet Immediate download
bullet Starting at only $295.00
Order now

Support HelpDesk:

You can submit a trouble ticket in the support area at any time, using your client area email and password.

Vivvo CMS Resource Center:

The Vivvo CMS Resource Center is your window to a variety of resources that showcase Vivvo's features and technologies. So whether you're brand new to Vivvo or a seasoned user, you can find the information you need right here!

Latest Additions:

Contact us:

Business hours
Mon-Fri 9:00AM - 6:00PM GMT+1
(Europe)
Telephone Sales
381 11 311-50-20
Email inquiries
sales@vivvo.net
(Sales inquiries)
support@vivvo.net
(Support inquiries)

All times are GMT +1. The time now is 01:00 PM.
Contact Us - Vivvo Home - Archive - Privacy Statement - Top

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.