many-to-many relationship, show all related items as list on the joined list details

In the following screencast, I attempt to describe what I need to accomplish.. I am open to ALL ideas..
The DB, as it relates to this, is setup as follows. the DBjoin is implemented on the Physician list via the physician_to_specialties table..

Tables
Physicians |many-to-many| Services

how to show on the detail view for a service in the services list, Al physicians with that service as a list. Basically a filtered physicians list with the filter being the service being viewed.. how best to do this?

http://screencast.com/t/PQCo5Ilf

Maybe all I need to do is create a join in the Specialties table back to physicians through the normalization table, so that data is available?? I dont know.. I am not familiar enough with fabrik to know how best to accomplish these things
 
hi
Thanks for the video :)
To achieve this one, I'm presuming that you have a physician's list which is joined to the many-many table

You will need to use the Joomla Fabrik content plugin, so ensure its installed and published.

Then edit the services form and in it's outro section, add the following content

Code:
{fabrik view=list id=11 physicians___service=[rowid]}

- change: the id (11) to that of your physicians list.
- change 'physicians___service' to the full element name of the element which contains the service id value.

Also ensure that in the services form :
options -> Process Joomla plug-ins is set to 'details view only'

This should then embed a list of the physicians associated with the service you are viewing.
 
:D I love you man.. now, presuming the default template thing is fixed when I upload that part is done.. OMG, I could be done with this today.. I want to CRY!?! I am so happy..!
 
ok, I see that the list layout is saving, at least the drop down shows the selected template.. however, the Default list template is the one that is used when
PHP:
{fabrik view=list id=11 physicians___service=[rowid]}

So I tried the menu, I setup a menu and set its layout to -Use Default- and it seems to be loading, most of the template.. not the css..? or something.
It's acting strange.. with this content plugin initiated, now the menu full list only shows the filtered results.. even with reset filters.. kinda strange! eh!
see my awesome screencast presentation!

http://screencast.com/t/2hKi2d0CUAc
 
I found the template setting for the plugin code. however, I still have the issue of not getting the full list, or only getting the filtered results from the plugin, on the full list menu.. even with reset filters=1 why is this?
 
I'm looking at your site now, and I seem to be getting the whole enchilada on that page now, plus soe filters. Did you get it resolved? If not, and you still only seeing 2 rows, it may be a session filter issue specific to you.

Loved the video, btw. You sound so much how I feel sometimes. Help, man!

-- hugh
 
We are in this together.. HA!..
No I have not figured this out yet... Not sure how to start digging into it..
I thought it might be related to session storage.. but.. hmmm. wtf.. eh.. . This issue could be the reason the other strangeness is happening.. it seems related..
 
well, I have re-opened this because I just saw an issue.. while changing the number-per-page on this page, all the data dis-apears.. it appears to be an ajax thing.. I dont remember turning that on.. ? Might have been you rob? or defaults on?

however.. it appears that my template is not grabbing the data anymore..!? strange.. go see
/specialties/details/1/1

then change the num-per-page
 
The list, when embedded via the j content plugin, always uses ajax, as otherwise you would be taken off the page you were viewing and be presented purely with the list's data - no longer embedded in the article page you were previously viewing.

The issue is with your custom template, its probably missing the correct class names that we use to determine where to insert the correct data. If you look at the default lits template's default_row.php file you'll see :

PHP:
<tr id="<?php echo $this->_row->id;?>" class="<?php echo $this->_row->class;?>">
<?php foreach ($this->headings as $heading => $label) {
$style = empty($this->cellClass[$heading]['style']) ? '' : 'style="'.$this->cellClass[$heading]['style'].'"';
?>
<td class="<?php echo $this->cellClass[$heading]['class']?>" <?php echo $style?>>
<?php echo @$this->_row->data->$heading;?>
</td>
<?php }?>
</tr>

the

PHP:
<?php echo $this->cellClass[$heading]['class']?>

part is imperative for the ajax to work, you'll probably need to add that into your custom template.
 
There was no real information in the custom template wiki about the required ajax stuff, nor how it works..

I am not sure how the ajax updates the dom via the output class designation, so I will have to play and see what happens.
 
yeah. I am flying blind.. I based my template off the div and custom example. The
PHP:
class="<?php echo $this->cellClass[$heading]['class']?>" <?php echo $style?>
is wrapped in the for each
PHP:
foreach ($this->headings as $heading => $label
which I am not using.. I am doing
PHP:
<div id="<?php echo $this->_row->id;?>" class="<?php echo $this->_row->class;?>">
<div class="listphoto-box">
        <?php  echo $this->_row->data->fab_physicians___image; ?>
        <a href="<?php  echo $this->_row->data->fabrik_view_url; ?>" class="viewprofile_btn">Veiw Profile</a>
    </div>
    <div class="listbio-box">
         <a href="<?php  echo $this->_row->data->fabrik_view_url; ?>" class="viewprofile"><?php  echo ($this->_row->data->fab_physicians___Last_name.', '.$this->_row->data->fab_physicians___First_name.' - '.$this->_row->data->fab_physicians___Title); ?></a>
        <div class="listspecialties">
            <?php  echo $this->_row->data->fab_physicians_specialties___specialty_id; ?>
        </div>
    </div>
</div>
so I have tried inserting that "<?php echo $this->cellClass[$heading]['class']?>" in a wrapping div, however the class is always null.!?

All the ajax request are causing me to be blocked... too many requests..? what about setting the total results in the plugin code, I can hide the filter with css.
 
Yes, its not really clear in the docs, and the markup generation could be cleaner/easier to manage/write , however...
Something like this should work, - wrap each piece of data with a span containing the correct id before inserting it into the template:
PHP:
<?php
$row = $this->_row->data;
$lastname = '<span class="' . $this->cellClass['fab_physicians_specialties___Last_name']['class'] . '">' . $row->fab_physicians___Last_name . '</span>';
$firstname ='<span class="' . $this->cellClass['fab_physicians_specialties___First_name']['class'] . '">' . $row->fab_physicians___First_name . '</span>';
$title ='<span class="' . $this->cellClass['fab_physicians_specialties___Title']['class'] . '">' . $row->fab_physicians___Title . '</span>';
 
<div id="<?php echo $this->_row->id;?>" class="<?php echo $this->_row->class;?>">
<div class="listphoto-box">
        <?php  echo $row->fab_physicians___image; ?>
        <a href="<?php  echo $this->_row->data->fabrik_view_url; ?>" class="viewprofile_btn">Veiw Profile</a>
    </div>
    <div class="listbio-box">
        <a href="<?php  echo $row->fabrik_view_url; ?>" class="viewprofile">
<?php  echo $lastname . ', ' . $firstname . ' - ' . $title; ?></a>
        <div class="listspecialties <?php echo $this->cellClass['fab_physicians_specialties___specialty_id']['class']">
            <?php  echo $row->fab_physicians_specialties___specialty_id; ?>
        </div>
    </div>
</div>
 
Oh hey, now THAT makes sense!! HA... Thanks..!! ! .. I will need to favorite this post and come back to it. can I favorite a post.?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top