Post by cowpoke McStink » Thu Sep 17, 2009 3:00 am

I have duplicated the Information Block into a block called "resources". I activated it, and everything seemed to be working fine, until I took a closer look and determined that my SEO_URL's were not showing up.

I thought I tracked down the problem when I located and updated the catalog/controller/common/seo_url.php. Basically I duplicated the information entries and changed them to resources, the same way I did for all the files when I was doing the initial duplication... but still, no SEO urls.

I checked the database and they are being properly inserted into the URL_alias table just like the information entries.

Does anyone know of any where else I need to let opencart know that my new resources module exists in order to make the seo urls show?

Thanks for any help!

User avatar

Posts

Joined
Fri Aug 14, 2009 6:01 am
Location - The Vast Deserts of California

Post by dbstr » Thu Sep 17, 2009 4:43 am

What does the links look like, in your controller? Do you rewrite them?

Request Reviews v1.0 released.


Active Member

Posts

Joined
Sun Aug 30, 2009 12:20 am

Post by cowpoke McStink » Thu Sep 17, 2009 4:52 am

*********I FIXED IT******* Scroll down for answer. :)

The controller writes the links exactly the same way as the default "information" block that comes with the install package.

Code: Select all

'href'      => $this->url->http('resources/resources&resources_id=' . $this->request->get['resources_id']),
The controller passes the links non SEO.. I think it's the catalog/controller/common/seo_url.php job to rewrite them when the page is being rendered. Here are some snippets from that file..

Code: Select all

					if ($url[0] == 'information_id') {
						$this->request->get['information_id'] = $url[1];
					}
					if ($url[0] == 'resources_id') {
						$this->request->get['resources_id'] = $url[1];
					}	
and

Code: Select all

			} elseif (isset($this->request->get['information_id'])) {
				$this->request->get['route'] = 'information/information';
			} elseif (isset($this->request->get['resources_id'])) {
				$this->request->get['route'] = 'resources/resources';
			}
The only other file I found that seems......

NEVERMIND! I found it.

I found a new file catalog\model\tool\seo_tool.php

There was another place I needed to add my new module there.. Now I'm good to go. They are working perfectly.

User avatar

Posts

Joined
Fri Aug 14, 2009 6:01 am
Location - The Vast Deserts of California

Post by andrewc117 » Sun Sep 20, 2009 6:47 pm

but what do I have to do to make them seo urls?

Newbie

Posts

Joined
Sun Sep 20, 2009 6:23 pm

Post by cowpoke McStink » Sun Sep 20, 2009 10:32 pm

The stuff above only applies to a copy of the information block I was working on (like the directory module in the contributions section, but for 1.3.2). Site wide, SEO URL's are enabled in the admin area, then the .htaccess file needs to be uploaded to your stores root. Finally, whenever you create a new product/category/ page etc. there should be a text box titled keyword.. This is what will end up in your URL.

User avatar

Posts

Joined
Fri Aug 14, 2009 6:01 am
Location - The Vast Deserts of California

Post by Qphoria » Sun Sep 20, 2009 10:44 pm

Yea it is a shame that the SEO stuff is based on hardcoded classes. Meaning any new controller classes will need to (ideally) have its own seo class (always better to make your own than to edit the core file so that it doesn't break on upgrade).

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 15 guests