Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    beau sebastien
    @sebastienbeau
    upgrade from v3 to V4 should work without database migration. V4 support V3 site. If you want to use the new killer feature "section" you need to rework your template in order to remove all editable content
    Cristian Livadaru
    @lcx
    ok, cool. thanks. So I will clone the existing server and put a locomotive4 on it see what happens. If current sites work as they do that is already a huge step and the "section" part I will check out once I'm done migrating.
    Cristian Livadaru
    @lcx
    so, done. german Translation is now 100% complete.
    beau sebastien
    @sebastienbeau
    great
    Manu
    @manuchap
    nice! about mongodb I've had trouble with 3.6 so I had to force 3.4 on my system (and server).
    Nikolay Bonev
    @DonKoko

    Hey guys. I am experiencing some strange behaviour on one of my sites running on a heroku engine.

    1. If I hit any url that doesnt exist, i get proper error handling and the error page gets rendered.
    2. If I hit a content_type_template url of a entry that is not published, I get redirected to /404 which renders the default rails 404 error page.

    For some reason the 404 is handled different in those cases and I cant wrap my head around it and figure out the reason

    anybody has any ideas?
    also, if I just type in the address bar domain.com/404 it doesnt render the 404 page from the site but rather the 404 page from rails
    Nikolay Bonev
    @DonKoko
    on wagon it works, if i put localhost:3333/404 it renders the 404 page
    Nikolay Bonev
    @DonKoko
    hey @did
    Do you have any idea about this issue?
    beau sebastien
    @sebastienbeau
    Hi, I confirm the issue.
    Indeed when requesting directly the 404 page, the rails application render the page instead of request steam middleware.
    If I have some time this weekend I will try to look deeper on it
    Nikolay Bonev
    @DonKoko
    thanks @sebastienbeau
    I was not sure if its an issue from my engine or just a general issue.
    Thanks a lot
    Peter Salomon
    @facemapper

    Maybe you guys can help me with this one too:

    i am running into this error, because a content_type_template is a part of the result of page.children. Here is my code:

    How can i prevent page.children to list the content_type_template at all?

    [LiveEditing] undefined method `_label' for nil:NilClass
            /Users/user/.rvm/gems/ruby-2.7.0/gems/locomotivecms_steam-1.5.3/lib/locomotive/steam/liquid/tags/link_to.rb:37:in `label_from_page'
            /Users/user/.rvm/gems/ruby-2.7.0/gems/locomotivecms_steam-1.5.3/lib/locomotive/steam/liquid/tags/link_to.rb:13:in `block in render’

    i have this pages situation:

    • views
      • pages
        • categories (folder)
          • content_type_template.liquid
          • some_other_page.liquid
          • and_another_page.liquid
        • page_1.liquid
        • page_2-liquid

    now i have a snippet that creates the navigation:
    ( this is the simplified version, the projects nav is more complex)

    <ul>
      {% with_scope listed: true, published: true, depth: 1 %}
      {% for nav_page in site.pages %}
      <li class="{% if page.fullpath == nav_page.fullpath %}active{% endif %}">
        {% link_to nav_page %}
    
        {% if nav_page.children.size > 0 %}
    
        <ul>{% for nav_child in nav_page.children %}
    
            <!-- start sub menu column  -->
            <li>
                {% link_to nav_child %}
            </li>
          <!-- end sub menu column  -->
    
          {% endfor %}
        </ul>
    
        {% endif %}
    
        {% endfor %}
        {% endwith_scope %}
      </li>
    </ul>

    „nav_page.children“ lists also the content_type_template and runs into an error because it can´t create the link.

    Peter Salomon
    @facemapper
    never mind.. i just found out the power of the nav tag.. i think i will continue with that. But still: is that the expected behavior, that page.children lists content_type_templates?
    Peter Salomon
    @facemapper
    btw. i tried also:
    {% with_scope listed: true, published: true, _slug.ne: 'content_type_template'  %}
     <ul>{% for nav_child in nav_page.children %}
    as well as:
    {% with_scope listed: true, published: true, slug.ne: 'content_type_template'  %}
                        <ul>{% for nav_child in nav_page.children %}
    but without success
    Manu
    @manuchap
    @facemapper Have you tried removing the depth statement from your with_scope and adding it to you if?
    Peter Salomon
    @facemapper
    @manuchap yes, i played around with that as well. The depth statement works actually well.
    I made a small testproject to figure it out why it doesnt work. I have now a nav solution that works although it is far from elegant.
    My navigation looks like this now:
    
    {% with_scope listed: true, depth: 1 %}
          <ul>
            {% for nav_page in site.pages %}
            <li class="{% if page.fullpath == nav_page.fullpath %}active{% endif %}">
              {% link_to nav_page %}
    
              {% if nav_page.children.size > 0 %}
              {% if nav_page.children.first.slug == 'content_type_template' %}{% assign offset = 1 %}{% else %}{% assign offset = 0 %}{% endif %}
              <ul>{% for nav_child in nav_page.children offset: offset %}
                {% if nav_child.listed?  %}
                  <!-- start sub menu column  -->
                  <li>
                      {% link_to nav_child %}
                  </li>
                <!-- end sub menu column  -->
                {% endif %}
                {% endfor %}
              </ul>
              {% endif %}
              {% endfor %}
            </li>
          </ul>
          {% endwith_scope %}
    Peter Salomon
    @facemapper

    There are some things here that i don´t really understand:

    It seems that the scope works only for the first for loop, but not for the nested one. I would have expected the scope to be a scope for every included forloop.

    But the issue where the error came up is that loco tried to generate a link for the content_type_template..
    Peter Salomon
    @facemapper
    I am giving up for today befor i start banging my head.. with my little test project i got at least the navigation somehow to work.
    For whatever reason though the pages under categories result always now in a 404 (although the links are correct and the pages listed and published)
    I´ll post the little testprojct here, hoping that one of the cracks in europe feels motivated to find out what is going on...
    Manu
    @manuchap
    Yeah, the folder structure reflects how loco will generate the urls so there should only be a template page in folders with the same name as content types. The slugs of content type urls are the entries (http://0.0.0.0:3333/categories/sample-1). And I think the nav tag has enough options to cover pretty much every use case.
    Peter Salomon
    @facemapper
    Hi @manuchap . Yes, it is powerful, thats right, except i cannot set a class for submenu li´s.
    But i´ll go on with the nav tag. However, having other pages together with a model folder is something i even saw in the docum
    Manu
    @manuchap
    Unless you add a class to the nav tag that deals with nth-children
    Peter Salomon
    @facemapper
    oops. … in the documentation: https://doc.locomotivecms.com/docs/create-a-page on the bottom.
    but that class is then in the nav element itself, right?
    Manu
    @manuchap
    Yes. My bad about the previous comment on content type folders, I thought it was bad practice...
    Peter Salomon
    @facemapper
    well … it is :)
    But thank you for digging into it!
    Manu
    @manuchap
    .nav>ul>li>ul>li{background-color:red;}
    Peter Salomon
    @facemapper
    @manuchap i finally got it done - with the nav tag. Since i needed to use a megamenu bootstrap lib, i needed an additional class on the dropdown li´s. Not a css solution but js:
    $("nav.navbar.bootsnav ul.nav>li.dropdown").addClass("simple-dropdown“);
    And the 404´s - whatever it is, its just in the little example project and not in the real one..
    No reason to bang my head anymore! :-)
    Joshua Tyree
    @Josh_Tyree_twitter
    I’m experiencing an issue where some assets are served using the asset host (both forced via initializer config and the site-specific asset host override) are not being served through the asset host.
    Any idea why that would be the case?
    Joshua Tyree
    @Josh_Tyree_twitter
    Sorted it out.
    Peter Salomon
    @facemapper
    Again another question from my side… its about scope_with and tags. Can i use scope_with and Regex on tags? What i want is a case insensitive search for tags...
    {% with_scope tags.in: ["/startup/i“] %} doesn´t do the job.
    Manu
    @manuchap
    @facemapper Nope. {% with_scope tags: ["startup“,"Startup"] %} will.
    But it would be a nice feature
    Peter Salomon
    @facemapper
    @manuchap - thank you! So simple… why didn’t that idea come into my mind by itself? Instead i used coal to retrieve all records, downcase all tags and save them back… worked as well but will never be safe for editors not taking care...
    Nikolay Bonev
    @DonKoko
    @facemapper @manuchap, actually you can scope with regex, but i think it doesnt work with an array.
    Manu
    @manuchap
    @DonKoko Didn't know that... Would you have an example?
    Nikolay Bonev
    @DonKoko
    @manuchap took some digging around as i didnt use this in a long time
      {% capture filter_name_query %}/{{ params.search_query }}/i{% endcapture %}
      {% with_scope name: filter_name_query %}