different database -- best approach?

Permalink
hi all

so, unfortunately a few sections of a site i'm doing (unfortunately) are going to be pulling data from a different database. ideally i would have just created a project page type and it would be done but they want it this way to start.

one section is "projects". where i will have a bunch of project pages using the same template (project.php).

now, would i use a single page? i'm really not sure how to set this up. i found a little article on the database connectivity which shows how to access another database.

thanks guys!

 
Mnkras replied on at Permalink Reply
Mnkras
Yep, you would use a single page for that :)
ScottC replied on at Permalink Reply
ScottC
yeah that is the best way to go about it.

concrete5 doesn't support total wildcard urls without using /-/ or having a matching method/function name in the controller of the singlepage without one-offing and thus extending controller class, so you'll unforunately need to have a url structure like:

mysite.com/work/projects/projectname/

the actual singlepage would need to be "work" page and a method in the controller named projects would need to be present and active.

Alternatively you could look at overriding the reflection method exists stuff that it used the last I had looked at it and seeing if you can do something with __call, but yeah the single page is the best way to handle this as mnkras has mentioned, although I would recommend moving all db access to an included/referenced model instead of putting everything into a singlepage or singlepage controller, although the choice is ultimately up to you.

-Scott

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.