Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
LaCollision Posted October 4, 2018 Posted October 4, 2018 Hi, I'm not able to make multiple SEO Titles work in a URL component... In my furl.json file, I have something like this: "my_url": { "friendly": "/{?0}-{#pid}/folder/{?1}-{#id}", "real": "app=myapp&module=mymodule&controller=mycontroller" }, … and in my template: {url="app=…&pid=…&id=…" seoTemplate"my_url" seoTitle="value1, value2"} Then I always have this error in DEV mode: IPS \ Http \ Url \ Exception SEO_TEMPLATE_IS_NOT_VALID_FOR_URL …/Sites/workspace/podcastics/system/Http/Url/Friendly.php:156 It looks like the issue comes from the method: protected static function getMatchedParamsFromFriendlyUrlComponent( $furlDefinition, $friendlyUrlComponent ) { /* See if it matches */ $seoTitles = array(); $matchedParams = array(); foreach ( $furlDefinition['regex'] as $_regex ) { if ( preg_match( '/^' . $_regex . '$/i', $friendlyUrlComponent, $matches ) ) { foreach ( $furlDefinition['params'] as $k => $param ) { if ( $param ) { $matchedParams[ $param ] = $matches[ $k + 1 ]; } else { $seoTitles[] = $matches[ $k + 1 ]; } } return array( $matchedParams, $seoTitles ); } } /* Still here? No match */ return NULL; } I've checked that in this method, the line: if ( preg_match( '/^' . $_regex . '$/i', $friendlyUrlComponent, $matches ) ) … always returns false in my case. Any idea? Thank you! Note: this error only appears in DEV mode, and not in regular mode. When I'm not in DEV mode, the correct URL is built in the template – so it works, except when in DEV mode. Thanks 🙂
Recommended Posts
Archived
This topic is now archived and is closed to further replies.