How to output all pages in one long page?
How to output all pages in one long page?
I have been searching high and low without luck - but I'm sure I have read somewhere that it is (or maybe has been) possible to output all pages in a site in one single long page with all headings and formatting - using just a single function or script command. Am I wrong?
Re: How to output all pages in one long page?
Thanks.
But that require a new template. I need a way to display a present site with lots of submenus as a single long page on user request to print out the whole site.
I'm positive that I remember something about an internal function of CMSimple like #CMSimple $output.= something...#
But that require a new template. I need a way to display a present site with lots of submenus as a single long page on user request to print out the whole site.
I'm positive that I remember something about an internal function of CMSimple like #CMSimple $output.= something...#
Re: How to output all pages in one long page?
Hello,
An example can be found on the following page: http://cmsimplexh.webdesign-keil.de/?Fa ... _erstellen => "Kapitel mit Unterseiten als PDF speichern"
Best regards
Hartmut
maybe the plugin "simplePDF" (http://cmsimplexh.webdesign-keil.de/?CM ... s/Vorschau) is a good solution?Korvell wrote:Thanks.
But that require a new template. I need a way to display a present site with lots of submenus as a single long page on user request to print out the whole site.
I'm positive that I remember something about an internal function of CMSimple like #CMSimple $output.= something...#
An example can be found on the following page: http://cmsimplexh.webdesign-keil.de/?Fa ... _erstellen => "Kapitel mit Unterseiten als PDF speichern"
Best regards
Hartmut
Re: How to output all pages in one long page?
That would cover my needs I think. Unfortunately there's no download for it on Holgers site anymore...
Re: How to output all pages in one long page?
In the old CMSimple this display the content.
/ZiPs
Code: Select all
#CMSimple $output.=rf($pth['file']['content']);#
Preben Dahl | Webmaster cmsimple.dk | Projekt-og domæne ejer Gert Ebersbach
Re: How to output all pages in one long page?
Thanks - looks somewhat like what I remember although not completely - I remember it a tad bit shorter. But it works - almost - it just puts out some of the extra hidden content from each page:
Guess I'll just have to omit this feature on my site until further notice.
Code: Select all
'Forside', 'last_edit'=>'1502268549', 'description'=>'', 'keywords'=>'', 'title'=>'', 'robots'=>'', 'heading'=>'', 'show_heading'=>'1', 'template'=>'0', 'published'=>'1', 'show_last_edit'=>'0', 'linked_to_menu'=>'1', 'header_location'=>'', 'use_header_location'=>'0', 'publication_date'=>'', 'expires'=>'' ); ?>
Re: How to output all pages in one long page?
AFAIK, this never has been possible. ZIPs' suggestion above would output the whole contents, but without evaluating CMSimple scripting and plugin calls. Something similar is easily possible with current CMSimple_XH versions, but that is most likely not what you're looking for.Korvell wrote:but I'm sure I have read somewhere that it is (or maybe has been) possible to output all pages in a site in one single long page with all headings and formatting - using just a single function or script command.
http://3-magi.net/demo/infinite/ also is probably not what you're looking for, even though it is possible to scroll to bottom, and to print out the complete website in one go.
The plugin has not been published, unfortunately.Korvell wrote:That would cover my needs I think. Unfortunately there's no download for it on Holgers site anymore...
It seems to me that you're looking for an "expanded" submenu(), which shows all subpages (and subpages of the subpages), but only if the print preview is requested. If so, you can put the following in cmsimple/userfuncs.php:Korvell wrote:I need a way to display a present site with lots of submenus as a single long page on user request to print out the whole site.
Code: Select all
<?php
class ExpandedSubmenu
{
private $pages;
public function __construct()
{
$this->pages = new XH\Pages;
}
public function render()
{
global $print, $s;
$html = '';
$old_s = $s;
foreach ($this->pages->children($s) as $page) {
$html .= $this->renderPage($page);
}
$s = $old_s;
return $html;
}
private function renderPage($index)
{
global $c, $s;
$s = $index;
$html = XH_convertPrintUrls(evaluate_scripting($c[$index]));
foreach ($this->pages->children($index) as $page) {
$html .= $this->renderPage($page);
}
return $html;
}
}
function submenu_print()
{
return (new ExpandedSubmenu)->render();
}
Code: Select all
$content, submenu_print(), $bjs, '</body>', "\n", '</html>', "\n";
Christoph M. Becker – Plugins for CMSimple_XH
Re: How to output all pages in one long page?
Thanks Christoph.
Looking back in my files archive of the old original CMSimple from the days of Peter Harteg I found the code I thought I remembered - and it is the same, that ZIP posted
That 'infinite' feature is quite nice - it could work well for my site I think.
As for the code snippet I'm not sure where to change the second part. My site runs version 1.6.9...
This is the site I'm working on: sk.egmont-hs.dk/
Looking back in my files archive of the old original CMSimple from the days of Peter Harteg I found the code I thought I remembered - and it is the same, that ZIP posted
That 'infinite' feature is quite nice - it could work well for my site I think.
As for the code snippet I'm not sure where to change the second part. My site runs version 1.6.9...
This is the site I'm working on: sk.egmont-hs.dk/
Re: How to output all pages in one long page?
The demo is pretty old, and I'm not sure about the code – I'll check it out ASAP.Korvell wrote:That 'infinite' feature is quite nice - it could work well for my site I think.
Then you have to replace this line with:Korvell wrote:As for the code snippet I'm not sure where to change the second part. My site runs version 1.6.9...
Code: Select all
$content, submenu_print(), '</body>', "\n", '</html>', "\n";
Code: Select all
<?php
class ExpandedSubmenu
{
private $pages;
public function __construct()
{
$this->pages = new XH_Pages;
}
public function render()
{
global $print, $s;
$html = '';
$old_s = $s;
foreach ($this->pages->children($s) as $page) {
$html .= $this->renderPage($page);
}
$s = $old_s;
return $html;
}
private function renderPage($index)
{
global $c, $s;
$s = $index;
$html = XH_convertPrintUrls(evaluate_scripting($c[$index]));
foreach ($this->pages->children($index) as $page) {
$html .= $this->renderPage($page);
}
return $html;
}
}
function submenu_print()
{
return (new ExpandedSubmenu)->render();
}
Christoph M. Becker – Plugins for CMSimple_XH