psy Posted April 1 Posted April 1 Further to above, there was an issue with the sitemap handling urlsegments with the canonical link. Another hook solved it for me: Spoiler // update canonical, twitter and OG urls with urlSegments $wire->addHookAfter('SeoMaestro::renderMetatags', function($event) { $name = $event->arguments(0); $group = $event->arguments(1); if(!is_array($name) || !count($name)) return; if(is_null($group)) return; $input = $this->wire('input'); $segments = $input->urlSegments(); if(count($segments) < 1) return; $pageUrl = $this->wire('page')->httpUrl; $urlWithSegs = rtrim($pageUrl, '/') . '/' . $input->urlSegmentStr(); switch($group) { case 'twitter': case 'opengraph': if(!isset($name['url'])) return; $name['url'] = str_ireplace($pageUrl, $urlWithSegs, $name['url']); break; case 'meta': if(!isset($name['canonicalUrl'])) return; $name['canonicalUrl'] = str_ireplace($pageUrl, $urlWithSegs, $name['canonicalUrl']); break; default: break; } $event->return = $name; }); 1
strandoo Posted August 14 Posted August 14 Hi all. I often start a new site by duplicating or creating a profile of an existing site. Because of time constraints, I may use an existing page as part of the new site (about, contact pages, etc). I then need to go through all the pages/fields of the new site to remove any trace of the site's previous identity in the SEO Maestro fields. Does anyone have a good way to quickly/easily/automatically purge all the previous data to get a 'clean' SEO field? I could probably delete the field from all templates then uninstall/reinstall the module. Any other ideas?
strandoo Posted August 14 Posted August 14 Doh. After asking the above, I used the 'Add or remove fields from template' (Actions tab for the field), I unticked all templates for the SEO Maestro field (taking a screenshot first for a record), then deleted the field, recreated it and re-added the removed templates. Fields purged, relatively painless. Sometimes the answer appears when posing the question. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now