Support Forum » User Profile

Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • in reply to: Fieldset Text #20466
    MR MICHAEL BRIORDANMR MICHAEL BRIORDAN
    Participant

    Thanks!

    in reply to: Fieldset Text #20414
    MR MICHAEL BRIORDANMR MICHAEL BRIORDAN
    Participant

    Thank you. This works. However, I can't now work out how to get this working in MB Views, using Twig. What I have so far:

    {% for item in post.fieldsetcopies %}
        {% if item.libplace %}
            {{ item.libplace }},
        {% endif %}
        {% if item.lib %}
           {{ item.lib }},
        {% endif %}
        {% if item.libshelf %}
           . Shelkmark: {{ item.libshelf }},
        {% endif %}
        <!-- etc -->
    {% endfor %}

    My 'inputs' (subfields) are not appearing on the list of fields in views.

    I've also experimented with for loops on each sub-field in the fieldset.

    in reply to: Fieldset Text #20400
    MR MICHAEL BRIORDANMR MICHAEL BRIORDAN
    Participant

    I've worked this out myself. For benefit of others, make the field cloneable.

    Docs here

    in reply to: no twig tags rendering #20373
    MR MICHAEL BRIORDANMR MICHAEL BRIORDAN
    Participant

    Hello,

    Done all of this, but it's not working. Here's the loom video:

    Loom Share

    in reply to: no twig tags rendering #20367
    MR MICHAEL BRIORDANMR MICHAEL BRIORDAN
    Participant

    That was this listings view.

    And this is the single view:

    Views screen - singular

    Views Screen (singular)

    in reply to: no twig tags rendering #20366
    MR MICHAEL BRIORDANMR MICHAEL BRIORDAN
    Participant

    Here is the Views Screen:

    Views Screen

    Views Screen on Snipboard

    in reply to: no twig tags rendering #20357
    MR MICHAEL BRIORDANMR MICHAEL BRIORDAN
    Participant

    Thanks for all your help on this, but it is still not working for me... The twig is not rendering at all.

    Here is the source code of the rendered page:

    <table>
    <tr>
            <th></th>
            <th>Date</th>
            <th>Title</th>
            <th>Location</th>
        </tr>
        
            <tr>
                <!-- not live so don't want to share URL publicly -->
                <!-- but this produces the URL of the listing page itself, not a link to the item page -->
                <td><a href="https://mysite.url/print-editions/">Detail</a>
                </td>
                <td><!--blank--></td>       
                <td><!-- should render {{ post.year }}</td>
                <td><!-- should render {{ post.booktitle }} -- a custom field called 'booktitle' rather than the name of the post --></td>
                <td><!-- should render {{ post.location }}--></td>  
           </tr>
        </table>

    I can provide the PHP for the post type or field group, if it helps...

    in reply to: no twig tags rendering #20343
    MR MICHAEL BRIORDANMR MICHAEL BRIORDAN
    Participant

    First code not rendering properly, it should be

    <table>
    <tr>
    <th></th>
    <th>Date</th>
    <th>Title</th>
    </tr>
    
    {% for post in query.posts %}
    <tr>
    <td>Detail</td>
    <td>{{ post.year }}</td>
    <td>{{ post.booktitle }}</td>
    </tr>
    {% endfor %}
    </table>
    in reply to: no twig tags rendering #20342
    MR MICHAEL BRIORDANMR MICHAEL BRIORDAN
    Participant

    I have followed this suggestion, with no output.

    But I think I need a bit more explanation.

    This code was intended for a view, editions-list, that lists not all posts, but only custom post type, "edition" each of which represents a post about a book. I've created this using MetaBox.

    editions-list looks something like this (I've only given the first few fields):

    <table>
    <tr>
    <th></th>
    <th>Date</th>
    <th>Title</th>
    </tr>

    {% for post in query.posts %}
    <tr>
    <td>Detail</td>
    <td>{{ post.year }}</td>
    <td>{{ post.booktitle }}</td>
    </tr>
    {% endfor %}
    </table>

    Type for editions-list is archive.
    Location for editions-list is edition Archive.

    I then have created a second view, single-book-view, that gives a detailed view of each book.

    single-book-view looks something like this (I've only given the first few fields):

    <table>
       <tr>
         <td>Year</td>
         <td>{{ post.year }}</td>
       </tr>
       <tr>
          <td>Title</td>
          <td>{{ post.booktitle }}</td>
        </tr>
      </table>

    Type for single-book-view is singular.
    Location for single-book-view is edition / all

    in reply to: no twig tags rendering #20333
    MR MICHAEL BRIORDANMR MICHAEL BRIORDAN
    Participant

    I should note when I try and (edit a) post I get the following errors:

    Warning: array_keys() expects parameter 1 to be array, null given in /home/.../wp-content/plugins/meta-box/inc/sanitizer.php on line 154

    Warning: array_intersect(): Expected parameter 2 to be an array, null given in /home/.../wp-content/plugins/meta-box/inc/sanitizer.php on line 154

    Warning: Cannot modify header information - headers already sent by (output started at /home/.../wp-content/plugins/meta-box/inc/sanitizer.php:154) in /home/.../wp-includes/pluggable.php on line 1281

Viewing 10 posts - 1 through 10 (of 10 total)