1084

custom routing with hyphen instead of underscore

Comments for “custom routing with hyphen instead of underscore”
 

Posted by mjim on Wednesday 13th July 2022 at 13:33 GMT

I need to use a hyphen instead of an underscore on some paths for SEO and Google Ads urls that were set on the website before I converted to Trongate.

I added this in custom_routing.php:
'iso-17025-gage-calibration-services' => 'iso_17025_gauge_calibration_services',


And the error I get is:
ERROR: View file does not exist at: /public_html/modules/iso-17025-gage-calibration-services/views/iso_17025_gauge_calibration_services.php
Level One Member

mjim

User Level: Level One Member

Date Joined: 6/01/2022

Posted by DaFa on Thursday 14th July 2022 at 00:26 GMT

Hi Jim,

I think I may have looked at this in the past and tried to search it up here, but don't think the search feature is working too well at the moment. I know there was an issue with the desktop app and hyphens in app names because the database creation failed, which I had a fix for, but this is something different.

I'll have another look a bit later today as I have to go out right now.
Founding Member

DaFa

User Level: Founding Member

Date Joined: 30/11/2018

Posted by mjim on Thursday 14th July 2022 at 00:30 GMT

Thanks Dafa.

Custom routing works now when I add $data['view_module'] in my controller:

$data['view_module'] = 'iso_17025_gauge_calibration_services';
$data['view_file'] = 'iso_17025_gauge_calibration_services';

This comment was edited by mjim on Thursday 14th July 2022 at 00:36 GMT

Level One Member

mjim

User Level: Level One Member

Date Joined: 6/01/2022

Posted by DaFa on Thursday 14th July 2022 at 00:43 GMT

Yes, that was it, adding $data['view_module'] is a must if you are using custom routes.

Cheers mate 👍
Founding Member

DaFa

User Level: Founding Member

Date Joined: 30/11/2018

×