Advertisement
johnbacon

ViewModel - Original

Mar 8th, 2012
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 24.86 KB | None | 0 0
  1. {embed="embeds/.wrapper" layout="news-layout" nav_active="news" default_title="News" default_description="The latest studio news and updates from Red Storm Entertainment."}
  2. {preload_replace:channels='news|featured'}
  3. {preload_replace:excerpt='{exp:ifelse parse="inward"}{if featured_excerpt}{featured_excerpt}{if:elseif news_excerpt}{news_excerpt}{/if}{/exp:ifelse}'}
  4.  
  5.  
  6.     {exp:stash:set save="yes" scope="site" refresh="1440" parse="inward" parse_tags="yes" parse_depth="3"}
  7.       {stash:content}
  8.  
  9.           <div class="left-column news-main">
  10.             <section class="mod posts">
  11.               <header>
  12.                   <h2>Studio Feed</h2>
  13.                   <ul class="buttons"><li><a class="rss ir" href="http://feeds.feedburner.com/redstorm" title="Subscribe via RSS">RSS Feed</a></li></ul>
  14.               </header>
  15.  
  16.               {exp:switchee variable="{segment_2}/{segment_4}" parse="inward" debug="yes"}
  17.  
  18.                 {!-- show the base index page unless there is pagination --}
  19.                 {case default="yes"}
  20.  
  21.                     <ul class="posts-index">
  22.  
  23.                           {exp:channel:entries
  24.                               channel="{channels}"
  25.                               disable="categories|category_fields|member_data"
  26.                               limit="5"
  27.                               dynamic="no"
  28.                               paginate="bottom"
  29.                               year="{segment_2}"
  30.                               month="{segment_3}"
  31.                               cache="yes"
  32.                               refresh="40320"
  33.                               status="not closed"
  34.                               }
  35.                               {if switchee_no_results}
  36.                                   {redirect="404"}
  37.                               {/if}
  38.  
  39.                                     <li>
  40.                                       <article>
  41.                                         <div class="news-preview-text">
  42.                                           <header>
  43.                                             <h6><a href="{path='news/{entry_date format="%Y/%m"}/{url_title}/'}">{title}</a></h6>
  44.                                           </header>
  45.                                           <div class="excerpt">{excerpt}</div>
  46.                                         </div>
  47.                                         <a class="posts-thumb" href="{path='news/{entry_date format="%Y/%m"}/{url_title}'}">
  48.                                           {exp:ifelse parse="inward"}{if featured_image_listing_thumbnail}<img src="http://dynamic.redstorm.com{featured_image_listing_thumbnail}" height="167" width="172">{if featured_photo_gallery}<img class="btn-gallery" src="/img/btn-gallery.png" alt="Photo Gallery" height="54" width="54">{if:elseif news_photo_gallery}<img class="btn-gallery" src="/img/btn-gallery.png" alt="Photo Gallery" height="54" width="54">{/if}{if:elseif featured_image}
  49.                                             {exp:ce_img:pair
  50.                                                 src="{featured_image_listing}"
  51.                                                 fallback_src="{featured_image}"
  52.                                                 max_width="172"
  53.                                                 max_height="167"
  54.                                                 crop="yes"
  55.                                                 cache="yes"
  56.                                                 refresh="40320"
  57.                                                 hash_filename="yes"
  58.                                                 quality="95"
  59.                                                 save_type="jpg"
  60.                                                 filter="sharpen,20"
  61.                                                 }
  62.                                                 <img src="http://dynamic.redstorm.com{made}" height="{height}" width="{width}">{if featured_photo_gallery}<img class="btn-gallery" src= "/img/btn-gallery.png" alt="Photo Gallery" height="54" width="54">{if:elseif news_photo_gallery}<img class="btn-gallery" src="/img/btn-  gallery.png" alt="Photo Gallery" height="54" width="54">{/if}
  63.                                             {/exp:ce_img:pair}
  64.                                           {if:elseif news_image_listing_thumbnail}<img src="http://dynamic.redstorm.com{news_image_listing_thumbnail}" height="167" width="172">{if   news_photo_gallery}<img class="btn-gallery" src="/img/btn-gallery.png" alt="Photo Gallery" height="54" width="54">{/if}
  65.                                           {if:elseif news_image}
  66.                                             {exp:ce_img:pair
  67.                                                 src="{news_image}"
  68.                                                 max_width="172"
  69.                                                 max_height="167"
  70.                                                 crop="yes"
  71.                                                 cache="yes"
  72.                                                 refresh="40320"
  73.                                                 hash_filename="yes"
  74.                                                 quality="95"
  75.                                                 save_type="jpg"
  76.                                                 filter="sharpen,20"
  77.                                                 }
  78.                                                 <img src="http://dynamic.redstorm.com{made}" height="{height}" width="{width}">{if news_photo_gallery}<img class="btn-gallery" src="  /img/btn-gallery.png" alt="Photo Gallery" height="54" width="54">{/if}
  79.                                             {/exp:ce_img:pair}
  80.                                           {/if}{/exp:ifelse}
  81.                                         </a>
  82.                                         <footer class="news-list-footer">
  83.                                           <a href="{path='news/{year}/{month}/{url_title}'}" class="read-more ir" title="Read more...">Read more...</a>
  84.                                           <a href="{path='news/{entry_date format="%Y/%m"}/{url_title}/'}#comments" class="comments-preview"><fb:comments-count data-href="{path='news/{entry_date format="%Y/%m"}/{url_title}}">&nbsp;&nbsp;</fb:comments-count> comments</a>
  85.                                         </footer>
  86.                                       </article>
  87.                                     </li>
  88.                                     {!-- change pagination to ordered list at some point in the future --}
  89.                                     {paginate}<div class="pagination">
  90.  
  91.                                         <span class="count-span">Page {abp_current_page_num_liber} of {abp_total_pages}</span>
  92.  
  93.                                             {abp_pages}
  94.  
  95.                                                 {exp:ifelse parse="inward"}{if abp_is_current}
  96.                                                     <span class="this-page">{abp_num}</span>
  97.                                                 {if:else}
  98.                                                     <a href="{abp_link}">{abp_num}</a>
  99.                                                 {/if}{/exp:ifelse}
  100.  
  101.                                             {/abp_pages}
  102.                                         <span class="padding">...</span>
  103.                                         <a href="{abp_last_link}" class="last-page">Last&rarr;</a>
  104.                                       </div>{/paginate}
  105.                                   {/exp:channel:entries}
  106.                                 </ul>
  107.                             </section>
  108.  
  109.                 {/case}
  110.  
  111.                 {!-- new to use {case value="#^P(\d+)\/$#|#P(\d+)$#"} --}
  112.                 {case value="#^P(\d+)\/$#|#P(\d+)$#"}
  113.  
  114.                     <ul class="posts-index">
  115.  
  116.                          {exp:channel:entries
  117.                               channel="{channels}"
  118.                               disable="categories|category_fields|member_data"
  119.                               limit="5"
  120.                               dynamic="no"
  121.                               paginate="bottom"
  122.                               status="not closed"
  123.                               }
  124.                               {!-- if no matches, show 404 page --}
  125.                               {if switchee_no_results}
  126.                                   {redirect="404"}
  127.                               {/if}
  128.  
  129.                                     <li>
  130.                                       <article>
  131.                                         <div class="news-preview-text">
  132.                                           <header>
  133.                                             <h6><a href="{path='news/{entry_date format="%Y/%m"}/{url_title}/'}">{title}</a></h6>
  134.                                           </header>
  135.                                           <div class="excerpt">{excerpt}</div>
  136.                                         </div>
  137.                                         <a class="posts-thumb" href="{path='news/{entry_date format="%Y/%m"}/{url_title}'}">
  138.                                           {exp:ifelse parse="inward"}{if featured_image_listing_thumbnail}<img src="http://dynamic.redstorm.com{featured_image_listing_thumbnail}"  height="167" width="172">{if featured_photo_gallery}<img class="btn-gallery" src="/img/btn-gallery.png" alt="Photo Gallery" height="54" width="54">{/if}{if:elseif featured_image}
  139.                                             {exp:ce_img:pair
  140.                                                 src="{featured_image_listing}"
  141.                                                 fallback_src="{featured_image}"
  142.                                                 max_width="172"
  143.                                                 max_height="167"
  144.                                                 crop="yes"
  145.                                                 cache="yes"
  146.                                                 refresh="40320"
  147.                                                 hash_filename="yes"
  148.                                                 quality="95"
  149.                                                 save_type="jpg"
  150.                                                 filter="sharpen,20"
  151.                                                 }
  152.                                                 <img src="http://dynamic.redstorm.com{made}" height="{height}" width="{width}">{if featured_photo_gallery}<img class="btn-gallery" src= "/img/btn-gallery.png" alt="Photo Gallery" height="54" width="54">{/if}
  153.                                             {/exp:ce_img:pair}
  154.                                           {if:elseif news_image_listing_thumbnail}<img src="http://dynamic.redstorm.com{news_image_listing_thumbnail}" height="167" width="172">{if   news_photo_gallery}<img class="btn-gallery" src="/img/btn-gallery.png" alt="Photo Gallery" height="54" width="54">{/if}
  155.                                           {if:elseif news_image}
  156.                                             {exp:ce_img:pair
  157.                                                 src="{news_image}"
  158.                                                 max_width="172"
  159.                                                 max_height="167"
  160.                                                 crop="yes"
  161.                                                 cache="yes"
  162.                                                 refresh="40320"
  163.                                                 hash_filename="yes"
  164.                                                 quality="95"
  165.                                                 save_type="jpg"
  166.                                                 filter="sharpen,20"
  167.                                                 }
  168.                                                 <img src="http://dynamic.redstorm.com{made}" height="{height}" width="{width}">{if news_photo_gallery}<img class="btn-gallery" src="  /img/btn-gallery.png" alt="Photo Gallery" height="54" width="54">{/if}
  169.                                             {/exp:ce_img:pair}
  170.                                           {/if}{/exp:ifelse}
  171.                                         </a>
  172.                                         <footer class="news-list-footer">
  173.                                           <a href="{path='news/{year}/{month}/{url_title}'}" class="read-more ir" title="Read more...">Read more...</a>
  174.                                           <a href="{path='news/{entry_date format="%Y/%m"}/{url_title}/'}#comments" class="comments-preview"><fb:comments-count data-href="{path='news/{entry_date format="%Y/%m"}/{url_title}'}">&nbsp;&nbsp;</fb:comments-count> comments</a>
  175.                                         </footer>
  176.                                       </article>
  177.                                     </li>
  178.                                     {paginate}<div class="pagination">
  179.  
  180.                                         <span class="count-span">Page {abp_current_page_num_liber} of {abp_total_pages}</span>
  181.  
  182.                                             {abp_pages}
  183.  
  184.                                                 {if abp_is_current}
  185.                                                     <span class="this-page">{abp_num}</span>
  186.                                                 {if:else}
  187.                                                     <a href="{abp_link}">{abp_num}</a>
  188.                                                 {/if}
  189.  
  190.                                             {/abp_pages}
  191.                                         <span class="padding">...</span>
  192.                                         <a href="{abp_last_link}" class="last-page">Last&rarr;</a>
  193.                                       </div>{/paginate}
  194.                                   {/exp:channel:entries}
  195.                                 </ul>
  196.                             </section>
  197.  
  198.                 {/case}
  199.  
  200.                 {case value="#^20\d\d\/[a-z]([\w'-])*+$#"}
  201.  
  202.                           {exp:channel:entries
  203.                               channel="{channels}"
  204.                               dynamic="no"
  205.                               disable="categories|category_fields|member_data|pagination"
  206.                               require_entry="yes"
  207.                               url_title="{segment_4}"
  208.                               cache="yes"
  209.                               refresh="40320"
  210.                               status="open|closed|removed_from_frontpage"
  211.                               }
  212.                               {!-- if no matches, show 404 page --}
  213.                               {if switchee_no_results}
  214.                                   {redirect="404"}
  215.                               {/if}
  216.  
  217.                               {stash:og_description}{exp:ifelse parse="inward"}{if featured_excerpt}{featured_excerpt}{/if}{if news_excerpt}{news_excerpt}{/if}{/exp:ifelse}{/stash:og_description}
  218.  
  219.                               {stash:facebook_image}{exp:ifelse parse="inward"}{if featured_image_listing_thumbnail}http://redstorm.com{featured_image_listing_thumbnail}{if:elseif featured_image_listing}http://redstorm.com{featured_image_listing}{if:elseif}http://redstorm.com{featured_image}{if:elseif news_image_listing_thumbnail}http://redstorm.com{news_image_listing_thumbnail}{if:elseif news_image_custom}http://redstorm.com{news_image_custom}{if:else}http://redstorm.com{news_image}{/if}{/exp:ifelse}{/stash:facebook_image}
  220.  
  221.                   <article class="full-post">
  222.                     <header>
  223.                       <h1>{title}</h1>
  224.                       <h5 class="author">By {exp:ifelse parse="inward"}{if news_author}{news_author}{if:else}{author}{/if}{/exp:ifelse} posted <time datetime="{entry_date format="%Y-%m-%d %H:%i"}">{entry_date format="%M %j, %Y"} {entry_date format="%g:%i%A"}</time></h5>
  225.                     {exp:ifelse parse="inward"}
  226.                       {if featured_video_embed}
  227.                         {featured_video_embed}
  228.                       {if:elseif news_video_embed}
  229.                         {news_video_embed}
  230.                       {if:elseif featured_excerpt}
  231.                           {exp:ce_img:pair
  232.                               src="{featured_image_listing}"
  233.                               fallback_src="{featured_image}"
  234.                               max_width="543"
  235.                               max_height="300"
  236.                               crop="yes"
  237.                               hash_filename="yes"
  238.                               quality="96"
  239.                               save_type="jpg"
  240.                               allow_scale_larger="no"
  241.                               filter="sharpen,20"
  242.                               }
  243.                               <a class="post-image thumb" rel="gallery" href="{featured_image}"><img src="http://dynamic.redstorm.com{made}" width="{width}" height="{height}" alt="{title}"></a>
  244.                           {/exp:ce_img:pair}
  245.                         {if:elseif news_excerpt}
  246.                           {exp:ce_img:pair
  247.                               src="{news_image_custom}"
  248.                               fallback_src="{news_image}"
  249.                               max_width="543"
  250.                               max_height="300"
  251.                               crop="yes"
  252.                               hash_filename="yes"
  253.                               quality="96"
  254.                               save_type="jpg"
  255.                               allow_scale_larger="no"
  256.                               filter="sharpen,20"
  257.                               }
  258.                                <a class="post-image thumb" rel="gallery" href="{news_image}"><img src="http://dynamic.redstorm.com{made}" width="{width}" height="{height}" alt="{title}"></a>
  259.                           {/exp:ce_img:pair}
  260.                         {/if}
  261.                       {/exp:ifelse}
  262.                       <div class="supplemental-info">
  263.                           <div class="addthis_toolbox addthis_default_style">
  264.                             <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
  265.                             <a class="addthis_button_tweet" tw:via="RedStorm" tw:related="ghostrecon|ubisoft"></a>
  266.                             <a class="addthis_button_google_plusone" g:plusone:size="medium" g:plusone:annotation="bubble"></a>
  267.                           </div>
  268.                       </div>
  269.                     </header>
  270.                     {exp:ifelse parse="inward"}{if featured_body}{featured_body}{if:elseif news_body}{news_body}{/if}{/exp:ifelse}
  271.  
  272.                       {exp:ifelse parse="inward"}
  273.                         {if featured_photo_gallery}
  274.                           <ul class="gallery" id="gallery">
  275.                           {featured_photo_gallery}
  276.                             {exp:ce_img:pair
  277.                                 src="{featured_photo_gallery}"
  278.                                 width="240"
  279.                                 height="152"
  280.                                 crop="yes|center,top|0,0"
  281.                                 cache="yes"
  282.                                 refresh="40320"
  283.                                 hash_filename="yes"
  284.                                 quality="90"
  285.                                 save_type="jpg"
  286.                                 filter="sharpen,10"
  287.                                 }
  288.                               <li><a class="thumb" rel="gallery" href="{orig}"><img src="http://dynamic.redstorm.com{made}" height="152" width="240"></a></li>
  289.                             {/exp:ce_img:pair}
  290.                           {/featured_photo_gallery}
  291.                         </ul>
  292.                       {if:elseif news_photo_gallery}
  293.                         <ul class="gallery" id="gallery">
  294.                           {news_photo_gallery}
  295.                             {exp:ce_img:pair
  296.                                 src="{news_photo_gallery}"
  297.                                 width="240"
  298.                                 height="152"
  299.                                 crop="yes|center,top|0,0"
  300.                                 cache="yes"
  301.                                 refresh="40320"
  302.                                 hash_filename="yes"
  303.                                 quality="90"
  304.                                 save_type="jpg"
  305.                                 filter="sharpen,10"
  306.                                 }
  307.                               <li><a class="thumb" rel="gallery" href="{orig}"><img src="http://dynamic.redstorm.com{made}" height="152" width="240"></a></li>
  308.                             {/exp:ce_img:pair}
  309.                           {/news_photo_gallery}
  310.                         </ul>
  311.                       {/if}{/exp:ifelse}
  312.             {/exp:channel:entries}
  313.                     <footer>
  314.                       {exp:favrik_nextprev:prev_entry id="{segment_4}" status="not closed" channel="news|featured" disable="categories|member_data"}
  315.                         <a rel="prev" class="btn-prev ir" title="{title}" href="{site_url}news/{entry_date format="%Y/%m"}/{url_title}">Previous Entry</a>
  316.                       {/exp:favrik_nextprev:prev_entry}
  317.  
  318.                       {exp:favrik_nextprev:next_entry id="{segment_4}" status="not closed" channel="news|featured" disable="categories|member_data"}
  319.                         <a rel="next" class="btn-next ir" title="{title}" href="{site_url}news/{entry_date format="%Y/%m"}/{url_title}">Next Entry</a>
  320.                       {/exp:favrik_nextprev:next_entry}
  321.                     </footer>
  322.                   </article>
  323.  
  324.               </section>
  325.  
  326.               <aside class="mod comments" id="comments">
  327.  
  328.                 <div class="fb-comments" data-href="{current_url}" data-num-posts="10" data-width="582" data-colorscheme="dark"></div>
  329.  
  330.               </aside>
  331.  
  332.           {/case}
  333.  
  334.         {/exp:switchee}
  335.  
  336.       </div>{!-- /.left-column --}
  337.  
  338.       <aside class="right-column news-aside">
  339.  
  340.         <section class="mod recent-activity">
  341.  
  342.           <header>
  343.             <h2>Recent Activity</h2>
  344.             <ul class="buttons"><li><a class="facebook ir" href="http://facebook.com/ubisoftredstorm" title="Follow us on Facebook">Facebook</a></li></ul>
  345.           </header>
  346.  
  347.           <div class="fb-activity" data-site="redstorm.com" data-width="356" data-height="332" data-header="false" data-colorscheme="dark" data-border-color="#272727" data-font="arial" data-recommendations="true"></div>
  348.  
  349.         </section>
  350.  
  351.         <section class="mod tweets">
  352.           <header>
  353.             <h2>tweets</h2>
  354.             <ul class="buttons"><li><a class="twitter ir" href="http://twitter.com/redstorm" title="Follow us on Twitter">Twitter</a></li></ul>
  355.           </header>
  356.           <article class="tweet-news" id="tweet-news">
  357.             <ul class="tweet-list">
  358.               {exp:tweetline
  359.                 username="redstorm"
  360.                 limit="3"
  361.                 format="yes"
  362.                 mentions="yes"
  363.                 retweets="false"
  364.                 cache="60"
  365.               }
  366.               <li>
  367.                 <a href="http://twitter.com/redstorm" class="tweet-avatar ir">
  368.                   RedStorm
  369.                 </a>
  370.                 <p>
  371.                   <a href="http://twitter.com/redstorm">RedStorm</a>
  372.                   {post} <em>{rel_date}</em>
  373.                 </p>
  374.               </li>
  375.               {/exp:tweetline}
  376.             </ul>
  377.           </article>
  378.         </section><!-- /.tweets -->
  379.  
  380.         {!--<section class="mod" style="background: url(/img/bg-o74.png) repeat; width: 306px; padding: 19px 25px 18px;"><fb:like href="http://facebook.com/ubisoft.redstorm" width="300" height="80"></section>
  381.  
  382.         <section class="mod recent-activity">
  383.  
  384.           <header>
  385.             <h2>Follow Us</h2>
  386.             <a class="facebook" href="http://facebook.com/ubisoft.redstorm">Twitter</a>
  387.           </header>
  388.  
  389.           <div class="fb-like-box" data-href="http://www.facebook.com/ubisoft.redstorm" width="356" data-colorscheme="dark" data-show-faces="true" data-border-color="#272727" data-stream="false" data-header="false"></div>
  390.  
  391.         </section> --}
  392.  
  393.         <section class="mod archives">
  394.  
  395.           <header>
  396.             <h2>Archives</h2>
  397.           </header>
  398.  
  399.             {exp:low_yearly_archives
  400.                 channel="news|featured"
  401.                 dynamic="no"
  402.                 sort="asc"
  403.                 status="open"
  404.                 disable="categories|category_fields|custom_fields|member_data|pagination"
  405.             }
  406.             {if year_count == 1}<ul class="archive-list" id="archive-list">{/if}
  407.               <li class="archive-year">
  408.                 <h2><a href="{path=news}/{year}">{year}</a></h2>
  409.                 <ul class="archive-months">
  410.                 {months}
  411.                   <li>{if num_entries != 0}<a href="{path='news'}/{year}/{month_num}" title="{num_entries} entries in {month} {year}">{month} ({num_entries})</a>{/if}{if num_entries == 0}{month}{/if}</li>
  412.                 {/months}
  413.                 </ul>
  414.               </li>
  415.             {if year_count == total_years}</ul>{/if}
  416.             {/exp:low_yearly_archives}
  417.  
  418.         </section>
  419.  
  420.       </aside>{!-- /.secondary --}
  421.  
  422.       {/stash:content}
  423. {/exp:stash:set}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement