Jump to content

Database not showing reciprocal items.


Recommended Posts

Posted

Hi,

I have a database "ingredients" which is linked to a number of times from my other databases. For some strange reason, I am absolutely not able to list reciprocalitems on the display page.

I have tried multiple times to changes templates to see if that had any effect but nothing is happening. 

The code in my template is:

<div class='ipsPageHeader ipsClearfix ipsPad'>
	
	<div class='ipsPos_right ipsResponsive_noFloat ipsResponsive_hidePhone'>
		{template="follow" app="core" group="global" params="'cms', 'records'.$record::$customDatabaseId, $record->primary_id_field, $record->followers()->count( TRUE )"}
	</div>
	
	<h1 class='ipsType_pageTitle ipsContained_container'>
		{{if $record->locked()}}<span><i class='fa fa-lock'></i></span> {{endif}}

		{{if $record->isFutureDate() || $record->mapped('pinned') || $record->mapped('featured') || $record->hidden() === -1 || $record->hidden() === 1}}
			{{if $record->isFutureDate()}}
				<span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$record->futureDateBlurb()}'><i class='fa fa-clock-o'></i></span></span>
			{{elseif $record->hidden() === -1}}
				<span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$record->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span></span>
			{{elseif $record->hidden() === 1}}
				<span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span></span>
			{{endif}}
			{{if $record->mapped('pinned')}}
				<span><span class="ipsBadge ipsBadge_icon ipsBadge_positive" data-ipsTooltip title='{lang="pinned"}'><i class='fa fa-thumb-tack'></i></span></span>
			{{endif}}
			{{if $record->mapped('featured')}}
				<span><span class="ipsBadge ipsBadge_icon ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span></span>
			{{endif}}
		{{endif}}
		
		{{if $record->prefix() OR ( $record->canEdit() AND $record::canTag( NULL, $record->container() ) AND $record::canPrefix( NULL, $record->container() ) )}}
			<span {{if !$record->prefix()}}class='ipsHide'{{endif}} {{if ( $record->canEdit() AND $record::canTag( NULL, $record->container() ) AND $record::canPrefix( NULL, $record->container() ) )}}data-editablePrefix{{endif}}>
				{template="prefix" group="global" app="core" params="$record->prefix( TRUE ), $record->prefix()"}
			</span>
		{{endif}}
		{{if $record->canEdit()}}
			<div class='ipsType_break ipsContained' data-controller="core.front.core.moderation">
				<span data-role="editableTitle" title='{lang="click_hold_edit"}'>{$record->_title}</span>
			</div>
		{{else}}
			<div class='ipsType_break ipsContained'>{$record->_title}</div>
		{{endif}}
	</h1>
	
	{{if $record::database()->options['reviews']}}
		<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
			<meta itemprop='ratingValue' content='{$record->averageReviewRating()}'>
			<meta itemprop='reviewCount' content='{$record->record_reviews}'>
			{template="rating" group="global" location="front" app="core" params="'large', $record->averageReviewRating(), \IPS\Settings::i()->reviews_rating_out_of, $record->memberReviewRating()"}&nbsp;&nbsp; <span class='ipsType_normal ipsType_light'>({lang="num_reviews" pluralize="$record->record_reviews"})</span>
		</div>
	{{elseif $record->container()->allow_rating}}
		<div>{$record->rating()|raw}</div>
	{{endif}}	
</div>

<hr class='ipsHr'>

{{if count( $record->tags() ) OR ( $record->canEdit() AND $record::canTag( NULL, $record->container() ) )}}
	{template="tags" group="global" app="core" params="$record->tags(), FALSE, FALSE, ( $record->canEdit() AND $record::canTag( NULL, $record->container() ) ) ? $record->url() : NULL"}
{{endif}}	

