Page 1 of 1
Export Menu
Posted: Fri May 25, 2007 3:36 am
by dawgdaz
Is there a way that I can export the menu from CMS to another application? The desired effect is that when the admin updates the menu it will update the same menu on the forum page.
I tried to build a page in CMSMS and strip everything but the menu and then include that into a php file. No luck. I think this is due to the fact that it's not an actual page but rather content generated from the db.
Would be an awesome feature should someone figure this out. Thanks.
Re: Export Menu
Posted: Fri May 25, 2007 9:22 am
by tsw
you could create a template (which is not used anywhere else) and then link to it by iframe or write small php script to get the content from cmsms and then echo it out.
Re: Export Menu
Posted: Fri May 25, 2007 3:47 pm
by dawgdaz
How do I link to the template, it's stored in the db, I think?
Re: Export Menu
Posted: Fri May 25, 2007 4:02 pm
by calguy1000
You would have to use curl, or file_open or something on a CMS url that just extracted the menu. there's a moduleinterface call that you may be able to do...
or:
Create a stripped down template with only {menu} and {content} in it (maybe {stylesheet}) too.
Create a page (not shown in menu) that uses that template
in your external php script issue a curl request to get the specific page into a variable, and then echo it.
or:
in your new php script, use smarty, create a smarty instance, and do a fetch on either of the above url's.
Re: Export Menu
Posted: Fri May 25, 2007 4:25 pm
by dawgdaz
I tried it as an iframe and include, neither would work. Has anyone tried this and I got to work??
I will take a shot at it with cURL later, I need to read up on it since I've never used it.
Re: Export Menu
Posted: Sat Jun 30, 2007 3:53 am
by miramardesign
Although I'm no uber-expert on cURL either, I've found it's use rather simple. It basically imports the output of any page anywhere using a multitude of protocols. Cool huh? And the kicker is that it then can use that content as native unlike an iframe which is unfriendly so SE's curl puts the 'borrowed' content right there in the page.
from the php manual (not mine)
miramardesign
http://miramardesign.com
I code therefore I am.
Re: Export Menu
Posted: Sat Jun 30, 2007 11:49 pm
by calguy1000
using a url like found in this thread:
http://forum.cmsmadesimple.org/index.php/topic,12634.0.html
You can do it with an xmlhttp request.