Hey all, I'm looking at integrating the Facebook Share plugin a bit more into my site, and I would need to find the exact web site address: So far it would be: http://jdmtrader.com.au/listing/ I would need to somehow import the Listing ID in that space, then a / slash and then the actual SEO web site address, (I am using the SEO plugin. I could normally just say "listing/234/ or something along those lines without the SEO plugin but I would really love to get this result: JDMTrader.com.au - The Free JDM Car/Parts Classified The fields i'm trying to pull out are: Listing ID: SEO URL Any help would be hugely appreciated. Thank you in advance
Depending on where you are trying to get these variables will depend on if its available or how to get it manually. Take a look at viewlisting.php to see how we get the listing id from the url and check the title for seo: You can use the seo module to generate the title if provided a listing id via url or elsewhere: PHP: // Get libraries$modules = Library::loadLibrary('Modules');$listings = Library::loadLibrary('Listings');// Get or set the id$id = (int) $_GET['view']; // or you can set this to the id you want// Fetch the listing details from db$listing = $listings->getListingById($id);// Get the seo url string$seo_url = $modules->call_hook('listing_url', $listing);
Thanks for the info. I tried working with the seo code but couldn't seem to get {$seo_url} to display anything when calling it.
Hey Mate I am sorry I wasn't able to reply on this one. I was wondering where the php that you posted up was supposed to be placed in? (which file in particular) Thanks for your help.
John's code example was meant to show you how you can assign the value of a listing to the $seo_url variable. This code is likely to work in just about any of the "main" php files where you need it. Once the listing url is assigned to $seo_url, you would then need to assign it as a template variable so that it's accessible within a template file.