<article class='ipsContained ipsSpacer_top ipsPad'>
	<div class='ipsClearfix'>
      <div class="ipsPos_right ipsColumn_wide infobox ipsType_center ipsAreaBackground ipsPad">
        <div>
        <h4 class="ipsType_center ipsType_sectionHead ipsType_large">{$record->_title}</h4>
        {{if $record->record_image}}
			<div class="ipsType_center ipsPad">
				<img class="ipsImage" src="{file="$record->_record_image_thumb" extension="cms_Records"}">
			</div>
		{{endif}}
        </div>
        <div class="ipsType_left">
          {{if $record->customFieldDisplayByKey('type', 'display')}}<p><b>Type:</b> {$record->customFieldDisplayByKey('type', 'display')|raw}</p> {{endif}}
          {{if $record->customFieldDisplayByKey('weight', 'display')}}<p><b>Weight:</b> {$record->customFieldDisplayByKey('weight', 'display')|raw}</p> {{endif}}
          {{if $record->customFieldDisplayByKey('max-stack-size', 'display')}}<p><b>Max Stack Size:</b> {$record->customFieldDisplayByKey('max-stack-size', 'display')|raw}</p> {{endif}}
          {{if $record->customFieldDisplayByKey('tier', 'display')}}<p><b>Tier:</b> {$record->customFieldDisplayByKey('tier', 'display')|raw}</p> {{endif}}
        </div>
      </div>
		<section class="ipsType_richText ipsType_normal" data-controller='core.front.core.lightboxedImages'>{$record->_content|raw}</section>
		
		{{if $record->editLine()}}
			{$record->editLine()|raw}
		{{endif}}
		
		{{if $records = $record->getReciprocalItems()}}
			{{$infoLineShown = FALSE;}}
			<br>
			{{foreach $records as $fieldId => $items}}
				<ul class="ipsList_inline ipsList_csv ipsList_noSpacing">
				{{foreach $items as $item}}
					<li>{{if ! $infoLineShown}}{{$infoLineShown=TRUE;}}{lang="records_linking_to_me" sprintf="$item::database()->recordWord(0,TRUE), $record::database()->recordWord(1)"}: {{endif}}<a href="{$item->url()}">{$item->_title}</a></li>
				{{endforeach}}
				</ul>
			{{endforeach}}
		{{endif}}
	</div>
	{{if $record instanceof \IPS\Content\Reputation and settings.reputation_enabled}}
	<div class='ipsPos_right'>
		{template="reputation" app="core" group="global" params="$record"}
		<br>
	</div>
	{{endif}}
	<hr class='ipsHr ipsClear ipsClearfix'>
	{{if $record->isFutureDate() or $record->canPin() or $record->canUnpin() or $record->canFeature() or $record->canUnfeature() or $record->canHide() or $record->canUnhide() or $record->canMove() or $record->canLock() or $record->canUnlock() or $record->canDelete()}}
		<a href='#elentryActions_menu' id='elentryActions' class='ipsButton ipsButton_light ipsButton_verySmall' data-ipsMenu>{lang="content_record_actions" sprintf="$record::database()->recordWord( 1, TRUE )"} <i class='fa fa-caret-down'></i></a>
		<ul id='elentryActions_menu' class='ipsMenu ipsMenu_auto ipsHide'>
			{{if $record->isFutureDate() and $record::canFuturePublish( NULL, $record->container() )}}
				<li class='ipsMenu_item'><a href='{$record->url('moderate')->csrf()->setQueryString( array( 'action' => 'publish' ) )}' data-confirm title='{lang="publish_now"}'>{lang="publish"}</a></li>
			{{endif}}
			{{if $record->canFeature()}}
				<li class='ipsMenu_item'><a href='{$record->url('moderate')->csrf()->setQueryString( array( 'action' => 'feature' ) )}' title='{lang="feature_title_record" sprintf="$record::database()->recordWord(1)"}'>{lang="feature"}</a></li>
			{{endif}}
			{{if $record->canUnfeature()}}				
				<li class='ipsMenu_item'><a href='{$record->url('moderate')->csrf()->setQueryString( array( 'action' => 'unfeature' ) )}' title='{lang="unfeature_title_record" sprintf="$record::database()->recordWord(1)"}'>{lang="unfeature"}</a></li>
			{{endif}}
			{{if $record->canPin()}}				
				<li class='ipsMenu_item'><a href='{$record->url('moderate')->csrf()->setQueryString( array( 'action' => 'pin' ) )}' title='{lang="pin_title_record" sprintf="$record::database()->recordWord(1)"}'>{lang="pin"}</a></li>
			{{endif}}
			{{if $record->canUnpin()}}				
				<li class='ipsMenu_item'><a href='{$record->url('moderate')->csrf()->setQueryString( array( 'action' => 'unpin' ) )}' title='{lang="unpin_title_record" sprintf="$record::database()->recordWord(1)"}'>{lang="unpin"}</a></li>
			{{endif}}
			{{if $record->canHide()}}				
				<li class='ipsMenu_item'><a href='{$record->url('moderate')->csrf()->setQueryString( array( 'action' => 'hide' ) )}' title='{lang="hide_title_record" sprintf="$record::database()->recordWord(1)"}' data-ipsDialog data-ipsDialog-title="{lang="hide"}">{lang="hide"}</a></li>
			{{endif}}
			{{if $record->canUnhide()}}				
				<li class='ipsMenu_item'><a href='{$record->url('moderate')->csrf()->setQueryString( array( 'action' => 'unhide' ) )}' title='{{if $record->hidden() === 1}}{lang="approve_title_record" sprintf="$record::database()->recordWord(1)"}{{else}}{lang="unhide_title_record" sprintf="$record::database()->recordWord(1)"}{{endif}}'>{{if $record->hidden() === 1}}{lang="approve"}{{else}}{lang="unhide"}{{endif}}</a></li>
			{{endif}}
			{{if $record->canLock()}}				
				<li class='ipsMenu_item'><a href='{$record->url('moderate')->csrf()->setQueryString( array( 'action' => 'lock' ) )}' title='{lang="lock_title_record" sprintf="$record::database()->recordWord(1)"}'>{lang="lock"}</a></li>
			{{endif}}
			{{if $record->canUnlock()}}				
				<li class='ipsMenu_item'><a href='{$record->url('moderate')->csrf()->setQueryString( array( 'action' => 'unlock' ) )}' title='{lang="unlock_title_record" sprintf="$record::database()->recordWord(1)"}'>{lang="unlock"}</a></li>
			{{endif}}
			{{if $record->canMove()}}				
				<li class='ipsMenu_item'><a href='{$record->url('move')->csrf()}' data-ipsDialog data-ipsDialog-title="{lang="move"}"  title='{lang="move_title_record" sprintf="$record::database()->recordWord(1)"}'>{lang="move"}</a></li>
			{{endif}}
			{{if $record->canDelete()}}				
				<li class='ipsMenu_item'><a href='{$record->url('moderate')->csrf()->setQueryString( array( 'action' => 'delete' ) )}' data-confirm  title='{lang="delete_title_record" sprintf="$record::database()->recordWord(1)"}'>{lang="delete"}</a></li>
			{{endif}}
			{{if \IPS\Member::loggedIn()->modPermission('can_view_moderation_log')}}
				<li class='ipsMenu_sep'><hr></li>
				<li class="ipsMenu_item"><a href='{$record->url()->csrf()->setQueryString( array( 'do' => 'modLog' ) )}' data-ipsDialog data-ipsDialog-title='{lang="moderation_history"}'>{lang="moderation_history"}</a></li>
			{{endif}}

		</ul>
	{{endif}}
	{{if $record->canEdit()}}
		&nbsp;&nbsp;<a href='{$record->url('edit')->csrf()}' title='{lang="edit"}'>{lang="edit"}</a>
	{{endif}}
	{{if !\IPS\Member::loggedIn()->group['gbw_no_report'] }}
		&nbsp;&nbsp;<a href='{$record->url('report')}' data-ipsDialog data-ipsDialog-size='medium' data-ipsDialog-title="{lang="content_record_report" sprintf="$record::database()->recordWord( 1, TRUE )"}" data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="{lang="report_submit_success"}" title="{lang="content_record_report" sprintf="$record::database()->recordWord( 1, TRUE )"}">{lang="content_record_report" sprintf="$record::database()->recordWord( 1, TRUE )"}</a>
	{{endif}}
	{{if $record->canManageRevisions()}}
		&nbsp;&nbsp;<a href='{$record->url('revisions')}' title="{lang="content_view_revisions"}">{lang="content_view_revisions"}</a>
	{{endif}}
