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="{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="{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'}
<p class="event-dates"><span>Showing:</span>
<abbr class="dtstart" title="{event-start-date format="%Y-%m-%d"}T{event-start-date format="%H:%i+%Z"}">{event-start-date format="%l %F %j, %Y"}</abbr> -
<abbr class="dtend" title="{event-end-date format="%Y-%m-%d"}T{event-end-date format="%H:%i+%Z"}">{event-end-date format="%l %F %j, %Y"}</abbr></p>
<p class="event-hours"><span>Visitng hours:</span> {event-opening-hours}</p>
<p class="event-address"><span>Location:</span> <span class="location">{event-venue}</span></p>
<p class="event-ical"><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></p>
<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="{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="{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="{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="{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