How to include CMSimple page content in a separate page?
-
- Posts: 4
- Joined: Mon Oct 03, 2016 12:39 am
How to include CMSimple page content in a separate page?
I have a CMsimple site with a hidden page named "Vance M", I want to include the content that I create for that page into a separate non-CMSimple page. I have a separate page named "vance.php" that is in the CMSimple parent directory. It is just a simple page with one table... Basically I want some kind of script that will only pull the content from the "Vance M" CMSimple page and display it on Vance.php.
Last edited by danieljasonpayne on Mon Oct 03, 2016 6:32 pm, edited 1 time in total.
geturl
Code: Select all
#CMSimple $output.=geturl('./userfiles/downloads/vance.php');#
Simple Hosting
Бедная, бросаемая бурею, безутешная!
Бедная, бросаемая бурею, безутешная!
-
- Posts: 4
- Joined: Mon Oct 03, 2016 12:39 am
Re: How to include CMSimple page content in a separate page?
???
I can't get that to work.
I can't get that to work.
Re: How to include CMSimple page content in a separate page?
geturl() can be used to insert another document into a CMSimple page. If I understand you correctly, you're looking for the other way round. Basically, something like the following should do the trick in vance.php:danieljasonpayne wrote:I can't get that to work.
Code: Select all
<?php echo file_get_contents('http://your.cmsimple.installation/?name_of_the_page?print')?>
Christoph M. Becker – Plugins for CMSimple_XH
-
- Posts: 4
- Joined: Mon Oct 03, 2016 12:39 am
Re: How to include CMSimple page content in a separate page?
I can't get that code to work with the CMSimple print page. I created a separate html page with random text, and I could get the php code to pull that text fine, but when I put in the URL of any CMSimple page, it pulls nothing.
Re: How to include CMSimple page content in a separate page?
Assuming that non CMSimple URLs don't work either, most likely allow_url_fopen is disabled. If cURL is available (you can verify all that with phpinfo()), you can do somethink like:danieljasonpayne wrote:[…], but when I put in the URL of any CMSimple page, it pulls nothing.
Code: Select all
<?php curl_exec(curl_init('http://your.cmsimple.installation/?name_of_the_page?print'))?>
Christoph M. Becker – Plugins for CMSimple_XH
Re: How to include CMSimple page content in a separate page?
Try "&print":
[zitat] I created a separate html page with random text, and ...[/zitat]
Use PHP-Page - "*.php"
For the startpage:
Remember, you get only the content ... no styles, no layout ...
Edit:
But just I see, you get full html-code. 2 x <head> ...
Better, you try "iframe".
Edit 2:
If the required page "unpublished" - you get nothing.
Code: Select all
<?php echo file_get_contents('http://your.cmsimple.installation/?name_of_the_page&print')?>
Use PHP-Page - "*.php"
For the startpage:
Code: Select all
<?php echo file_get_contents('http://your.cmsimple.installation/?&print')?>
Edit:
But just I see, you get full html-code. 2 x <head> ...
Better, you try "iframe".
Edit 2:
If the required page "unpublished" - you get nothing.
Re: How to include CMSimple page content in a separate page?
Yes, of course.frase wrote:Try "&print":
Yes, indeed. Some post-processing would be required; I'd probably prefer using the DOM extension for this nowadays, but what geturl() does should also be sufficient.frase wrote:But just I see, you get full html-code. 2 x <head> ...
Perhaps the cleanest solution.frase wrote:Better, you try "iframe".
Christoph M. Becker – Plugins for CMSimple_XH
Re: How to include CMSimple page content in a separate page?
http://foxpro.maxim.zp.ua/userfiles/dow ... nclude.zipfrase wrote:Better, you try "iframe".
Simple Hosting
Бедная, бросаемая бурею, безутешная!
Бедная, бросаемая бурею, безутешная!
-
- Posts: 4
- Joined: Mon Oct 03, 2016 12:39 am
Re: How to include CMSimple page content in a separate page?
That was the issue! Once I figured out how to fix cURL it works like a dream! Thanks for the help!cmb wrote:If cURL is available (you can verify all that with phpinfo()), you can do somethink like:Code: Select all
<?php curl_exec(curl_init('http://your.cmsimple.installation/?name_of_the_page?print'))?>