We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Playa

Development and Programming

Brandon Kelly's avatar
Brandon Kelly
257 posts
17 years ago
Brandon Kelly's avatar Brandon Kelly

Very strange… there is some code to guard against that situation. I just PM’d you with an updated file that uses a different approach. Let me know if it fixes your problem.

       
circa1977's avatar
circa1977
118 posts
17 years ago
circa1977's avatar circa1977

That works perfectly. Thanks for the quick help!

Mark

       
Brandon Kelly's avatar
Brandon Kelly
257 posts
17 years ago
Brandon Kelly's avatar Brandon Kelly

No prob.

I’ve updated the file on my website for anyone else that is running into this issue.

       
stinhambo's avatar
stinhambo
1,268 posts
17 years ago
stinhambo's avatar stinhambo

Any answer to this Brandon?

Is there a way of checking against the weblog (and therefore the field group) that an entry has been selected from when assigning 2 weblogs and only limiting the number of related entries to 1?

Basically I want to use Playa to allow the user to select one item only from a total of 2 weblogs (not one entry from each).

I wanted to know of there was a conditional I can use that says if the related entry is from weblog 1 then do this but if from weblog 2 do that.

At the moment I have 2 Playa fields but using the above would guarantee that only one choice can be made.

Cheers and I look forward to a response.

       
Brandon Kelly's avatar
Brandon Kelly
257 posts
17 years ago
Brandon Kelly's avatar Brandon Kelly
I wanted to know of there was a conditional I can use that says if the related entry is from weblog 1 then do this but if from weblog 2 do that.

Sorry, was a bit confused by your previous post. I think I’m following you now.

In the CP, set the Playa field’s Maximum Selections to 1. Then in the templates do something like this:

{related_entries id="my_playa_field"}
   {if weblog == "My Weblog 1"}
       {!-- whatever --}
   {if:elseif weblog == "My Weblog 2"}
       {!-- whatever else --}
   {/if}
{/related_entries}

That help?

       
stinhambo's avatar
stinhambo
1,268 posts
17 years ago
stinhambo's avatar stinhambo

Thanks Brandon! I will give it a quick whirl and let you know.

       
stinhambo's avatar
stinhambo
1,268 posts
17 years ago
stinhambo's avatar stinhambo

Didn’t work for me. Here is the initial template -

{exp:weblog:entries weblog="homepage" entry_id="62" disable="categories|member_data|pagination|trackbacks"}
{related_entries id="homepage_choice"}
    {if weblog == "exhibitions"}
        {embed="includes/homepage_exhibition" exhibition_item="{entry_id}"}
      {if:elseif weblog == "gallery"}
        {embed="includes/homepage_gallery" gallery_item="{entry_id}"}
    {/if}
{/related_entries}     
{/exp:weblog:entries}
       
Brandon Kelly's avatar
Brandon Kelly
257 posts
17 years ago
Brandon Kelly's avatar Brandon Kelly

{weblog} is the actual weblog name, not the short name.

       
stinhambo's avatar
stinhambo
1,268 posts
17 years ago
stinhambo's avatar stinhambo

aha it should be weblog_short_name in there instead of weblog -

{related_entries id="my_playa_field"} {if weblog_short_name == "My Weblog 1"} {!– whatever –} {if:elseif weblog_short_name == "My Weblog 2"} {!– whatever else –} {/if} {/related_entries}

       
stinhambo's avatar
stinhambo
1,268 posts
17 years ago
stinhambo's avatar stinhambo
{weblog} is the actual weblog name, not the short name.

I’m a bit simple sometimes hey!

       
Oxygen Smith's avatar
Oxygen Smith
120 posts
17 years ago
Oxygen Smith's avatar Oxygen Smith

Eerrr.. is the latest version on brandon-kelly.com (v 1.09) missing its language file? I downloaded this to play with it, but can’t get the party started. Going to the Modules generates an error that the language file is needed.

Cheers, O2

       
stinhambo's avatar
stinhambo
1,268 posts
17 years ago
stinhambo's avatar stinhambo

Playa has never had a language file.

Have you installed the ‘playa’ folder in the right place?

       
Oxygen Smith's avatar
Oxygen Smith
120 posts
17 years ago
Oxygen Smith's avatar Oxygen Smith

Badomp. :red: :red: :red: Wanted to get moving a little too quickly. When I opened the ZIP and saw a folder of the same name I just dropped it into modules… whoops! I’ll slow down next time and read the installation instructions – thanks Steven!

       
stinhambo's avatar
stinhambo
1,268 posts
17 years ago
stinhambo's avatar stinhambo

No problems O2 Smith 😊

       
Luke Hardiman's avatar
Luke Hardiman
109 posts
about 17 years ago
Luke Hardiman's avatar Luke Hardiman

I’m getting the REL bug for all my related_entries where EE outputs garbled code instead of content, for example:

{REL[4137][tour_of_the_month]d25KUx7WREL}

This happens whether the field is a standard relationship field or Playa field.. Kind of frightening considering my project is heavily dependent on relating products to other products..

Does anybody have any idea where or why this bug originates? I’m on PHP 5.2.0 with 16 megs of memory running EE 1.6.4.

The extensions I have enabled are as follows:

File, by Mark Huot (v.3.1.1) Geo Coordinates (v.1.0.5) Tiny MCE Extension for EE (v.1.0.0) Playa (v.1.0.9)

Please help!

       
First 7 8 9 10 11 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.