We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

{{ content }} returns true (a string)

Curtis Blackwell September 24, 2015 by Curtis Blackwell

Steps to recreate

  1. _content_type: markdown
  2. Publish entries with a Redactor for content.

    /about/our-team:

    ---
    _fieldset: page
    title: Our Team
    redirection: /our-team
    ---
    

    /our-team:

    ---
    _fieldset: page
    title: Our Team
    _template: team/index
    _admin:
      protected: true
    ---
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    
  3. Template code:

    {{ pages:listing }}
      {{ if redirection }}
        {{ get_content from="{redirection}" }}
          {{ theme:partial
              src         = "listings/page"
              use_context = "true"
          }}
        {{ /get_content }}
      {{ else }}
        {{ theme:partial
            src         = "listings/page"
            use_context = "true"
        }}
      {{ /if }}
    {{ /pages:listing }}
    

    Partial:

    <div class="col-xs-12 col-sm-4">
      <h2>{{ title }}</h2>
      <img src="{{ transform
                    src   = '{img_primary}'
                    width = '300'
                }}"
      >
    
      <p>{{ content|striptags|truncate:200 }}</p>
    
      <a href="{{ url }}" class="btn btn-primary">
        Learn more <span class="glyphicon glyphicon-chevron-right"></span>
      </a>
    </div>
    

{{ content }} returns true.


Quirkiness

  1. Set _content_type: html.
  2. Rename 02-our-team/page.md -> 02-our-team/page.html.
  3. Refresh browser (no change).
  4. Rename 02-our-team/page.html -> 02-our-team/page.md.
  5. {{ content }} returns correct data.

I realize this setup is a bit strange, but I have to follow a strange setup where the nav and content structure don't always match. So, the client creates a dummy page where they want it to show up in the nav (in addition to the sensical spot, not instead of) and tells it to redirect (by way of a Suggest).

>>>>>>> Unanswered <<<<<<<
1 Reply
1 Follower