</article>

<div class='ipsResponsive_showPhone ipsResponsive_block ipsSpacer_top'>
	{template="follow" app="core" group="global" params="'cms', 'records'.$record::$customDatabaseId, $record->primary_id_field, $record->followers()->count( TRUE )"}
</div>
	
<div class='ipsGrid ipsGrid_collapsePhone ipsPager ipsClearfix ipsSpacer_top'>
	<div class="ipsGrid_span6 ipsType_left ipsPager_prev">
		{{if $record::database()->use_categories}}
			<a href="{$record->container()->url()}" title="{lang="cms_back_to_category_with_title" sprintf="$record->container()->_title"}" rel="up">
				<span class="ipsPager_type">{lang="cms_back_to_category" sprintf="$record::database()->recordWord( 2 )"}</span>
				<span class="ipsPager_title ipsType_light ipsTruncate ipsTruncate_line">{lang="$record->container()->_title"}</span>
			</a>
		{{else}}
			{{$page = \IPS\cms\Pages\Page::$currentPage;}}
			<a href="{$page->url()}" title="{lang="cms_back_to_category_with_title" sprintf="$page->_title"}" rel="up">
				<span class="ipsPager_type">{lang="cms_back_to_category" sprintf="$record::database()->recordWord( 2 )"}</span>
				<span class="ipsPager_title ipsType_light ipsTruncate ipsTruncate_line">{$page->_title}</span>
			</a>
		{{endif}}
	</div>
	{{if $nextUnread !== NULL}}
		<div class='ipsGrid_span6 ipsType_right ipsPager_next'>
			<a href="{$nextUnread->url()->setQueryString( array( 'do' => 'getNewComment' ) )}" title='{lang="cms_view_next_unread_title" sprintf="$record::database()->recordWord( 1 )"}'>
				<span class="ipsPager_type">{lang="cms_next_unread_title" sprintf="$record::database()->recordWord( 1 )"}</span>
				<span class="ipsPager_title ipsType_light ipsTruncate ipsTruncate_line">{$nextUnread->mapped('title')}</span>
			</a>
		</div>
	{{endif}}
