Question on homepages IF?

12 posts by 2 authors in: Forums > CMS Builder
Last Post: May 18, 2010   (RSS)

By thenetgirl - May 17, 2010

I have a website montereyrentals.com they would like to sell space to other realtors/property owners

everythingworks pretty well till I get the contact info on the individual detail pages because it intergraes with the homepages of the agents for contact info.

I can make a homepages2 that wont appear on the company profile page but how to I edit the info on the detail page

If its homepage print this if its homepages2 print that? NOT EXACTLY SURE HOW TO DO THAT PART.



AGENT INFORMATION</b><font size="2">&nbsp;
</font>

<p align="center">
<b> <?php echo $vacation_rentalsRecord['homepages.name'] ?></b></p>
<p align="center">
<font size="2"><b>Phone: </b> <?php echo $vacation_rentalsRecord['homepages.phone'] ?></font><p align="center">
<font size="2"><b>Email: </b> <a href="mailto:<?php echo $vacation_rentalsRecord['homepages.email'] ?>">
<?php echo $vacation_rentalsRecord['homepages.email'] ?></a>
</font>




HELP PLEASE

THANKS
Patricia

www.thenetgirl.com

Re: [thenetgirl] Question on homepages IF?

By Jason - May 17, 2010

Hi,

So, do you have 2 different sections, homepages and homepages2? If there is information in homepages2, is there no information in homepages?

Let me know and we'll get it figured out.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Question on homepages IF?

By thenetgirl - May 17, 2010

yes I have made a second section not hompepages2 but ownerhomepage

'tableName' => 'ownerhomepage',

on the detail page i want a choice of either to put the name phone and email from one or the other NOT both

homepage or ownerhomepages
Patricia

www.thenetgirl.com

Re: [thenetgirl] Question on homepages IF?

By Jason - May 17, 2010

Hi

You'll need to decide which criteria you'll base that choice on. For example, if you wanted to output information from homepage if information exists in it and from ownerhomepage otherwise, you could try something like this:

<?php if($vacation_rentalRecord['homepages.email']): ?>
*OUTPUT INFORMATION FROM HOMEPAGES*
<?php else: ?>
*OUTPUT INFORMATION FROM OWNERHOMEPAGES*
<?php endif ?>


Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Question on homepages IF?

By thenetgirl - May 17, 2010

I must have missed something it works on the homepage people but not on ownerhomepage

NOT WORKING > http://www.montereyrentals.com/VacationRentalsDetail.php?test-172

WORKING > http://www.montereyrentals.com/VacationRentalsDetail.php?9V-151

have in header

list($vacation_rentalsRecords, $vacation_rentalsMetaData) = getRecords(array(
'tableName' => 'vacation_rentals',
'joinTable' => 'homepages','ownerhomepage',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$vacation_rentalsRecord = @$vacation_rentalsRecords[0]; // get first record

// show error message if no matching record is found
if (!$vacation_rentalsRecord) {
print "Record not found!";
exit;
}

list($homepagesRecords, $homepagesMetaData) = getRecords(array(
'tableName' => 'homepages',
));

list($ownerhomepageRecords, $ownerhomepageMetaData) = getRecords(array(
'tableName' => 'ownerhomepage',
));


HERE IS CODE

<p align="center">
<?php if($vacation_rentalsRecord['homepages.name']): ?>
<b> <?php echo $vacation_rentalsRecord['homepages.name'] ?></b></p>
<?php else: ?>
<p align="center">
<b> <?php echo $vacation_rentalsRecord['ownerhomepage.name'] ?></b></p>
<p align="center">
<?php endif ?>
<?php if($vacation_rentalsRecord['homepages.phone']): ?>
<font size="2"><b>Phone: </b> <?php echo $vacation_rentalsRecord['homepages.phone'] ?></font>
<?php else: ?>
</p>
<p align="center">
<font size="2"><b>Phone: </b> <?php echo $vacation_rentalsRecord['ownerhomepage.phone'] ?></font>
<?php endif ?>
<p align="center">
<?php if($vacation_rentalsRecord['homepages.email']): ?>
<font size="2"><b>Email: </b> <a href="mailto:<?php echo $vacation_rentalsRecord['homepages.email'] ?>">
<?php echo $vacation_rentalsRecord['homepages.email'] ?></a>
</font>
<?php else: ?>
<p align="center">
<font size="2"><b>Email: </b> <a href="mailto:<?php echo $vacation_rentalsRecord['ownerhomepage.email'] ?>">
<?php echo $vacation_rentalsRecord['ownerhomepage.email'] ?></a>
</font>

<?php endif ?>
Patricia

www.thenetgirl.com

Re: [thenetgirl] Question on homepages IF?

By Jason - May 18, 2010

Hi,

If you'd like to email your CMS login and FTP details to jason@interactivetools.com, I can take a closer look at it. Please don't post this information to the forum.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Question on homepages IF?

By thenetgirl - May 18, 2010

Ok done



pg
Patricia

www.thenetgirl.com

Re: [thenetgirl] Question on homepages IF?

By Jason - May 18, 2010

Hi,

What's happening is that "homepage" information is based on the user number of the person who created the record. The problem is that the record number of a user in "ownerhomepages" is not the same as their user number.

I think the easiest solution here would be to add a phone_number field to the User Account section. This way, you can display contact information like this:

echo $vacation_rentalsRecord['createdBy.fullname'];
echo $vacation_rentalsRecord['createdBy.email'];
echo $vacation_rentalsRecord['createdBy.phone_number'];


Using this, you're always getting your information from the same place.

Let me know if this would work for you.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [thenetgirl] Question on homepages IF?

By Jason - May 18, 2010

When it's an owner, and not an agent, that is the contact, is it the owner that creates the listings? If so, then we can get the information we want from User Accounts, and the owner wouldn't appear in the homepage list at all.

If this doesn't work for you, I would suggest putting in "Owner Email","Owner Phone", and "Owner Name" as fields in the rental listing. This would only be filled in if it's an owner listing the page, and not an agent. Then we would only display this information if it has been entered, otherwise, we'd display the information from the "homepage" table.

Would this work?
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/