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.

Questions & EE vs. Drupal

September 17, 2007 7:43pm

Subscribe [2]
  • #16 / Sep 22, 2007 1:52pm

    ctrlaltdel

    119 posts

    {exp:weblog:entries weblog="interviews"}
    <div class="yui-u first article">
    {reverse_related_entries weblog="images" sort="asc" orderby="title"}
    {if count=="1"}
    <div class="article-photo">
    {images_body}
    {/if}
    {if count== total_results}{/if}
    {/reverse_related_entries}

    I’d have to make the entry ID dynamic though…right?  I wouldn’t want to specify an ID because I’d only ever pull in one particular entry…right?  I mean, I’m going to have a bunch of different photos and a bunch of different interviews.

    Ack, I’m confused.

  • #17 / Sep 22, 2007 2:18pm

    PXLated

    1800 posts

    I’d have to make the entry ID dynamic though…right?  I wouldn’t want to specify an ID because I’d only ever pull in one particular entry…right?

    Yes, just leave out the id and it would pull all entries. Use a normal weblog:entries tag with whatever parameters you need. In my test example I’m just pulling the one that has images for testing purposes.

    In your example code, you are pulling images from the images weblog into the interviews weblog entries. You aren’t displaying any of the interviews content, just the images. Does your code work if you take out the conditionals?

    Note, if you copy/paste code from the forums, make sure the quote marks aren’t curely quotes.

  • #18 / Sep 22, 2007 2:26pm

    ctrlaltdel

    119 posts

    Ok, just tried it without the conditionals and things work great.  All images associated with that article are pulled in.  Nice.

    Now, I just have to figure out what was wrong with my conditional.

    Thanks so much!

  • #19 / Sep 22, 2007 2:57pm

    PXLated

    1800 posts

    Not 100% sure but I think you need spaces…you’re not consistent on that…worth a try…
    {if count=="1"}
    {if count == "1"}

  • #20 / Sep 22, 2007 8:15pm

    ctrlaltdel

    119 posts

    Looks like I didn’t need to specify a count.  I just put:

    {reverse_related_entries weblog="images" sort="asc" orderby="title"}
    {if images_body}
    {images_body}
    {/if}
    {/reverse_related_entries}

    And it worked.  I tested it with entries that have images and entries that don’t…and everything is good.

    Thanks so much for your help!  I really appreciate it!

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

ExpressionEngine News!

#eecms, #events, #releases