This topic is locked

Link to morepics on View page.

5/19/2008 5:53:17 AM
PHPRunner General questions
M
mmponline author

I have a MorePics table and master detail relationship with my main (properties) table setup. The link to the more pics works fine and shows ajax and click shows Master / details tables.
When I copy the code over to the view page, it does not show the master details table on click and mouse-over details does not work at all. The code I'm copying is:

<A

id=master_MorePics{$row.1recno}

href="MorePics_list.php?{$row.1MorePics_masterkeys}" {if $useAJAX} onmouseover="RollDetailsLink.showPopup(this,'MorePics_detailspreview.php'+this.href.substr(this.href.indexOf('?')));" onmouseout="RollDetailsLink.hidePopup();" {/if}>More

Pictures...


Please assist!

J
Jane 5/20/2008

Hi,
unfortunately there is no easy way to show preview of detail page on the view page.
To correct your link see my changes in Bold:

<A href="MorePics_list.php?{$MorePics_masterkeys}" >More Pictures</a>


Then add following code to the View page: Before display event:

$smarty->assign("MorePics_masterkeys","mastertable=MasterTableName&masterkey1=".$values["ForeignKey"]);



where ForeignKey is your actual field name, MasterTableName is your actual table name.

M
mmponline author 5/20/2008

Thanks Jane, this is perfect and more than easy enough for me!
Appreciate your help!

M
mmponline author 6/9/2008

Jane
I now have a further need on this, please:

When the details table has no info in it, I want the link NOT to show.
Let me summarise:

  1. I've put a link on the master table's view page as discribed that shows the details table's info.
  2. When this details table has no info in it, I want the link not to display.
  3. When it has info, the link needs to be there.
    Thanks for your help!