I have a pre-existing site where have installed CMSMS but I do not really want to re design the entire site around CMSMS. That is really over kill for me. I really only need to be able to use CMS on a few sections (ie blobs) of a page or two. Basically I need certain sections of a page to be easy to edit by non-html savvy folks, but the rest of the site will be a traditional static site.
So I am thinking of a some what back-wards approach to CMS. I was looking for a way to "Pull" content from CMSMS into a non-CMSMS page. For instance, could I use a php include (or something like) from my site's pages that to "pull" a blob (or even a entire page) from my CMSMS
For example: from my site /www/todaysnews.php I would include some blob from /www/cms/currentweather_blob). Then I would make currentweather_blob editable via CMSMS
Is that possible? Can someone show me a code example? Is there a better way?
Pulling page or blob from non-cmsms page
Re: Pulling page or blob from non-cmsms page
I decided to play with this a little bit this evening before bed. Make a file called external.php in your cmsms directory. For the code, put in:
Then in your calling page, do:
Works fine for me. Neat idea.
Code: Select all
<?php
include_once(dirname(__FILE__).'/include.php');
function cms_external_html_blob($blobname)
{
global $gCms;
$smarty =& $gCms->smarty;
return $smarty->fetch('htmlblob:'.$blobname);
}
?>
Code: Select all
include_once('/dir/to/cmsms/external.php');
echo cms_external_html_blob('footer');
-
kenisswell
Re: Pulling page or blob from non-cmsms page
Someone should document this and give it a name. (like "Pull from CMSMS")
*I could not get it to work at all on version 0.10.4. But it does work in V.11.2.
Last edited by kenisswell on Thu Dec 22, 2005 7:36 am, edited 1 time in total.
-
mark
Re: Pulling page or blob from non-cmsms page
would it be possible to grab the whole template?
thanks
thanks
Re: Pulling page or blob from non-cmsms page
Well, the issue is that it's going to grab the template, but smarty will then process it into a resulting page. Is this what you want? Or you want the template with the smarty tags ({content}, etc) still in it?
-
mark
Re: Pulling page or blob from non-cmsms page
how about if we can extract the whole template and place it on a variable 
Re: Pulling page or blob from non-cmsms page
Code: Select all
include_once(dirname(__FILE__).'/include.php');
$thetemplate =& TemplateOperations::LoadTempateById($id);
$templatetext = $thetemplate->content;

