Advertisement
johnbacon

ViewModel - New (Troubleshooting)

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