More from FTIA

 

Statistics

The Finnish Transport Infrastructure Agency produces statistics on road, rail and maritime transport.

More

Open data

Open data is an important factor in all development, planning and purchases that FTIA does.

Read more

Transport system

The transport system comprises transport infrastructure, passenger and freight traffic and traffic management systems. The needs of people as well as businesses have been taken into account in land use and transport system planning.

More
An error occurred while processing the template.
Unable to find Velocity template with ID livi-theme_SERVLET_CONTEXT_/templates/shared/news_url.vm
1#parse ("livi-theme_SERVLET_CONTEXT_/templates/shared/news_url.vm") 
2 
3## Depends on news article structure, has hardcoded structure field names etc. 
4#set($dateFormat = "d.M.yyyy") 
5#set($timeFormat = "HH.mm") 
6 
7#set($primaryThumbnailField = "mainPicture") 
8#set($secondaryThumbnailField = "smallHighlightPicture") 
9#set($videoField = "video") 
10#set($textField = "ingress") 
11#set($linkField = "link") 
12#set($linkTextField = "linkText") 
13 
14#macro(insertNewsCard $cardAssetEntry $cardWrapperClass $readMoreButtonCssClass $isSecondaryCard) 
15    #set($thumbnailField = $primaryThumbnailField) 
16    #if("$!isSecondaryCard" == "" || $isSecondaryCard) 
17        #set($thumbnailField = $secondaryThumbnailField) 
18    #end 
19 
20    #set($article = $cardAssetEntry.getAssetRenderer().getArticle()) 
21    #set($articleDisplayDate = $article.getDisplayDate()) 
22    #set($entryXml = $saxReaderUtil.read($article.getContent())) 
23    #set($imageValue = $entryXml.valueOf("//dynamic-element[@name='${thumbnailField}']/dynamic-content/text()")) 
24    #set($videoValue = $entryXml.valueOf("//dynamic-element[@name='${videoField}']/dynamic-content/text()")) 
25 
26    <div class="$cardWrapperClass"> 
27        <div class="news-content"> 
28            #if (!$validator.isBlank($imageValue)) 
29                <div class="news-thumbnail" style="background-image:url($imageValue)">&nbsp;</div> 
30            #elseif(!$validator.isBlank($videoValue)) 
31                <div id="news-highligh-video" class="embedded-youtude-video"></div> 
32                <script type="text/javascript"> 
33                    jQuery.fn.oembed('$videoValue', { 
34                        width:  570, 
35                        height: 321, 
36                        onEmbed: function (provider, embedHtml) { 
37                            var videoContainer = jQuery('#news-highligh-video'); 
38                            videoContainer.html(jQuery(embedHtml)); 
39
40                    }); 
41                </script> 
42 
43                #set($link = $entryXml.valueOf("//dynamic-element[@name='${linkField}']/dynamic-content/text()")) 
44                #set($linkText = $entryXml.valueOf("//dynamic-element[@name='${linkField}']/dynamic-element[@name='${linkTextField}']/dynamic-content/text()")) 
45 
46 
47            #end 
48        </div> 
49        <div class="news-content-text"> 
50            <span class="news-date"> 
51                <i class="fa fa-clock-o"></i> $dateTool.format($dateFormat, $articleDisplayDate)  #language("news.highlight.time.abbreviation") $dateTool.format($timeFormat, $articleDisplayDate) 
52            </span> 
53            <h3 class="news-heading">$!cardAssetEntry.getTitle($locale)</h3> 
54            #set($entryText = $entryXml.valueOf("//dynamic-element[@name='${textField}']/dynamic-content/text()")) 
55 
56            #if (!$validator.isBlank($imageValue)) 
57                <p class="content is-truncated">$entryText</p> 
58                <a class="link-button $readMoreButtonCssClass" href="#newsUrl($cardAssetEntry)">#language("news.highlight.read.more")</a> 
59 
60            #elseif (!$validator.isBlank($link) && !$validator.isBlank($linkText)) 
61                <p class="video-content is-truncated">$entryText</p> 
62                <a class="link-button $readMoreButtonCssClass" href="$link"> 
63                    $linkText 
64                </a> 
65            #else 
66                <p class="content is-truncated">$entryText</p> 
67            #end 
68        </div> 
69    </div> 
70#end 
71 
72#if($entries.size() >= 3) 
73    <div class="news-highlight-feed"> 
74        <div class="inner-wrapper"> 
75            #if("$!assetPublisherTitle" != "") 
76                <div class="custom-portlet-heading">$assetPublisherTitle</div> 
77            #end 
78            <div class="row-fluid"> 
79                <div class="span6"> 
80                    #insertNewsCard($entries.get(0) "news-highlight-primary-card" "blue larger" false) 
81                </div> 
82                <div class="span6"> 
83                    #insertNewsCard($entries.get(1) "news-highlight-secondary-card" "orange" true) 
84                    <div class="row-spacer"></div> 
85                    #insertNewsCard($entries.get(2) "news-highlight-secondary-card" "orange" true) 
86                </div> 
87            </div> 
88            #if("$!newsLinkText" != "") 
89                <div class="news-link"><a href="$!newsLinkUrl">$newsLinkText</a></div> 
90            #end 
91        </div> 
92    </div> 
93#end