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

Multi Relation

Development and Programming

Adam Stacoviak's avatar
Adam Stacoviak
34 posts
17 years ago
Adam Stacoviak's avatar Adam Stacoviak
On second thought, there IS a problem. { if no_related_entries } does not parse with your extension. :( Thoughts?

I was just coming here to see if there was a solution to this yet. { if no_related_entries } does not parse for us either.

On another note, once you’ve clicked and made a selection, or submitted an entry with a selection it isn’t possible to de-select and submit with no value selected.

In our case we are using about 15 multi-relational fields, all are not required. If we accidentally submit an entry with a selection in one of the relational fields and later change our mind, or need to update that field to remove a previously selected value – at this point it seems that is not possible.

       
Jacob Fentress's avatar
Jacob Fentress
37 posts
17 years ago
Jacob Fentress's avatar Jacob Fentress

@Image202

I believe you can already unselect entries. If you only have one entry selected (and if you have multiple, click on one to unselect the rest), then hold ctrl (command on mac) and click on that one selection to unselect it.

I hope that helps.

       
Adam Stacoviak's avatar
Adam Stacoviak
34 posts
17 years ago
Adam Stacoviak's avatar Adam Stacoviak

@Jacob

You’re absolutely right. Good looking out!

       
jonathanpoh's avatar
jonathanpoh
3 posts
17 years ago
jonathanpoh's avatar jonathanpoh

Has anyone gotten {switch} to work within the multi-relationship output block? i need to assign classes for alternating row colours but {related_entries} seems to output only the first class in {switch} for every line of the related items.

       
Mark Huot's avatar
Mark Huot
587 posts
17 years ago
Mark Huot's avatar Mark Huot

@jonathanpoh - Unfortunately the template parsing is handled by EE and I don’t have too much access to that. I’m not sure how feasible it is to add a {switch} variable without a lot of hacking.

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
17 years ago
Lisa Wess's avatar Lisa Wess

You might search for the Switchplus plugin; I am not sure how this will interact with the multi relation extension, but it may work. I don’t have a direct link but searching for “switchplus” should locate it.

       
jonathanpoh's avatar
jonathanpoh
3 posts
17 years ago
jonathanpoh's avatar jonathanpoh

Thanks! I’ll look for that plugin and see if it works. Cheers

       
Pigtail Dencil's avatar
Pigtail Dencil
117 posts
17 years ago
Pigtail Dencil's avatar Pigtail Dencil

As expected I too got the {REL[31][field-name]VbgUKbQdREL} error. So, off I went to the mod.weblog.php page to include the extra php lines. But lo, I couldn’t find the comment line:

// 'weblog_entries_tagdata' hook.

I’m currently on v 1.6.0 build 20070708 and slightly baffled. Am I missing something? Can someone provide me with the precise line number where I should insert the fix? Or has the mod.weblog file been altered since this post and subsequent fix were posted?

BTW Mark, your EE plugins, ext’s and modules are emphatically brilliant: the dog’s appendages.

       
lithiumdave's avatar
lithiumdave
215 posts
17 years ago
lithiumdave's avatar lithiumdave

Can anyone tell me how to increase the height of the multiselect beyond 6 rows? There’s a line in the HTML source:



but I simply cannot find how to change the ‘size=”6”’ bit anywhere! If I change it locally in Firebug it works a treat, so if I could only find that darned 6 somewhere in the system…

Cheers 😊

       
Pigtail Dencil's avatar
Pigtail Dencil
117 posts
17 years ago
Pigtail Dencil's avatar Pigtail Dencil

In the custom field creation or editing page (Admin > Weblog Admin >Custom Weblog Fields > Group/Field) there’s the option right below “Field Type”: Textarea Rows.

       
lithiumdave's avatar
lithiumdave
215 posts
17 years ago
lithiumdave's avatar lithiumdave

Oh. My. Word.

I just cannot believe I missed that! Thanks so much. I’ve been doing quite a bit of hacking over the last few days and had forgotten that some things can still be administrated from the CP :\

red faced

Thanks again!

       
Pigtail Dencil's avatar
Pigtail Dencil
117 posts
17 years ago
Pigtail Dencil's avatar Pigtail Dencil

Hello all,

I posted a request for help a few posts ago… Now I’ve got a lengthier explanation of my conundrum.

I’m running version 1.6.0 - build 20070918 on a php4 server.

I have 3 weblogs that I’m trying to link to each other with mark hout’s multi-relation (106) extension. The weblogs are: - Artists - Events - Press

The Press weblog has 2 custom multi-relation fields {news-artist-relationship} {news-event-relationship} where publishers can select which Artists and Events to create a relationship from the Press article.

The Events weblog has 1 custom multi-relation field {event-artist-relationship} where publishers can select which Artist to associate to the event.

In the Artist’s entry template I’ve placed 2 reverse relationship calls: one links it to any Press articles about the Artist, the other to any relative Events. It works a treat.

{exp:weblog:entries weblog="artists|events|news" orderby="date" sort="asc" disable="member_data|trackbacks"}
{if weblog_id == '2'}

<span class="artist-born">{artist-born-lives}</span>
{artist-image}
<span class="introtext">{artist-intro}</span>
{artist-biog}
{artist-website}


<h4>Artist's Press Coverage</h4>
<ul>
{reverse_related_entries status="open" sort="desc" orderby="title"}
{if no_reverse_related_entries}<li>There has been no press coverage about the artist.</li>{/if}
{if news-artist-relationship}<li><a href="http://{title_permalink=news/press-article}">{title}</a></li>{/if}
{/reverse_related_entries}
</ul>

<h4>Come and see the Exhibition</h4>
<ul>
{reverse_related_entries status="open" sort="desc" orderby="title"}
{if no_reverse_related_entries}<li>There are no exhibitions listed yet.</li>{/if}
{if event-artist-relationship}<li><a href="http://{title_permalink=events/exhibitions}"><span class="entrydate">{entry_date format=' %F %d %Y '}</span>{title}</a></li>{/if}
{/reverse_related_entries}
</ul>

{/if}
{/exp:weblog:entries}

In the Events entry template, I placed 1 reverse entry call for any Press Articles associated to the event and 1 related entry call to display the Artists related to the event.

{exp:weblog:entries weblog="artists|events|news" orderby="date" sort="asc" disable="member_data|trackbacks"}
{if weblog_id == '4'}

<span>Showing:</span>
<abbr title="{event-start-date format=">{event-start-date format="%l %F %j, %Y"}</abbr> - 
<abbr title="{event-end-date format=">{event-end-date format="%l %F %j, %Y"}</abbr>
<span>Visitng hours:</span> {event-opening-hours}
<span>Location:</span> <span class="location">{event-venue}</span>
<a href="http://suda.co.uk/projects/microformats/hcalendar/get-cal.php?uri=http://www.folkestonetriennial.org.uk/index.php/events/exhibitions/{url_title}">Add this event to your iCal</a>

<span class="description"><!-- hCalendar description -->
<span class="introtext">{event-intro}</span>
{event-image}
{event-body}
</span><!-- end hCalendar description -->


<h4>Event's Press Coverage</h4>
<ul>
{reverse_related_entries status="open" sort="desc" orderby="title"}
{if no_reverse_related_entries}<li>There has been no press coverage about the artist.</li>{/if}
{if news-artist-relationship}<li><a href="http://{title_permalink=news/press-article}"><span class="entrydate">{entry_date format=' %F %d %Y '}</span>{title}</a></li>{/if}
{/reverse_related_entries}
</ul>

<h4>Read about the Artist</h4>
<ul>
{related_entries id="event-artist-relationship"}
<li><a href="http://{path=artists/biography}">{title}</a></li>
{/related_entries}
</ul>

{/if}
{/exp:weblog:entries}

The reverse entry works, but the related entry link doesn’t. Instead I get the dreaded {REL[45][event-artist-relationship]JqKzNzqQREL} borf. I’ve tried to modify the mod.weblog.php file as outlined in the original thread for the Mutli-Relationship but I couldn’t find any reference to the suggested line of code where to insert the fix.

In the Press entry template, where I want to display links to any Artists or Events that the article may refer to, I get the {REL[N}…} error twice over.

<h4>Read about the Artist</h4>
<ul>
{related_entries id="news-artist-relationship"}
<li><a href="http://{title_permalink=events/exhibitions}">{title}</a></li>
{/related_entries}</ul>

<h4>See the Exhibition</h4>
<ul>
{related_entries id="news-event-relationship"}
<li><a href="http://{title_permalink=events/exhibitions}">{title}</a></li>
{/related_entries}
</ul>

Have I simply misunderstood how Related Entries work? Or am I clearly a victim of an incompatability issue with the Multi-relationship extension? Should I upgrade to PHP 5 to fix this? Or should I use the Multi-Drop-down-list instead or it’s Checkbox variant? Or should I head for Boyink’s suggestion and create different master relationship weblogs, which would take a while for me to get my head around, let alone my client?

BTW, all my entry templates are held in one page-article embed and generated accordingly as explained in Luke’s Jamboree article. Hence all the surrounding {if} statements and all-inclusive weblog tags.

Many thanks, Seb

       
Scheffey's avatar
Scheffey
24 posts
17 years ago
Scheffey's avatar Scheffey

Before I go on with my problem, let me first say thank you Mark for this extension. It has been a huge help.

I’ve got an error which I think is related to the multi-relationship extension. I’m running EE 1.6 Build 20070918 on PHP 4 (with the weblog_entries_tagdata hook fix). I’ve got the following extentions: Custom Fields in EE Tags (v 2.1.8), File (v 2.1.2), Multi-Drop Down List (v 1.1.1), Clone Entries (v 1.1), and Multi-Relationship (v 1.0.6)

I have a weblog with a number of text fields and drop down lists. It also has one Multi-Drop Down list and one Multi-Relationship list. When I try to save the weblog, I get the following error if anything was already selected in the Multi-Relationship field:

MySQL ERROR:
Error Number: 1064
Description: You have an error in your SQL syntax near 'exp_relationships FROM exp_relationships WHERE rel_id=5866' at line 1
Query: DELETE exp_relationships FROM exp_relationships WHERE rel_id=5866

We had been running for a while with the Multi-Drop Down list without any problems. We are transitioning the information from the Multi-Drop Down list to the Multi-Relationship list to make some changes in how things work on the front end. The problem only started after the Multi-Relationship field was added. The problem does not occur if the field is blank or if it is the first time data is entered for the field. We’ve used Multi-Relationship on other sites with the same set-up (with the exception of the extensions) without any problems. I’m wondering if it could have something to do with one of the other extensions.

Any ideas? Thanks for your help.

       
Scheffey's avatar
Scheffey
24 posts
17 years ago
Scheffey's avatar Scheffey

Fixed my own problem. The database at the host for this particular website didn’t like the syntax of the delete statement. I changed the delete statement from

DELETE exp_relationships FROM exp_relationships WHERE rel_id=$data

to

DELETE FROM exp_relationships WHERE rel_id=$data

and everything worked fine. Something about the extra table reference between the DELETE and FROM didn’t agree with the database.

If anyone knows any reason why this fix is a bad idea, please let me know. Otherwise I think this problem is solved.

       
Pigtail Dencil's avatar
Pigtail Dencil
117 posts
17 years ago
Pigtail Dencil's avatar Pigtail Dencil

Fixed my own problem too. For future reference, the fix to place after the ‘weblog_entries_tagdata’ hook in the mod.weblog.php file is on line 2924. For some annoying reason Textmate wasn’t finding it for me. Charming.

UPDATE: In version 1.6.4 it’s on line 3150.

       
First 4 5 6 7 8 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.