Welcome Guest, Not a member yet? Register   Sign In
Matchbox Modules Within Standard Set Up
#1

[eluser]Jay Logan[/eluser]
Don't know if that title makes any sense so let me further explain. I have an application that helps me manage 200+ TLD franchise sites. I do stuff like edit pages, layouts, add domains, change location details, etc. All is working well with that. Now I would like to add enhancements to certain sites. I decided to make "modules" available for those sites. The module I'm currently working on is for "Testimonials". I'm using Matchbox for these modules. Right now, any URI strings get checked in a database to determine what view / content to load.

The ideal URL would like something like http://www.website.com/testimonials/home where "home" is replaced with whatever controller is called. This doesn't work because my default controller is programmed to look up the string "testimonials/home" in the database and if found, show the page content or if not found, show 404.

How can I modify my default controller to do a second lookup after it looks for the uri string in my "pages" table. The second lookup would check to see if the first URI segment is in my "modules" table and if found, then Matchbox should start working normally.

Is this even possible? I guess the real question is how can I execute Matchbox controllers from a regular controller. Here is my current default control that all URL's get routed through.

Code:
function index()
    {
        if ($this->site->details['redirect']) {

            $site_details = $this->sites_model->get_info($this->site->details['redirect']);
            redirect($site_details['url'], 'location', 301);

        } else {

            if ($this->site->uri_string()) {
            
                $uri_string = $this->site->uri_string();
                
            } else {
            
                $default_page_contents = $this->sites_model->get_page_contents(array('default_page' => '1', 'group_id' => $this->site->details['group_id']));
                $uri_string = $default_page_contents['uri_string'];
                
            }
    
            $page_contents = $this->sites_model->get_page_contents(array('group_id' => $this->site->details['group_id'],'uri_string' => $uri_string));
            
            if ($page_contents) {
            
                $this->site->group_page_view($page_contents['view_file_name']);
                $this->site->add_hit();
                
            } else {

            
                show_404('page');
                
            }
            
        }
    }




Theme © iAndrew 2016 - Forum software by © MyBB