Can I include global content blocks from CMSMS into pages not made by CMSMS?

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
minneapolis_dan
Forum Members
Forum Members
Posts: 36
Joined: Tue Jun 19, 2007 10:20 pm

Can I include global content blocks from CMSMS into pages not made by CMSMS?

Post by minneapolis_dan »

I have a few pages for my site that I'd like to keep outside of the CMS Made Simple 'system' but I'd like them to use the same template system, styles, and navigation as all the pages in CMS Made Simple.

I can use a PHP include, but since things like the navigation aren't static files, I'm not sure how to call them. If I can.
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm

Re: Can I include global content blocks from CMSMS into pages not made by CMSMS?

Post by Russ »

You could add them to your CMSMS system but not show them on your menus? This way you can still get to them if you know the url - of course a lot easier with friendly urls. You could then just book mark them in your browser. If you don't want them to be searched then add the 'no search' thing in the html. You will need to check if they appear in sitemap though - i can't remember if they do but it would be easy to fix.

Hope this helps,
Russ
minneapolis_dan
Forum Members
Forum Members
Posts: 36
Joined: Tue Jun 19, 2007 10:20 pm

Re: Can I include global content blocks from CMSMS into pages not made by CMSMS?

Post by minneapolis_dan »

I know how to add pages that don't show in the menu, but that's not what I'm asking. I want to know is an easy way to 'include' (using PHP) some elements created stored within CMSMS (such as a page template and CSS) in some PHP pages I built outside the system. I'll play around with some MySQL queries and see if I can do it. I thought maybe some one had done so before and could feed me the code. I can copy the template and CSS code, that's no problem, but I'd rather it be stored in one place, with just one copy.
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm

Re: Can I include global content blocks from CMSMS into pages not made by CMSMS?

Post by Russ »

You mean something like?
require_once("/pathto/cmsms/include.php");
global $gCms;

Russ
minneapolis_dan
Forum Members
Forum Members
Posts: 36
Joined: Tue Jun 19, 2007 10:20 pm

Re: Can I include global content blocks from CMSMS into pages not made by CMSMS?

Post by minneapolis_dan »

Thanks, yes, something like that. Wondering what it would be to include a template? If it were a file named "template-default.php" or "header.php" I would know how to do it. But I'm not sure how to handle a template inside CMSMS.
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm

Re: Can I include global content blocks from CMSMS into pages not made by CMSMS?

Post by Russ »

I'm not sure, never having done it but a good place too look would be

http://wiki.cmsmadesimple.org/index.php/User_Handbook/Developers_Guide

Especially the api which of course has specific classes for Templates and TemplateOperations ;-)

Russ
Post Reply

Return to “The Lounge”