Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8527161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:28:41+00:00 2026-06-11T08:28:41+00:00

I am using a logic operator in Jekyll but it’s not working. Page one,

  • 0

I am using a logic operator in Jekyll but it’s not working.

Page one, two and three all use the same layout (part of a multilingual solution, works good but requires logical loops for some layout control to keep things DRY.)

Here’s the code:

{% if page.type == "post" %}
{% include post.html %}
{% elseif page.class == "contact" %}
{% include contact.html %}
{% else %}
{{ content }}
{% endif %}

If I break it down to just an else and an if else setup, with any two of the tree, everything works. But as soon as I use a third condition it breaks. Am I limited to two conditionals with Jekyll? I can potentially restructure to make a case operator applicable, but I’d prefer to understand the fundamental problem here. Thanks all.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:28:42+00:00Added an answer on June 11, 2026 at 8:28 am

    In Jekyll/Liquid else-if is spelt elsif, i.e.:

    {% if page.type == "post" %}
    {% include post.html %}
    {% elsif page.class == "contact" %}
    {% include contact.html %}
    {% else %}
    {{ content }}
    {% endif %}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can we separate Logic from presentation without using any template engine (traditional php-not
I was asked to perform this operation of ternary operator use: $test='one'; echo $test
My jsp page display a list using logic iterate. every row displayed has a
public MyClass(int someUniqueID) { using(//Session logic) { var databaseVersionOfMyClass = session.CreateCriteria(/*criteria*/) .UniqueResult<MyClass>(); //Load logic
here i am using window service, using a logic as my service will work
i'm using ECLiPSe programming logic system. i want to implement the yield method for
I'm using the following logic to add a custom handler to a form that's
After a successful update, I am using the following logic to restart the application:
I am using PostSharp to add some compile time logic to my attributes -
Currently I'm using TestNG framework for testing application business logic, i added some Servlet

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.