</div>

{{if !$record->container()->disable_sharelinks}}
	<hr class='ipsHr'>
	{template="sharelinks" app="core" group="global" params="$record"}
{{endif}}

<br>
{{if $commentsAndReviews}}
	<a id="replies"></a>
	<h2 class='ipsType_sectionTitle ipsType_reset'>{lang="user_feedback"}</h2>
	{$commentsAndReviews|raw}
{{endif}}

<br>
{{if $updateForm}}
	<div class='ipsAreaBackground_light ipsPad'>
		<h2 class='ipsType_sectionHead'>{lang="cms_front_update_fields" sprintf="$record::database()->recordWord( 1 )"}</h2>
		<ul class='ipsForm ipsForm_vertical'>
			{$updateForm|raw}
		</ul>
	</div>
{{endif}}

 

An example of an affected page is: https://www.rendforums.com/database/ingredients/wood-stick-r1/

A page that is linked to that one is: https://www.rendforums.com/database/recipes/stone-pick-r1/

Screenshot of link from that page:

Capture.PNG.e74c12c39d7b68292e8024a3dc96281c.PNG

The other Ingredient item linked also does not show the connection: https://www.rendforums.com/database/ingredients/cobblestone-r5/

Could you please help me work out why these don't show? 

Thanks,

Jacques

Capture.PNG

Capture.PNG

Posted

The template looks fine and it sounds like you already tried switching to the default template to rule out template problems. 

Just to state the obvious first: Have you actually turned on cross-linking for that field?

59097eab8ed8c_ScreenShot2017-05-03at08_52_51.thumb.png.1b4f5169087ff322a6a2e22adce158e3.png

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...