ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

relationships not relating

February 07, 2011 1:46am

Subscribe [4]
  • #1 / Feb 07, 2011 1:46am

    vlad

    213 posts

    I got dumped, well in the data sorta way. I think I followed the instructions to the T!

    Here is my code, it’s pretty much copy and paste from the instructions…

    {embed="includes/head"}
    
    
    <body>
    <div id="wrapper">
        <div class="container clearfix">
    {embed="includes/navigation"}
            
            <div id="content" class="clearfix">
                
                <div id="left">
                <div class="padding clearfix">
    {exp:channel:entries channel="test_channel"}
    
    <h1>{title}</h1>
    <-- enter relationship
    
    {related_entries id="test-fields"}
      {if no_related_entries}
      <h2>No Information Available</h2>
    <p> {/if}<br /></p><h2>{title}</h2>
    <p> {text}<br />
    {/related_entries}<br />
    <-- exit relationship<br />
    {/exp:channel:entries}</p>
    
    <p>            </div>   <br />
                </div><!-- end left --></p>
    
    <p>            <br />
            </div><!-- end content --><br />
        </div><!-- end container --><br />
    </div><!-- end wrapper --><br />
    {embed="includes/footer"}

    I attached the image of how the HTML comes out… It finds the entry title but not the relationship…

    In my entries I can see the titles if the articles of the related entry I want to relate to (see my attachment)

    That leaves only one room for error {related_entries id="test-fields"} and I think I got that right… (see last image)

    What I am missing here?

    PS I am using 2.1.3 Build: 20101220

  • #2 / Feb 07, 2011 2:53am

    Varmaj

    7 posts

    If that is indeed your code, the problem is obvious.

    You have started an HTML comment tag but not closed it.

    So:

    <-- enter relationship
    
    should actually be
    <-- enter relationship --> 
    

    Ditto with this bit:

    <-- exit relationship
    {/exp:channel:entries}

    which should be:

    <-- exit relationship -->
    {/exp:channel:entries}
  • #3 / Feb 07, 2011 4:12am

    vlad

    213 posts

    If only life was that simple! I thought of that before and tried it and still didn’t work. :(

    {embed="includes/head"}
    
    
    <body>
    <div id="wrapper">
        <div class="container clearfix">
    {embed="includes/navigation"}
            
            <div id="content" class="clearfix">
                
                <div id="left">
                <div class="padding clearfix">
    {exp:channel:entries channel="test_channel"}
    
    <h1>{title}</h1>
    Enter relationship
    {related_entries id="test-fields"}
      {if no_related_entries}
      <h2>No Information Available</h2>
    <p> {/if}<br /></p><h2>{title}</h2>
    <p> {text}<br />
    {/related_entries}<br />
     :( Get dumped!<br />
    {/exp:channel:entries}</p>
    
    <p>            </div>   <br />
                </div><!-- end left --></p>
    
    <p>            <br />
            </div><!-- end content --><br />
        </div><!-- end container --><br />
    </div><!-- end wrapper --><br />
    {embed="includes/footer"}

  • #4 / Feb 07, 2011 5:29pm

    Ingmar

    29245 posts

    Make sure the related entry id (“test-fields”} is correct. Are all of your entries current (i.e. not expired or in the future), with a status of “open”?

  • #5 / Feb 08, 2011 4:23am

    vlad

    213 posts

    Ingmar,

    the entries are current.

    What is exactly related_entries id=“” in the guide it says…

    “Field Name of the custom field that contains the relationship”

    I entered the ID of the custom field group that the entry used. (see the image in the 1st post.)

    Did I get that wrong? Should it be the channel id? or that channel entry id? or where am i getting this ID from?

    Can you either send me a screen shot or something like admin > custom fields > etc

    Thanks

  • #6 / Feb 08, 2011 3:21pm

    Ingmar

    29245 posts

    I entered the ID of the custom field group that the entry used.

    No, this should be the field name of the custom field that contains the relationship. In your case, perhaps, “relationship”.

  • #7 / Feb 08, 2011 3:49pm

    vlad

    213 posts

    Doooooh!

    facepalm.

    Thank you.

    :D

  • #8 / Feb 08, 2011 3:55pm

    Ingmar

    29245 posts

    So, working as expected now? Just making sure 😊

  • #9 / Feb 09, 2011 12:10am

    vlad

    213 posts

    Well THAT part is working as expected. 😊 (and thank you)

    BUT when I added matrix fields into the
    {related_entries id="relationship"}  it made whole bunch of PHP errors.

    (I know Matrix isn’t an EE product so you may not wanna deal with it, but it actually displays the information I entered, so I thought the errors may be just an EE setting or I can ignore them and turn off debugging or something…)

    Thanks
    V

  • #10 / Feb 09, 2011 2:53pm

    Lisa Wess

    20502 posts

    Hi, V -

    I don’t see any errors on that page, probably because I’m not a Superadmin and your error display should be set to Superadmins only.

    Can you paste the errors here? Remove your host username and use “system” or the EE system directory.  It is likely you’ll need to post on Matrix’s support area for assistance, though.

    Thanks!

  • #11 / Feb 12, 2011 2:19pm

    vlad

    213 posts

    ok here they are. let me know if they are anything on EE end.

    A PHP Error was encountered
    
    Severity: Notice
    
    Message: Undefined index: 1
    
    Filename: channel/mod.channel.php
    
    Line Number: 4044
    A PHP Error was encountered
    
    Severity: Warning
    
    Message: Invalid argument supplied for foreach()
    
    Filename: channel/mod.channel.php
    
    Line Number: 4044
    A PHP Error was encountered
    
    Severity: Notice
    
    Message: Undefined index: 1
    
    Filename: channel/mod.channel.php
    
    Line Number: 4044
    A PHP Error was encountered
    
    Severity: Warning
    
    Message: Invalid argument supplied for foreach()
    
    Filename: channel/mod.channel.php
    
    Line Number: 4044
    A PHP Error was encountered
    
    Severity: Notice
    
    Message: Undefined index: 1
    
    Filename: channel/mod.channel.php
    
    Line Number: 4044
    A PHP Error was encountered
    
    Severity: Warning
    
    Message: Invalid argument supplied for foreach()
    
    Filename: channel/mod.channel.php
    
    Line Number: 4044
    A PHP Error was encountered
    
    Severity: Notice
    
    Message: Undefined index: 1
    
    Filename: channel/mod.channel.php
    
    Line Number: 4044
    A PHP Error was encountered
    
    Severity: Warning
    
    Message: Invalid argument supplied for foreach()
    
    Filename: channel/mod.channel.php
    
    Line Number: 4044
    A PHP Error was encountered
    
    Severity: Warning
    
    Message: Cannot modify header information - headers already sent by (output started at *******Exceptions.php:170)
    
    Filename: core/Common.php
    
    Line Number: 405
  • #12 / Feb 12, 2011 2:29pm

    vlad

    213 posts

    These errors may be problematic if I am using EE native relationships to display matrix fields.

    In case they are Matrix related, I think this may be pushing me to buy playa that works together with Matrix something like EE relationships, right?

    Also on the same note, quick question about relationships.

    Can I make the realtionship permanent in regular EE relationships?

    Meaning, if I take Channel “games” and add Channel “teams” to it so that channel entry game_1 i can select team_A and team_B… and for game_2 I can select team_C and team_B… so that each game the team info gets pulled up, bio scores etc.

    Can I somehow later say get this information displayed in reverse order:

    If i am on a team page, lets say Team A can I display all the games that team A was invoked in?
    game1 team A vs team B >>> info
    game7 team A vs team D >>> info

    Thank you,
    V

  • #13 / Feb 13, 2011 2:55pm

    Greg Salt

    3988 posts

    Hi vlad_i,

    Please do check with Matrix support about those errors. With regards to the relationships, I believe that what you’re describing are Reverse Related Entries.

    Cheers

    Greg

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases