Changing Homepage "Categories" to "Sections"

Beantwortet

17 Kommentare

  • ModeratorWes
    Most Engaged Member of All Time - 2021

    @Michael - So instead of showing categories you would like to show the sections there.  I also have an accordion setup in the Copenhagen theme, you can see it here.  With that being said it is possible to pull in sections.

    0
  • qa

    is there a way to customize the column width in Copenhagen theme?

    currently, if there are 4 categories, the first 3 categories will be in the same row, but the last one will be in the second row and has width of 3 columns like seen in first row, is there a way to make it the same width as seen in the first row's column?

    thanks for the tips =)

    0
  • Dan Kemp

    Did we find a way to display sections instead of categories as Michael asked? I'd like to do that too.

    0
  • Amy Phillips

    I would like to do this as well: have ONE category, then show the sections on the home page.  Is this possible? if so, how?

    Thanks!

    0
  • ModeratorWes
    Most Engaged Member of All Time - 2021

    @Amy - If you only have one category then all of your sections will show on the home page.  The sections will show in the boxes just like categories would.  By default, the code says if you only have one category then don't show the category and show the sections instead.  By the way, this is how it works for the Copenhagen theme so please ensure you are using that theme.

    0
  • Shane

    I realize this thread is old; however, I have a somewhat related question. I'd like to add a particular section to the homepage and list the first (X) articles from said section. I've been combing the help docs but so far have come up empty. Any ideas? Should I start a new thread?

     

    0
  • Jessie Schutz
    Zendesk Customer Care

    Hi Shane!

    I imagine this could be possible with custom code...let me check with some of our Community Moderators to see if they can shed any light on it.

    0
  • Sven Cune

    Hi there, I would like to achieve the same as Shane. Do you happen to have an update on this Jessie?

    Thank you!

    0
  • ModeratorWes
    Most Engaged Member of All Time - 2021

    @Shane and Sven - Why not make the articles promoted from that section and then let them show in the promoted articles area.  That will accomplish the same thing that you are asking unless you have other promoted articles.  If you want to pull articles from a section then you will need to use the {{is}} curlybar in order to accomplish that.

    0
  • Sven Cune

    @Wes, thank you for your reply! In my particular case I use the promote articles feature to highlight articles that are most relevant from a content perspective. Besides the promoted articles I want to have an Announcement section on the page that shows the latest 5 articles in that section with the newest at the top.

    I tried to use the following curlybar for this, but the following only works on the category, section and article templates I believe? 

    {{#is section.id 200646205}}
      <p><strong>This is important security information! Pay attention!</strong></p>
    {{/is}}

    Any tips on how to display section content on the homepage would be great! 

    0
  • Sven Cune

    I managed as follows: 

     

    <div>
    {{#each categories}}
    {{#isnt name ''}} <!-- if you need to hide sections -->
    {{#each sections}}
    {{#isnt name ''}} <!-- if you need to hide sections -->
    <section class="section">
    <a href="{{url}}">
    <h3 class=home-section>{{name}}</h3></a>
    <ul class="article-list promoted-articles">
    {{#each articles}}
    <li class="promoted-articles-item "> 
    <a href="{{url}}">
    {{#if promoted}}
    <i class="icon-star" "promoted-icon"></i>
    {{/if}}
    {{title}}
    </a> 
    </li>
    {{/each}}
    </ul>
    {{#if more_articles}}
    <a href="{{url}}" class="see-all-articles button-small" role="button">
    {{t 'show_all_articles' count=article_count}}
    </a>
    {{/if}}
    </section>
    {{/isnt}}
    {{/each}}
    {{/isnt}}
    {{/each}}
    </div>
    0
  • ModeratorWes
    Most Engaged Member of All Time - 2021

    @Sven - That will work, its very similar to the code I used.  Here is what I used which I pull the same information:  As you can I grabbed the catgory ID that the section it belongs to in case you want to display anything about the category.

     

    {{#each categories}}
    {{#is id 115001216103}}
    {{#each sections}}
    {{#is id 115001526163}}
    <h2 class="" data-target="{{id}}-articles">{{name}}</h2>
    {{/is}}
    {{/each}}
    <section class="articles">
    {{#each sections}}
    <section id="{{id}}-articles" class="" style="{{#isnt id 115001526163}} display:none;{{/isnt}}">
    {{#if articles}}
    <ul class="article-list promoted-articles">
    {{#each articles}}
    <li class="promoted-articles-item">
    {{#if promoted}}
    <span data-title="{{t 'promoted'}}">★</span>
    {{/if}}
    <a href="{{url}}">{{title}}</a>
    </li>
    {{/each}}
    </ul>
    {{/if}}
    </section>
    {{/each}}
    {{/is}}
    {{/each}}
    </section>

     

     

    0
  • Mike Tamosaitis

    Wes,

    Is there a way to break up the categories Like the picture below? 

    0
  • Jessie Schutz
    Zendesk Customer Care

    Hi Mike!

    There's a thread about using category images over here...that should get you most of the way there!

    0
  • ModeratorWes
    Most Engaged Member of All Time - 2021

    @Mike sure you can divide things up.  You would just have to use some if statements to only call the sections for those categories.  

     

    @ Jessie - the better post for images is here

    0
  • Mike Tamosaitis

    @Wes, 

    Question, if I am trying to break up the layout of the categories on the home page why would I call the sections? 

    0
  • Trapta Singh
    Community Moderator

    Hi @Christer,

    If you are using Copenhagen theme then it will be available there by default. If not, then you can do this by adding

    <p class="blocks-item-description">{{excerpt description}}</p>

    after line no. 15 and line no. 28 in home_page.hbs template.

    Let me know if you face any issue.

    Team Diziana

    0

Post ist für Kommentare geschlossen.

Powered by Zendesk