Jump to content

cafeboricua

Clients
  • Posts

    339
  • Joined

  • Last visited

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Posts posted by cafeboricua

  1. And regarding the grid view for article listings: while that is not a default option, it only needs a small template change, since a responsive grid is already in the CSS. 

    So to have a grid view for articles:

    1. Add a custom database template in the Pages’ template manager. Make sure it’s of the type “Featured Records”. Also make sure you assign it to your article database. Also call it “Article Grid” (that name is later used in the code). 

    Bildschirmfoto_2015-07-11_um_17.47.19.th

    2. Open the “index” template of this newly created template group. 

    Replace this part:

    {{if count($articles)}}
    		{{foreach $articles as $id => $record}}
    			{template="entry" app="cms" location="database" group="article_grid" params="$record, $database"}
        {{endforeach}}
    {{endif}}

    With this:

    {{if count($articles)}}
        <div class='ipsGrid ipsGrid_collapsePhone'>
    		{{foreach $articles as $id => $record}}
                <div class='ipsGrid_span6'>
    			{template="entry" app="cms" location="database" group="article_grid" params="$record, $database"}
                </div>	
        {{endforeach}}
        </div>
      {{endif}}

    That’s it. Your articles are now displayed as a grid which automatically collapses on smaller screen. 

    And a bonus for all those who want the 2x1x1 layout from 3.4 – use this instead:

    {{if count($articles)}}
        <div class='ipsGrid ipsGrid_collapsePhone'>
    		{{foreach $articles as $id => $record}}
                {{if ($id == 0)}} <div class='ipsGrid_span12'>
                {{else}}<div class='ipsGrid_span6'>
                {{endif}}
    			{template="entry" app="cms" location="database" group="article_grid" params="$record, $database"}
                </div>	
            {{endforeach}}
        </div>
    {{endif}}

    Bildschirmfoto_2015-07-11_um_18.06.34.th

     

    I did exactly this and I got an error.  Dont know what I did wrong...:(

×
×
  • Create New...