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 1.2 - MSM Support, "Open" Statuses setting, bug fixes and other enhancements

Development and Programming

Brandon Kelly's avatar
Brandon Kelly
257 posts
16 years ago
Brandon Kelly's avatar Brandon Kelly
The problem appears to be the that the count is incremented even if media_type is something other than “Document”, in my case its “Image”. I assume that this has to do with EE and its parsing.

Have you tried swapping the PHP Parsing Stage setting in the template’s preferences?

       
Hinterlands's avatar
Hinterlands
12 posts
16 years ago
Hinterlands's avatar Hinterlands
Have you tried swapping the PHP Parsing Stage setting in the template’s preferences?

yes, when set to input the $output string isn’t created ( fair enough ) and you just get

<a href="http://{media}" class="{media_class}">{title}</a>

I’ve taken this over here – http://ellislab.com/forums/viewthread/99806/

       
Hinterlands's avatar
Hinterlands
12 posts
16 years ago
Hinterlands's avatar Hinterlands

Just in case this helps somebody I ended up with

<? $hasdocs = false ?>

{exp:weblog:entries limit="1"}

    {related_entries id="rel_media"}
        <? if ( "{media_type}" == "Document") { $hasdocs=true; } ?>
    {/related_entries}

{/exp:weblog:entries}

<? if ( $hasdocs ) { ?>

<? } ?>

And yes I do need to do a second pass to actually get the document list. The trick seems to be that you need to do the conditional in PHP.

       
Brandon Kelly's avatar
Brandon Kelly
257 posts
16 years ago
Brandon Kelly's avatar Brandon Kelly
The trick seems to be that you need to do the conditional in PHP.

Thanks for the update!

       
Helmi_xisnet's avatar
Helmi_xisnet
71 posts
16 years ago
Helmi_xisnet's avatar Helmi_xisnet

I’ve implement this extension to my client’s website and so far so good, except that they have a total of 900+ and increasing (its a books list) entries and they have to choose 10-15 from that list each month for a bestseller entry.

Is there a way I can auto collapse the list group?

       
Brandon Kelly's avatar
Brandon Kelly
257 posts
16 years ago
Brandon Kelly's avatar Brandon Kelly
IIs there a way I can auto collapse the list group?

You can auto-collapse the entire Playa field using the Visibility setting in the Edit Field form, but there’s no way to just collapse the left side.

       
Gabriel's avatar
Gabriel
130 posts
16 years ago
Gabriel's avatar Gabriel

Hi Brandon. Great extension! But I need little help with following issue.

Here is common example using Playa:

{if my_related_entries}
{related_entries id="my_related_entries"}
{media_url}
{/related_entries}
{/if}

Output will be e.g.:

/files/media-file_1.flv
/files/media-file_2.flv
/files/media-file_3.flv
/files/media-file_4.flv

I need to detect, if there is only one related entry or more than one. So system need to know:

  1. if there is only one related entry >> display it
  2. if here are two and more entries >> display only very first and allow display playlist

Explanation: I’m building related videos under my entries using JW player and these conditionals are needed for achieve to display only video player (if there is assigned only one video) or video player + playlist (if there are assigned more than one video).

I’d like to welcome any build-in conditions or some PHP hack. {if} {if:else} conditionals doesn’t work inside {related_entries} tags.

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
16 years ago
Matt Weinberg's avatar Matt Weinberg

Something like this with PHP on output should work:

{if my_related_entries}
<?php $count = 0; ?>
{related_entries id="my_related_entries"}
<?php $count++;
if ($count == 2) { 
echo 'playlist start code';
}
if ($count > 1) {
echo 'playlist item code {media_url}';
} 
elseif ($count == 1) {
echo '{media_url}';
}
?>
{/related_entries}
<?php if ($count > 1) {
echo 'playlist end code';
?>
{/if}
       
Brandon Kelly's avatar
Brandon Kelly
257 posts
16 years ago
Brandon Kelly's avatar Brandon Kelly

Playa 1.2.3 is out!

Changes include: - Playa now fully supports my just-released Gypsy extension - Moved all language to language/english/lang.playa.php for easier localization - Stopped bundling LG Addon Updater (but it’s still a recommended download!)

       
kscot's avatar
kscot
91 posts
16 years ago
kscot's avatar kscot

I just downloaded Playa 1.3.1 and enabled it but am having trouble getting it to work.

I’m running MSM, PHP5, EE 1.6.4, and the Playa extension is enabled. Changing the field to a simple related entry works. Here’s my code:

{exp:weblog:entries weblog="my_weblog_id" orderby="title" sort="asc" disable="member_data|trackbacks|pagination" search:my_custom_field="no"}
        
<h4>{title}</h4>

{body}

{related_entries id="my_field_id"}
<h6>{title}</h6>
{/related_entries}
        
{/exp:weblog:entries}

When I load the page nothing displays as a related entry. Any ideas?

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
16 years ago
Matt Weinberg's avatar Matt Weinberg

The field you’re searching in weblog:entries isn’t the playa/related field, right?

       
kscot's avatar
kscot
91 posts
16 years ago
kscot's avatar kscot

No, it’s not. Different field.

       
Gabriel's avatar
Gabriel
130 posts
16 years ago
Gabriel's avatar Gabriel

@slapshotw: thanks for your solution. After little modification it works for me.

       
kscot's avatar
kscot
91 posts
16 years ago
kscot's avatar kscot

Any suggestions for troubleshooting this? I’m running PHP 5.2.6, EE 1.6.6, and Playa 1.3.2. Normal related entries are working just fine. I tried disabling all extensions and enabling them again. I also tried disabling just Playa and enabling it again. I’m able to make the related selections in the weblog entry form. My only trouble is getting the related info to display in my query.

Any help would be greatly appreciated. This extension is extremely valuable.

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
16 years ago
Matt Weinberg's avatar Matt Weinberg

Kscot– have you tried upgrading to Playa 1.3? There’s another thread about it.

       
1 2 3 4

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.