0

I'm using Pixel & Tonics Playa which is working great however I am wondering if there is a way to display ALL related entries without the user having to manually select them?

The example I have is as follows ...

I have a "profile" channel which displays some info about the member. I want to set up the page to also display the members blog posts using Playa.

Since there are multiple members I cannot hard code this in the template. I know Playa allows you select channels to display related entries but ideally I want to pull in the latest posts for each user without them having to go in and manually select their latest post.

Code snippet:

{exp:channel:entries channel="people" disable="categories|category_fields|member_data|pagination"}

<h1>{title}</h1>
{about}

<ul>
    {exp:playa:children field="related_entries"}
            <li>{title}</li>
    {/exp:playa:children}
</ul>

{/exp:channel:entries}

When editing the entry, the Playa field looks like this

enter image description here

As you can see in the above image it is a manual process. I want to know if there is a way to set it up so it pulls in the latest posts automatically?

  • 1
    Hey Dan, did my answer below help you? – Joan May 7 '14 at 18:58
  • Hi @Joan - did you see my comments under your answer? – Dan Jul 2 '14 at 1:52
2

There is not a way to relate certain entries to another automatically with Playa.

Actually you don't need to relate entries to a certain member, because EE already does that for you. When a member is logged in and creates a new entry, that entry is related to that member.

Then with the author_id paramater in the channel:entries tag you could display all posts by that member, like so

{exp:channel:entries channel="blog" author_id="5"}
    ...
{/exp:channel:entries}

You created a separate channel for storing extra data about members, I think that's where some problems arise, because then you have two places where you store you member data (in the native Member module and a custom channel). With an add-on like Zoo Visitor you can solve this because then you're able to add all kinds of custom fields (with all field types) for your members.

Let me know if this answers your question!

| improve this answer | |
  • Thanks for your response @Joan & sorry for my delayed response. How would I get author_id to be dynamically added to the channel? There are multiple "profiles" in which I want to display the related blog entries to so I can't go in and manually add the corresponding author_id for the blog channel. – Dan May 12 '14 at 22:46
  • ^^ the profiles are created from a "profile" channel (so not manually created). – Dan May 12 '14 at 22:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.