I can't impress with terminology, but basically you create a python 'environment' inside of code blocs wrapped in "{{ }}" or "{% %}". Creating an 'environment' inside of an 'environment' is redudant. Feel free to check me on my phrasing.
{% set author_posts = blog_recent_author_posts('default', content.widgets.authslug.body.value, 3) %}
{% for author_post in author_posts %}
<div class="post-title">{{ author_post.name }}</div>
{% endfor %}
I removed the curlys and the quotes. Now you are essentially calling a variable inside of your code block instead of printing the string '{{content.widgets.authslug.body.value}}' which is what is happening in your code.
I can't impress with terminology, but basically you create a python 'environment' inside of code blocs wrapped in "{{ }}" or "{% %}". Creating an 'environment' inside of an 'environment' is redudant. Feel free to check me on my phrasing.
{% set author_posts = blog_recent_author_posts('default', content.widgets.authslug.body.value, 3) %}
{% for author_post in author_posts %}
<div class="post-title">{{ author_post.name }}</div>
{% endfor %}
I removed the curlys and the quotes. Now you are essentially calling a variable inside of your code block instead of printing the string '{{content.widgets.authslug.body.value}}' which is what is happening in your code.
@tjoyce yes it shows up. I can get the value to print anywhere EXCEPT in the call to the default blog.
I am on the Team Blog post template calling for articles from the Default Blog. When I put in the author slug it works correctly:
{% set author_posts = blog_recent_author_posts('5686817676', 'john-doe', 3) %}
{% for author_post in author_posts %}
<div class="post-title">{{ author_post.name }}</div>
{% endfor %}
But when I try to populate the author slug from the custom field in the Team Post it does not work:
{% set author_posts = blog_recent_author_posts('5686817676', '{{ content.widgets.authslug.body.value }}', 3) %}
{% for author_post in author_posts %}
<div class="post-title">{{ author_post.name }}</div>
{% endfor %}
'5686817676' is referencing the Default Blog. However '{{ content.widgets.authslug.body.value }}' is referencing a custom field from the Team Blog post (the template I am working in). I think that is why it is not working. I'm wondering if there is a workaround.
@tjoyce yes it shows up. I can get the value to print anywhere EXCEPT in the call to the default blog.
I am on the Team Blog post template calling for articles from the Default Blog. When I put in the author slug it works correctly:
{% set author_posts = blog_recent_author_posts('5686817676', 'john-doe', 3) %}
{% for author_post in author_posts %}
<div class="post-title">{{ author_post.name }}</div>
{% endfor %}
But when I try to populate the author slug from the custom field in the Team Post it does not work:
{% set author_posts = blog_recent_author_posts('5686817676', '{{ content.widgets.authslug.body.value }}', 3) %}
{% for author_post in author_posts %}
<div class="post-title">{{ author_post.name }}</div>
{% endfor %}
'5686817676' is referencing the Default Blog. However '{{ content.widgets.authslug.body.value }}' is referencing a custom field from the Team Blog post (the template I am working in). I think that is why it is not working. I'm wondering if there is a workaround.
@tjoyce yes it's in there. I am able to output the field anywhere in the template EXCEPT in the call to the other blog.
I am on the Team Blog post template calling for articles from the Default Blog. When I put in the author slug it works correctly:
{% set author_posts = blog_recent_author_posts('5686817676', 'john-doe', 3) %}
{% for author_post in author_posts %}
<div class="post-title">{{ author_post.name }}</div>
{% endfor %}
But when I try to populate the author slug from the custom field in the Team Post it does not work:
{% set author_posts = blog_recent_author_posts('5686817676', '{{ content.widgets.authslug.body.value }}', 3) %}
{% for author_post in author_posts %}
<div class="post-title">{{ author_post.name }}</div>
{% endfor %}
'5686817676' is referencing the Default Blog. However '{{ content.widgets.authslug.body.value }}' is referencing a custom field from the Team Blog post (the template I am working in). I think that is why it is not working. I'm wondering if there is a workaround.