Hi
Just to let you know that the Permalinks are now working - thanks!
Not sure what the problem was before, I removed a few line breaks and tried again using your permalink redirect code and now works really well.!
The code now looks like this
<?php
/* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
require_once "init.php";
list($listingRecords, $listingDetails) = getRecords(array(
'tableName' => 'listings',
'joinTable' => 'homepages',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$listing = @$listingRecords[0];
if (!$listing) { print "Listing not found!"; exit; }
?>
<?php permalinks_301redirectToPermalink($listing); ?>
<?php
// ++++++++++++++
// Get Page URL
// +++++++++++++++
include("../selfURL.php");
$work_url = (selfURL());
// echo $work_url; // Only used for testing BUT $work_url can be placed in code
?>
Regarding my first point, I have also managed to include some free text by creating some extra fields in the database for these. I then include them in my string on line 11 of the permalinks.php file. This line now looks like this (free text fields in red):-
$GLOBALS['PERMALINKS']['autopopulate_fromFields'] = array('property_type for_sale_in town bedrooms beds reference_number', 'title'); // the first field in this list with content will be used to create the permalinks. To use multiple fields separate them with spaces
This gives me a URL of /villa-for-sale-in-benitachell-3-beds-kjvs183/
You may notice that I am outputting "for" and "in" in the URL. I wanted to do this because it makes the URL more descriptive. To do this I removed these 2 words from line 12 so it is now as follows:-
$GLOBALS['PERMALINKS']['autopopulate_skipWords'] = array('a','an','and','as','at','before','but','by','from','is','into','it','like','of','off','on','onto','per','since','than','the','this','that','to','up','via','with'); // these seo unfriendly words will be removed
Thanks for the support guys
Regards
Andy