Linking Data to a summary page

13 posts by 3 authors in: Forums > CMS Builder
Last Post: October 27, 2011   (RSS)

Hi

I'm stuck on this one. I have a tours summary page (tours_summary.php), which when selected, is populated by the country image, the country intro and a summary of tours related to that country (only). This is done by // determine if a country was selected for searching
$tourIntroWhere = @$_REQUEST['country_list_keyword']
? "country_name LIKE '\t". mysql_real_escape_string( @$_REQUEST['country_list_keyword'] ) ."\t'"
: "title = 'Generic'";

and // load intro records
list($tourIntroRecords) = getRecords(array(
'tableName' => 'country_intros',
'where' => $tourIntroWhere,

I get that. However, I also want it to add (also in the table name 'country_intros') the

1) seo_title and

2) seo_description

How would I write this script to include that as well? Do I have to write another $tourIntroWhere = ?

I'm stuck. Any direction would help.

Thanks

Re: [degreesnorth] Linking Data to a summary page

By robin - October 19, 2011

Hey,

Do you want to search by the SEO fileds or just display them?

Thanks,
Robin
Robin
Programmer
interactivetools.com

Re: [degreesnorth] Linking Data to a summary page

By robin - October 20, 2011

Hey,

Is the problem that you want to have page_title or meta_description fields in your country section?

Thanks
Robin
Programmer
interactivetools.com

Re: [robin] Linking Data to a summary page

I have both in the country section. However, I want them to display on the tours.php page, relative to the country which is selected. The tours.php pulls the country image, the country name, the intro dependent on the country selected, but I don't know how to include the page_title and meta_description.

Re: [degreesnorth] Linking Data to a summary page

By Jason - October 24, 2011

Hi,

Could you attach tours.php to this thread so we can see the code you're using? Also, could you let us know what fields are stored in your country section?

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] Linking Data to a summary page

The section "country_intros" has the fieldnames of:

country_name (list)
country_intro_copy
main_image (image)
top_right (image)
seo_page_title
seo_meta_description


There are other ones as well, but these are the main ones which should be pulled in to the tours.php

Thanks in advance.


Cheers

Carole
Attachments:

tours.php 34K

Re: [degreesnorth] Linking Data to a summary page

By Jason - October 25, 2011

Hi Carole,

I took a look at your page. Where does the country_name list field take it's values from? Is there a field in tours that shares the same value?

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] Linking Data to a summary page

The country_list is from the country list editor.

Sorry, i noticed I just sent you the wrong file. Here's the correct tours_summary.php page.
Attachments:

tours_summary.php 19K

Re: [degreesnorth] Linking Data to a summary page

By Jason - October 26, 2011

Hi,

I can see that you retrieve the a record from country_intros here:

list($tourIntroRecords) = getRecords(array(
'tableName' => 'country_intros',
'where' => $tourIntroWhere,
));

$tourIntroRecord = @$tourIntroRecords[0]; // get first record


Can you then use this record to output your Meta Information?
example:

<title><?php echo $tourIntroRecord['seo_title'] ?> | Active Travel</title>
<meta name="description" content="<?php echo $tourIntroRecord['seo_description'] ?>" />


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/