Welcome Guest, Not a member yet? Register   Sign In
Best Practice Regarding Controllers / Site Structure
#4

[eluser]JamesTaylor[/eluser]
In this instance the site doesn't actually use any methods, i was planning on the use of a database so i could have a go at implementing that side of things with CodeIgniter but it ended up the client didn't want to display enough info for it to be worth while. I have a couple of other things in the pipeline that will allow me to play on that front...

...Udi your post has just come as i am replying to Jedd's post - are you suggesting i place all the content of each page, even if it is static, into a database?

What i have done in respect to my controller called structure which has everything incorporated into it for the entire site is set out below.

Code:
class Structure extends Controller {

//Home Page
    function index(){
    $data['main_content'] = 'home';
    $data['title'] = 'Welcome to RDBarrett - New & Used Engineers Tooling';
    $data['h1'] = 'Welcome to RDBarrett - New & Used Tooling';
    $data['h2'] = 'Welcome to RDBarrett';
    $data['BodyID'] = 'HomePage';
    $data['ToolingID'] = 'ViewRangeLinks';
    $this->load->view('template', $data);
    }

//About Us    
    function about_us(){
    $data['main_content'] = 'about_us';
    $data['title'] = 'About RDBarrett - New & Used Engineers Tooling';
    $data['h1'] = 'About RDBarrett - New & Used Tooling';
    $data['h2'] = 'About RDBarrett';
    $data['BodyID'] = 'AboutUsPage';
    $data['ToolingID'] = 'ViewRangeLinks';
    $this->load->view('template', $data);
    }
    
//New Tooling
    function new_tooling(){
    $this->indexable_tooling();
    }

//Indexable Tooling
    function indexable_tooling(){
    $data['main_content'] = 'indexable_tooling';
    $data['title'] = 'Indexable Tooling - RDBarrett';
    $data['h1'] = 'Indexable Tooling Suppliers';
    $data['h2'] = 'Indexable Tooling';
    $data['BodyID'] = 'NewToolingPage';
    $data['ToolingID'] = 'IndexableTools';
    $this->load->view('template', $data);
    }
    
//Milling and Drilling
    function milling_drilling(){
    $data['main_content'] = 'milling_drilling';
    $data['title'] = 'Milling & Drilling Tools - RDBarrett';
    $data['h1'] = 'Milling & Drilling Suppliers';
    $data['h2'] = 'Milling & Drilling Tools';
    $data['BodyID'] = 'NewToolingPage';
    $data['ToolingID'] = 'MillingTools';
    $this->load->view('template', $data);
    }
    
//Work Holding
    function work_holding(){
    $data['main_content'] = 'work_holding';
    $data['title'] = 'Work Holding Tools - RDBarrett';
    $data['h1'] = 'Suppliers of Work Holding Tools';
    $data['h2'] = 'Work Holding Tools';
    $data['BodyID'] = 'NewToolingPage';
    $data['ToolingID'] = 'HoldingTools';
    $this->load->view('template', $data);
    }
    
//Spindle Tooling
    function spindle_tooling(){
    $data['main_content'] = 'spindle_tooling';
    $data['title'] = 'Spindle Tooling - RDBarrett';
    $data['h1'] = 'Spindle Tool Suppliers';
    $data['h2'] = 'Spindle Tools';
    $data['BodyID'] = 'NewToolingPage';
    $data['ToolingID'] = 'SpindleTools';
    $this->load->view('template', $data);
    }
    
//Threading Tools
    function threading_tools(){
    $data['main_content'] = 'threading_tools';
    $data['title'] = 'Threading Tools - RDBarrett';
    $data['h1'] = 'Suppliers of Threading Tools';
    $data['h2'] = 'Threading Tools';
    $data['BodyID'] = 'NewToolingPage';
    $data['ToolingID'] = 'ThreadingTools';
    $this->load->view('template', $data);
    }
    
//Inspection Tools
    function inspection_metrology(){
    $data['main_content'] = 'inspection_metrology';
    $data['title'] = 'Inspection & Metrology Tools - RDBarrett';
    $data['h1'] = 'Suppliers of Inspection & Metrology Tools';
    $data['h2'] = 'Inspection & Metrology Tools';
    $data['BodyID'] = 'NewToolingPage';
    $data['ToolingID'] = 'InspectionTools';
    $this->load->view('template', $data);
    }
    
//Used Tooling
    function used_tooling(){
    $data['main_content'] = 'used_tooling';
    $data['title'] = 'Used Tooling & Machines - RDBarrett';
    $data['h1'] = 'Suppliers of Used Tools & Machinery';
    $data['h2'] = 'Used Tooling & Machines;';
    $data['BodyID'] = 'UsedToolingPage';
    $this->load->view('template', $data);
    }
    
//Offers
    function offers(){
    $data['main_content'] = 'offers';
    $data['title'] = 'Tooling & Machine Offers - RDBarrett';
    $data['h1'] = 'Engineers Tooling & Machinery Offers';
    $data['h2'] = 'Tooling & Machines Offers;';
    $data['BodyID'] = 'OffersPage';
    $data['ToolingID'] = 'ViewRangeLinks';
    $this->load->view('template', $data);
    }

Part of my reason for asking is with one eye on the end urls that are displayed in the address bar (for SEO purposes as well) - i'm looking into htaccess files and mod rewrite but again its something i'm not familiar with at the moment.

All url currently show:

/RDBarrett/index.php/structure/...

i have implemented a simple htaccess file with code copied from another post on here to make it

/RDBarrett/structure/...

but i still want to get rid of the '/structure' part as it isn't friendly! If i had a controller for each main section it would create good urls (easily with current htaccess file) for users and SEO such as:

/RDBarrett/About_Us
/RDBarrett/New_Tooling
/RDBarrett/New_Tooling/Milling_Drilling - the Sub pages of New Tooling could be incorporated into that controller.

I appreciate i am asking about two issues that can be dealt with separately but at the moment i am seeing them as being inter-twined! as a noob i'm just trying to get my thoughts together


Messages In This Thread
Best Practice Regarding Controllers / Site Structure - by El Forum - 10-24-2009, 10:12 AM
Best Practice Regarding Controllers / Site Structure - by El Forum - 10-24-2009, 11:07 AM
Best Practice Regarding Controllers / Site Structure - by El Forum - 10-24-2009, 11:15 AM
Best Practice Regarding Controllers / Site Structure - by El Forum - 10-24-2009, 11:50 AM
Best Practice Regarding Controllers / Site Structure - by El Forum - 10-24-2009, 05:05 PM
Best Practice Regarding Controllers / Site Structure - by El Forum - 10-25-2009, 01:41 AM
Best Practice Regarding Controllers / Site Structure - by El Forum - 10-29-2009, 04:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB