1 of 14
1
Playa
Posted: 28 April 2008 12:11 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  279
Joined  01-02-2008

Playa is a powerful one-to-many field loosely based on Mark’s Multi-Relation extension.

Unlike the others, it enables you to…

- Pull content from multiple weblogs
- Limit the number of selectable entries
- Order your selections with drag-and-drop
- Close your entries and mean it
- Set selections as searchable

Like Relationship and Multi-Relation fields, Playa uses the related_entries template tag:

{related_entries id="my_playa_field"}
    
<h4>{title}</h4>
    <
p>{body}</p>
{/related_entries}

For more information and the download, go to http://brandon-kelly.com/apps/playa/

Current version: 1.1.3

Most recent updates:
- When saving an entry, Playa now leaves unchanged relationships in-tact
- Fixed a caching issue by automatically clearing the relationship cache whenever a change is made

View the full Change Log

Image Attachments
playa.jpg
Click thumbnail to see full-size image
 Signature 

brandon-kelly.com    @brandonkelly

Profile
 
 
Posted: 28 April 2008 03:57 AM   [ Ignore ]   [ # 1 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006

Brandon, you’ve done it again!! wink

Will try this out today as it sounds absolutely brilliant!! How do you keep on coming up with these ideas and implementing them so fast.

Sounds like this one will definitely have a place for a lot of people.

Great one.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 28 April 2008 04:04 AM   [ Ignore ]   [ # 2 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006

Oops!

Brandon I just tried the extension out and whilst I think it is working it does have a lot of errors popping up when I go to Publish an entry. I am getting :

Notice: Undefined variable: r in /usr/local/psa/home/vhosts/*******/httpdocs/*******/extensions/ext.playa.php on line 610
Warning: Missing argument 2 for get_rel_ids() in /usr/local/psa/home/vhosts/*******/httpdocs/*******/extensions/ext.playa.php on line 191
Notice: Undefined index: selected in /usr/local/psa/home/vhosts/*******/httpdocs/*******/extensions/ext.playa.php on line 763
The last error is repeated 14 times

Not sure if it is another extension messing with it though so will go and try turning them all off one by one and let you know what I come up with. Looks really neat so far though.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 28 April 2008 04:09 AM   [ Ignore ]   [ # 3 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006

Hi Brandon,

Just a really quick update on this one. I disabled all extensions except for Playa and still get the errors. Admittedly not so many of the last error but still around 4 of them.

Not really sure what it all means though. Would be great to have this one working without the errors though wink Seems like it would be a life-saver.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 28 April 2008 10:07 AM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  279
Joined  01-02-2008

My apologies! I just fixed those two issues. Try downloading it again, and let me know if it works out for you!

 Signature 

brandon-kelly.com    @brandonkelly

Profile
 
 
Posted: 28 April 2008 10:12 AM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  467
Joined  09-06-2006

Ya, I’m getting errors also. The custom field does appear on the Publish page and seems to do what it is supposed to, and looks like a really nice addition.

Here are the errors I’m getting at the top of the publish page:

Warning: Missing argument 2 for Playa::get_rel_ids(), called in /home/*******/public_html/ee/*******/extensions/ext.playa.php on line 681 and defined in /home/*******/public_html/ee/*******/extensions/ext.playa.php on line 191

Notice: Undefined index: selected in /home/*******/public_html/ee/*******/extensions/ext.playa.php on line 763

Notice: Undefined index: selected in /home/*******/public_html/ee/*******/extensions/ext.playa.php on line 763

Notice: Undefined index: selected in /home/*******/public_html/ee/*******/extensions/ext.playa.php on line 763

Notice: Undefined index: selected in /home/*******/public_html/ee/*******/extensions/ext.playa.php on line 763

Notice: Undefined index: selected in /home/*******/public_html/ee/*******/extensions/ext.playa.php on line 763


Edit: While I was typing this, Brandon posted an update and yes, the errors went away! Thanks!

 Signature 

Kyle Summer | smartpill design | New Haven, CT |  twitter

Profile
 
 
Posted: 28 April 2008 10:38 AM   [ Ignore ]   [ # 6 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006
Brandon Kelly - 28 April 2008 10:07 AM

My apologies! I just fixed those two issues. Try downloading it again, and let me know if it works out for you!

Downloading again and I’m sure that it will work out fine!! wink

Thanks Brandon wink

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 28 April 2008 10:40 AM   [ Ignore ]   [ # 7 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  302
Joined  01-18-2006

Hi Brandon,

This looks really great.

Since this uses the {related_entries} template tag, I don’t suppose the backspace parameter (or something similar) is available in Playa? For example, if I wanted to output:

{related_entries id="my_playa_field"}
    {title}
,
{/related_entries}

would there be a way to lose the comma after the last {title}?

 Signature 

Eric Barstad
Shadow Box Creative Media Ltd.

EE Pro Network

Profile
 
 
Posted: 28 April 2008 10:47 AM   [ Ignore ]   [ # 8 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006

Hi Brandon,

Seems to be working okay now but unless it’s just something weird on my system I think that maybe there is still something a bit awry and I think it is to do with the CSS file perhaps. There is a slight discrepancy in the control panel now.

Have taken a quick screen-shot (attached) of what is happening. Also happens on the other side of the control panel too. As long as it isn’t doing anything deeper to the system though then I can live with it but would be nice to get it back the way it should be wink

Great extension though so thanks.

Best wishes,

Mark

Image Attachments
discrepancy.jpg
Click thumbnail to see full-size image
 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 28 April 2008 11:00 AM   [ Ignore ]   [ # 9 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  279
Joined  01-02-2008
Eric Barstad - 28 April 2008 10:40 AM

Since this uses the {related_entries} template tag, I don’t suppose the backspace parameter (or something similar) is available in Playa? For example, if I wanted to output:

{related_entries id="my_playa_field"}
    {title}
,
{/related_entries}

would there be a way to lose the comma after the last {title}?

If you enable PHP parsing on output, you could:

<?php $re_count = 1; ?>
{related_entries id
="my_related_entries"}<?php
    
if ($re_count > 1) echo ',';
    
$re_count++;
?> {title}{/related_entries}

It’s kindof hacky, but it would get the job done.

 Signature 

brandon-kelly.com    @brandonkelly

Profile
 
 
Posted: 28 April 2008 11:12 AM   [ Ignore ]   [ # 10 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  279
Joined  01-02-2008
Mark Bowen - 28 April 2008 10:47 AM

Have taken a quick screen-shot (attached) of what is happening. Also happens on the other side of the control panel too. As long as it isn’t doing anything deeper to the system though then I can live with it but would be nice to get it back the way it should be wink

I’m getting that too… didn’t realize it was from Playa. I’ll look into it.

 Signature 

brandon-kelly.com    @brandonkelly

Profile
 
 
Posted: 28 April 2008 12:01 PM   [ Ignore ]   [ # 11 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006

Oops I spoke too soon unfortunately.

On a rendered template I am getting the dreaded :

{REL[11][staff-picks]fREzvVHhREL}{REL[12][staff-picks]fREzvVHhREL}{REL[13][staff-picks]fREzvVHhREL}{REL[14][staff-picks]fREzvVHhREL}

kind of output.

Anything I should be doing that I’m not?

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 28 April 2008 12:04 PM   [ Ignore ]   [ # 12 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  261
Joined  04-23-2004

Just wanting to let you know that I had the same problems as mentioned above. Grabbed the new version and both warnings and the css is now ok. Also foreign characters which the first version disrupted.

Great add-on! I’m usually a bit reluctant to use extensions since so few of them actually work. But this one does! (well, I haven’t tested it on the frontend yet…;)! Thank you!

 Signature 

Yvonne

———————————
studio.freewheelin

Profile
 
 
Posted: 28 April 2008 12:06 PM   [ Ignore ]   [ # 13 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  279
Joined  01-02-2008
Mark Bowen - 28 April 2008 12:01 PM

On a rendered template I am getting the dreaded :

{REL[11][staff-picks]fREzvVHhREL}{REL[12][staff-picks]fREzvVHhREL}{REL[13][staff-picks]fREzvVHhREL}{REL[14][staff-picks]fREzvVHhREL}

Can you post the code you’re using in your template?

 Signature 

brandon-kelly.com    @brandonkelly

Profile
 
 
Posted: 28 April 2008 12:13 PM   [ Ignore ]   [ # 14 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006

Hi Brandon,

Simply this :

{exp:weblog:entries weblog="staff" limit="1" dynamic="on" disable="member_data|trackbacks|pagination|categories|category_fields"}

{related_entries id
="staff-picks"}
<h4>{title}</h4>
{news-body}<br />
<
p><a href="#" title="{title}">{title}</a></p>
{/related_entries}

{
/exp:weblog:entries}

Just this at the moment. I have a weblog setup called staff and a playa relationship field called staff-picks which allows staff members on their detailed page (which is what the code above is from) to show items from other weblogs.

All I keep on getting is the problems above though. I have tried clearing caches and everything but just get those weird numbers all the time which seem to change every time I refresh the template.

Just as a thought. Does this require a certain version of PHP to work correctly? I am on V4 ish but I seem to remember something about V5 working better for these kinds of extensions? Just a thought though.

Thanks for any help on this.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 28 April 2008 12:15 PM   [ Ignore ]   [ # 15 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006

Oops also I get this for the text that is placed into the database when publishing an entry :

[15] News Item 1
[16] News Item 2
[17] News Item 3

This is shown on the page after you click save for the entry you are creating.

Don’t know if it’s meant to just place in the number though?

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 28 April 2008 01:17 PM   [ Ignore ]   [ # 16 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  279
Joined  01-02-2008
Mark Bowen - 28 April 2008 12:13 PM

Just as a thought. Does this require a certain version of PHP to work correctly? I am on V4 ish but I seem to remember something about V5 working better for these kinds of extensions? Just a thought though.

Yeah, looks like out of the box, this does require PHP5.

You can try Mark Huot’s hack to get Multi-Relation working on PHP4:

Open your /system/modules/weblog/mod.weblog.php file and find this line

// -------------------------------------------
// 'weblog_entries_tagdata' hook.

to this line

//
// -------------------------------------------

replace the inside with this

if (isset($EXT->extensions['weblog_entries_tagdata']))
{
   
// -- PHP4 Fix For call_user_func_array not passing by reference
   
global $Weblog; $Weblog = $this;
   
// -- End Fix
   
   
$tagdata = $EXT->call_extension('weblog_entries_tagdata', $tagdata, $row, $this);
   if (
$EXT->end_script === TRUE) return $tagdata;
   
   
// -- PHP4 Fix For call_user_func_array not passing by reference
   
$this = $Weblog; unset($Weblog);
   
// -- End Fix
}
 Signature 

brandon-kelly.com    @brandonkelly

Profile
 
 
Posted: 28 April 2008 01:18 PM   [ Ignore ]   [ # 17 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  279
Joined  01-02-2008

Just posted a new version, which fixes that visual glitch in the CP.

 Signature 

brandon-kelly.com    @brandonkelly

Profile
 
 
Posted: 28 April 2008 01:27 PM   [ Ignore ]   [ # 18 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006

Hi Brandon,

Aha thought that it might have to do with the PHP version. Thanks for the style update but I will have to try and get the PHP version upped on the server as I don’t really like hacks all that much. May have to do so in this case if required though :-(

Thanks again for looking into that for me.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
   
1 of 14
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120603 Total Logged-in Users: 65
Total Topics: 126642 Total Anonymous Users: 40
Total Replies: 665700 Total Guests: 400
Total Posts: 792342    
Members ( View Memberlist )
Newest Members:  bell143paololukDarleneChadbourneRashadSargIvar89HonschowmtRetliffherzigerjudith