Export Menu

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
dawgdaz

Export Menu

Post 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.
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Export Menu

Post 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.
dawgdaz

Re: Export Menu

Post by dawgdaz »

How do I link to the template, it's stored in the db, I think?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Export Menu

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
dawgdaz

Re: Export Menu

Post 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.
miramardesign

Re: Export Menu

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Export Menu

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “Tips and Tricks”