This thread is resolved. Here is a description of the problem and solution.
Problem:
Views not working in certain cases - display related parent post name in child view
Solution:
You can use the view's shortcode attribute to passed the "authorname" to child view and later use view's shortcode [wpv-attribute] to catch the passed shortcode attribute value.
I am trying to:
I have a sidebar widget with a View (get-related-author-essay-widget) that finds the current essay's author name and presents other essays by this author. This all works fine. However, when there is more than one author to an essay, the widget is repeated not for each author as it should, but for the first author.
Link to a page where the issue can be seen: hidden link
I expected to see:
I would like the widget View, in the case of multiple authors, to display a loop of the listed essays for each author.
Instead, I got:
The first author's essays in repeated display...
Hello. Thank you for contacting the Toolset support.
Well - I do not know whats going on there but the string is "More essays by" is converted to "Other essays by".
And If you do not use the content template with views and just switch the content template code within the view's loop as given under with the following view:
=> hidden link
You will see all author names will be printed. So I think here you should have if condition if you have single author or multiple author and how you want to display the author names. I do not know how you want to display the author names.
Hi Minesh,
I have been trying to understand how to make the loop in case there are multiple authors. I would like multiple instances of the widget to appear - each one has the header OTHER ESSAY BY <author> followed by the essays of the author.
BTW- there are two views interacting here: loop-item-in-get-related-author-essay-widget which gets the author names of the current essay and then: display-author-related-essay-widget which gets the essays for the author
I have been trying to understand how to make the loop in case there are multiple authors. I would like multiple instances of the widget to appear - each one has the header OTHER ESSAY BY <author> followed by the essays of the author.
==> Well - the thing is here, we get authors names based on post, so when multiple authors assigned to post we will get multiple author names which belongs to same post.
Minesh,
On this the linked page - hidden link
You see in the right sidebar that the loop is picking up the two authors Manuel Portela and Søren Pold (Maria Mecia does not have any other essays) and displaying two widgets of "OTHER ESSAYS...". The second widget, however, shows the name Manuel Portela again, even though the essay is by Søren Pold.
I think it has to do with the following loop for the "get-related-author-essay-widget" View. The shortcode needs to assign an index to each name instance?
<wpv-loop>
[wpv-post-body view_template="loop-item-in-get-related-author-essay-widget"] // this lists author(s)
[wpv-view name="display-author-related-essay-widget" wpvrelatedto="[wpv-post-id]"] / /this brings in essays of author(s)
</wpv-loop>