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

Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

I know I can disable it - but I and my client ACTUALLY like quick save. I know a lot of people can’t stand it, but I don’t understand why. If you’re working on a draft, and you have a big content area with a lot of HTML or Textile formatting - it allows you to make incremental tweaks and keeps you right there, on the entry, to keep tweaking. I know it’s only saving a click each time (after hitting update, you then click on “Edit this Entry” on the next screen…) but I find saving a click to be handy and a wee bit faster (because I always have at least two tabs open, or two windows, with the admin area in one, and the live/or dev site in the other). Make a tweak, hit quick save, switch to other window, refresh. Repeat until perfect.

I just think, instead of installing two extensions to make one work right - the one should work right!

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

$(*&^#$ - I just lost a really long post trying to spell check the damn thing. ARRGH.

ANYWAY - briefly, this extension is also losing settings when another unrelated but required field is not filled in and EE throws an error. So - this doesn’t appear to work with quicksave, and it doesn’t appear to work when EE throws an error (i.e. for a required field).

Questions:

Is anyone else using this, and experiencing these same issues? If you are not using this, how are you managing your relationships? I’d like to get this resolved on some level before going too far along with the build of this site.

Thanks.

       
Ozmodiar's avatar
Ozmodiar
16 posts
16 years ago
Ozmodiar's avatar Ozmodiar

Is there a way to be able to generate the list of “related entries title” from more than one weblog ?

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

Can anybody tell me how to integrate this into SAEF?

       
Eric Snyder's avatar
Eric Snyder
202 posts
16 years ago
Eric Snyder's avatar Eric Snyder

Mark: I just wanted to drop by and tell you thanks for the multi relationship extension. I appreciate the hard work you have done on these extensions.

       
Adrienne L. Travis's avatar
Adrienne L. Travis
213 posts
16 years ago
Adrienne L. Travis's avatar Adrienne L. Travis

Mark & co.,

It’s worth noting that the odd {REL} behavior apparently sometimes happens even if you ARE running PHP 5 – i’m on 5.2.1, and had the same issue.

However, your fix to mod.weblog works for me too! Just thought i’d contribute that you might try the fix even if you’re NOT on PHP 4, if you’re having the issue!

Adrienne Travis

       
Eric Snyder's avatar
Eric Snyder
202 posts
16 years ago
Eric Snyder's avatar Eric Snyder

Bug Report:

I have Weblog A (classes) and it relates to Weblog B (teachers).

I deleted a teacher from the weblog “teacher”. This teacher that I deleted was connected to a class in the “classes” weblog. When I listed the class the teacher still showed up even though they had been deleted. I had to go in and do an edit on that class to “break” or remove the linking.

Is there a setting that I need to explore or is this a bug?

       
Ozmodiar's avatar
Ozmodiar
16 posts
16 years ago
Ozmodiar's avatar Ozmodiar

I have the weird REL code too.

{REL[51][directors]B94dBcBIREL}{REL[52][directors]B94dBcBIREL}{REL[53][directors]B94dBcBIREL}

Is the solution posted in post #21 the solution for this? I just want to double check before making the changes …

       
Daniel Walton's avatar
Daniel Walton
553 posts
16 years ago
Daniel Walton's avatar Daniel Walton

That is correct Ozmodiar.

As always make sure to make a backup copy before making any changes.. just in case 😊

       
AJP's avatar
AJP
311 posts
16 years ago
AJP's avatar AJP

Ack. Accidental Quote. Please delete me.

       
LissP's avatar
LissP
1 posts
16 years ago
LissP's avatar LissP

I don’t know if this is a bug or something I’m doing wrong, but adding anything to the related_entries tag seems to kill the whole thing.

This works fine:

<ul>{related_entries id="prod_contacts"}
   <li>{title}</li>
{/related_entries}</ul>

This returns no results (just the ul tags with nothing between):

<ul>{related_entries id="prod_contacts" order_by="loc_sort|title" sort="asc" status="open"}
   <li>{title}</li>
{/related_entries}</ul>

It doesn’t matter which parameters are in there - I’ve tried using only one parameter, only one sort field, etc…any parameters at all mean I get no results.

       
Simon Rudkin's avatar
Simon Rudkin
51 posts
about 16 years ago
Simon Rudkin's avatar Simon Rudkin

Multi Relation saves the day (again)… now, has anyone come up with a way of counting how many entries are related??? Specifically, I want to create a conditional with different output based upon if there’s a single related entry, two related entries or more than two.

       
seth.aldridge's avatar
seth.aldridge
68 posts
about 16 years ago
seth.aldridge's avatar seth.aldridge

Hi,

I have a quick question and bug. I, like everyone else, got the weird string bug, but changing the code fixed that until I started working with parameters in the:

{related_entries id="show_images" orderby="random" limit="1"}

Then I get the gibberish again with the parameters in the string. I need to have the client be able to select multiple images but only show one at a time to give a rotating image look every time the page refreshes.

I am assuming that you can not put the parameters in the related entries, but I wasn’t sure of another way to get this to work.

Thanks, Seth

       
Ben Kimball (UT)'s avatar
Ben Kimball (UT)
33 posts
about 16 years ago
Ben Kimball (UT)'s avatar Ben Kimball (UT)

I’m having a hard time linking to related entries. The {url_title} variable doesn’t work for me, presumably because the entries I’m linking to are managed by the Pages extension, so their URLs aren’t standard. For example, the static page

http://site.com/internal/depts/dean/business

is related to the static page

http://site.com/internal/policy/credit

Both are in the same weblog, just in different categories. The trouble is that {url_title} outputs

http://site.com/internal/depts/dean/credit

…when invoked from the “business” page. I tried using {exp:static_page_path}{url_title}{/exp:static_page_path} with the same result.

Any ideas?

Thanks, Ben

       
Ben Kimball (UT)'s avatar
Ben Kimball (UT)
33 posts
about 16 years ago
Ben Kimball (UT)'s avatar Ben Kimball (UT)

I had to resort to PHP to solve the above problem. Here’s how I did it:

First, at the top of the template (probably anywhere outside of the categories tag, actually), I did:

<?php $site_index = '{path=site_index}'; ?>

That’s because inside the categories loop, site_index seems to have a different meaning; it includes the path to the template plus the category link.

Then, to display the related entries with links:

<h3>Multi Relationship Test</h3>
<ul>
{related_entries id="nsite_multi_related_test"}
{categories}
<?php
    // this works in part because we know static pages entries
    // will be in only one category, so this PHP is executed only once
    global $DB;
    $cat_tree = '';
    $page_cat = '';
    $cat_id = {category_id};
    $sql = "select cat_description from exp_categories where cat_id=$cat_id";
    $query = $DB->query($sql);
    $page_cat .= $query->row['cat_description'];
    do {
        $sql = "select parent.cat_id, parent.cat_description from "
             . "exp_categories as parent, exp_categories as child "
             . "where child.cat_id=$cat_id and child.parent_id=parent.cat_id";
        $query = $DB->query($sql);
        if ($query->num_rows == 1) {
            $cat_tree = $query->row['cat_description'].'/'.$cat_tree;
            $cat_id = $query->row['cat_id'];
        }
    } while ($query->num_rows == 1);
    $cat_tree .= $page_cat;
?><li><a href="http://<?=$site_index.$cat_tree?>">{title}</a></li>
{/categories}
{/related_entries}
</ul>

It’s important (as noted) that static pages only be assigned to a single category. Since that’s the way Pages works by design, I felt I could rely upon it. So inside the {related_entries} tag, I invoke the {categories} tag pair so that I can get at {category_id}. Then I do a database lookup (actually, a bunch of them) to find its parent, then its parent’s parent, etc., until the query returns no results (at the topmost parent). This gives me a string like “root/directory/subdirectory/”, to which I still need to add the page name itself. Well, this is also a category name, but it’s not a parent, so one final DB->query pulls that in and sticks it on the end. This string, appended to the site_index I fetched back at the beginning of the page load, makes the URL I need.

I’m definitely interested in hearing about ways to do this that don’t require so many database calls. This solution requires (n+1)*m calls, where n is the depth of the linked document and m is the number of related documents. So if I have 10 related links, each of which is 4 levels deep in the category hierarchy, I’m looking at 50 database calls just to build this section. Not cool!

Cheers, Ben

       
1 2 3 4 5 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.