I wrote an extension that can link a gallery to a weblog entry called MD Simple Relation. Maybe that can help you? It’s not a multiple relation, but you can link to a gallery category, and then use the gallery entries tag to output what you need. Not sure that’s what you need, but it might help you in this case.
Same problem here, I get these errors instead of the relations:
{REL[9][related_files]fsClTvgWREL}
{REL[7][related_files]fsClTvgWREL}
{REL[8][related_files]fsClTvgWREL}
My code:
{related_entries id="related_files"}
Related files:<a href="http://{file_path}">{name}</a>
{/related_entries}<br>
Please help Thanks!!!
Sorry, I found the post with the solution :D
We are using Multi Relationship extension (v.1.0.6) with ExpressionEngine v1.6.2 and are very pleased with it.
Suddenly about a week ago, after doing some custom edit field editing from the Control Panel (changing a label, switching the order of some custom fields in a field group, etc.) the Edit Custom Field page shows no data for any custom field, just the Submit button and footer.
http://www.oursite.com/index.php?S=0&C=admin&M=blog_admin&P=edit_field&field_id=619
The Add Custom Field still displays fine, and the Multi Relationship option shows properly in the Field Type select box.
We identified that the problem to be a line in method edit_custom_field in the file ext.multi_relationship.php that performs a preg_replace to add the option tag html at the correct location in the page.
$r = preg_replace("/(<select.*?name=.field_type.*?value=.select.*?[\r\n])/is", "$1<option value=\"".$this->type."\"$selected>".$this->name."</option>\r", $r);
Documentation states that in PHP 5.2, preg_replace returns NULL when it has an error, even if the match is found successfully. Perhaps we are exceeding the recursion limit, see posting http://lists.netfielders.de/pipermail/typo3-team-core/2008-January/012297.html
I wrote a fix in the method edit_custom_field that replaces the invocation of preg_replace with a series of preg_match commands that locate the offset of each successive substring that we want to locate: (first “select”, then “name.field_type”, then “value=.select”, then “\n”) and then does a substr_replace to insert the new html “<option > … <option>”.
$pos1 = strpos($r, "select");
preg_match('/name=.field_type/is', $r, $matches_ft, PREG_OFFSET_CAPTURE, $pos1);
$pos2 = $matches_ft[0][1];
preg_match('/value=.select/is', $r, $matches_v, PREG_OFFSET_CAPTURE, $pos2);
$pos3 = $matches_v[0][1];
$pos4 = strpos($r, "\n", $pos3);
$r = substr_replace($r,"<option value=\"".$this->type."\"$selected>".$this->name."</option>\n",$pos4, 0);
With that fix, the Edit Custom Field page in the Control Panel displays fine.
INSTALLING PLAYA FIXED A PROBLEM WITH MULTI RELATION
I’m sure there is a perfectly logical explanation for this, but I just wanted to post this solution for anyone else in need.
I have 2 sites deployed via MSM 1.1 - both sites are 1.6.6.
One site works great with the multi-relation extension, and the related entries tag is broken on the other site - it simply doesn’t display anything in the simplest of templates.
Upon installing the Playa extension, my problem was fixed. Don’t know why, but it’s working.
I saw someone else post something very similar, but just wanted to add another post, as this one has become several pages long.
Is there a way to make the multi-relationship field search-able? I have compared this extension to the Playa extension and this one seems to work better with the reverse entries which is important to my project, but the playa extension is searchable.
Playa saves something like this “[rel_id] weblog_title” with the weblog entry. This technique appears to make the weblog entry search-able with the related data.
I hope that makes sense, if not I would be more than happy to try to provide more info. I would love to make the multi-relationship fields search-able!
Hi,
Trying this extention on EE 1.6.7 and Multiple Site Manager, I found a problem with “normal relationships” and Multi relations on the MSM sites (site_id > 1).
Could it be that Multi Relation is not MSM compatible?
I did the following changes to the php and found it to work correctly now, but I guess some extra testing is needed…
//ext.multi_relationship.php
// around line 455
function modify_template( $tagdata, $row, &$weblog )
{
// added $PREFS and $site_id
global $DB, $FNS, $TMPL, $EXT, $PREFS, /*$all_fields,*/ $Weblog;
$site_id = $PREFS->ini('site_id');
// snip //
// around line 468
foreach($TMPL->related_data as $key => $rel_data)
{
// replaced cfields[1] with cfields[$site_id] (2x)
if(!isset($$reference->cfields[$site_id])) continue;
$field_id = $$reference->cfields[$site_id][$rel_data['field_name']];
// done
// rest of code...
Maybe this also explains why enabling Playa helps?
After skimming through the thread I thought I’d just try 1.06 with EE 1.67 (pretty vanilla install, a few modules but no other extensions at this point as I’m still learning my way around) and it seems to be working fine as long as I don’t feed any parameters in it. sort=”asc” would be nice. I deleted the normal relationships I set up earlier, and I don’t have MSM. I’ll update this if anything changes.
This could be a quick/dirty way around descending order: http://www.wrichards.com/blog/2009/02/jquery-sorting-elements/
I do agree that this should be covered in the documentation, as one of the main reasons I chose EE was the integration of custom fields in the core (unlike cck for drupal) and built in relationships to keep things simple. Hopefully 2.0 will have this cooked in.
First, thanks Mark for another great and incredibly-useful extension!
I’ve modified v1.0.6 to include Leevi’s MSM-friendly fixes and to use a scrolling DIV with checkboxes rather than a multi-select field. The vertical size of the scroll area is determined by the textarea rows in the field settings.
It seems to be testing just fine with EE 1.6.7+MSM, but I don’t want to post anything without Mark’s permission.
It seems to be testing just fine with EE 1.6.7+MSM, but I don’t want to post anything without Mark’s permission.
Looks like a cool modification– nice work!
Mark hasn’t posted in quite a while– maybe try contacting him via his site? http://docs.markhuot.com/
Also, have you seen Playa?
Edited to not come off as so negative!
Same problem here, I get these errors instead of the relations:My code:{REL[9][related_files]fsClTvgWREL} {REL[7][related_files]fsClTvgWREL} {REL[8][related_files]fsClTvgWREL}
Please help Thanks!!! Sorry, I found the post with the solution :D{related_entries id="related_files"} Related files:<a href="http://{file_path}">{name}</a> {/related_entries}<br>
I’m having the same issue, have read the threads and tried clearing cache, reassigning relationship. FWIW multi-relation was working fine for my site for months (PHP 5, EE 1.6.4) until I upgraded the Solspace Tag module (ran the update script).
What was the post with the solution?
I’ll be investigating Playa but need to get the existing site working again in the meantime.
Many thanks!
UPDATE: Playa is great but it will still take some time for me to migrate all our previous entries to the new form. In the meantime I’ve found that clearing the CACHE works, but I have to do it after almost every single update.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.