Related Records Portlets

A place for users and developers of the Xataface to discuss and receive support.

Related Records Portlets

Postby rolandsnowe » Tue Jan 22, 2008 4:16 pm

Hello again,

I have two questions regarding the related records portlets. The ones that show up on the left of the main record and have the 'see all' links in the h3 tags.

1. How would I go about forcing the related portlet to appear even if there are no associated records? Say, for example, with the h3 title and some text that says 'no related records'.

2. Is it possible to force all of the related records to appear in each portlet, not sure if this is the default behavior, but I assumed not since there exists the 'see all' links.

Thanks for the help.
rolandsnowe
 
Posts: 4
Joined: Thu Nov 08, 2007 4:13 pm

Postby shannah » Sun Jan 27, 2008 7:36 pm

How would I go about forcing the related portlet to appear even if there are no associated records?


Currently there is no setting to allow this. The best way is probably to create a new section to show exactly what you want.

e.g. suppose we want a publications section for an author record. Then in the author delegate class we might have:

Code: Select all
function section__publications(&$record){
    $pubs = df_get_records('publications', array('author_id'=>$record->val('author_id')));
    return array(
        'label' => 'Publications',
        'records' => $pubs,
        'class' => 'left'
     );

}


Then you would hide the section for the publications relationship section by adding
Code: Select all
section:visible=0

to its definition in the relationships.ini file.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 27 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved