Low Google Search - Custom Meta Tags Not Parsing
Using Low GoogleSearch, looking to parse custom meta tags for each cralwed entry so we can create robust search results. Starting small with the description, for some reason the tag is not parsing just seeing {meta-description}, wondering what we are doing wrong. The get fields parameter is set to description, and the content is in the XML but the tag is not parsing
Replies
Low 21 Mar 2015 08:53
Meta-tags aren't supported just yet. It's tricky to support, as not all tags are present in each search result.
If you send me your cx-code, I can take a look at what tags are present in your account, and add basic meta tags support to the add-on based on that.
nycgo .com 22 Mar 2015 20:19
Forgive me, but what do you mean by cx-code?
nycgo .com 22 Mar 2015 20:45
Hey Low,
The Google Search XML, returns all getfields parameters as "MT", i assume which stands for Meta.
If you insert the following statement on lines 487 of mod.low_googlesearch.php
elseif ($res->tag == 'MT')
{
$entry["meta-".$res->attributes['N']] = $res->attributes['V'];
}
This will essentially add a tag for any meta tags you specify in getfields parameter you pass to the google search. This will allow you to add custom meta tags to your pages, have them indexed, and then use them as EE tags. All meta tags will be preceded with a {meta-*},
So if you add a then when the item is crawled the EE variable becomes {meta-description}.
Our thoughts are to load the page up with a ton of custom meta parameters and use these to create robust search results with thumbnails and lat/long, etc.
Hope you dont mind us modifying.
Low 23 Mar 2015 08:57
I don't mind at all. I was going to add something similar. It just needs some more checks to see if the tag/attributes are set for each search result, and set default (empty) values if they're not present, based on the searchfields-parameter.
The cx-code is only relevant if you're using the hosted version, but you're using a search appliance, so never mind.