Hi everyone,
I have a custom 404 page which I load into content-page with geturl.
Would it be possible to have/include in the content-file or at the bottom of the -404.php- page the sitemap-page and not only a sitemap-link ?
(now I have
<h1>404</h1>
#CMSimple hide# #CMSimple $output.=geturl('http://mysite.com/404.php?&print').sitemaplink().searchbox();#
)
Thank you in advance for your answer and help.
include sitemap
-
- Posts: 28
- Joined: Sat Jul 07, 2012 6:16 pm
- Location: Budapest, Hungary
Re: include sitemap
Have a look at how the sitemap is build in cms.php:128ff (CMSimple 3.4):
Basically, you'd have to construct $ta and pass it to li(). This might best be done in a user defined function:
Code: Select all
if ($f == 'sitemap') {
$title = $tx['title'][$f];
$ta = array();
$o .= '<h1>'.$title.'</h1>';
for($i = 0; $i < $cl; $i++)if(!hide($i))$ta[] = $i;
$o .= li($ta, 'sitemaplevel');
}
Code: Select all
function showSitemap()
{
global $cl, $h;
$ta = array();
for($i = 0; $i < $cl; $i++)if(!hide($i))$ta[] = $i;
return li($ta, 'sitemaplevel');
}
Christoph M. Becker – Plugins for CMSimple_XH
-
- Posts: 28
- Joined: Sat Jul 07, 2012 6:16 pm
- Location: Budapest, Hungary
Re: include sitemap
THANK YOU, WORK PERFECTLY !
I copied your script/function (showSitemap) in the cms.php and I put in the content-file at the <h1>404</h1> the following ".showSitemap()", and is working excellent!
Thank you Christoph for the clear, understandable and quick answer and working solution!
p.s.
would it be possible to appear also the -sitemap- heading (<h1>Sitemap</h1>) above sitemap?
Thank you,
Alex
I copied your script/function (showSitemap) in the cms.php and I put in the content-file at the <h1>404</h1> the following ".showSitemap()", and is working excellent!
Thank you Christoph for the clear, understandable and quick answer and working solution!
p.s.
would it be possible to appear also the -sitemap- heading (<h1>Sitemap</h1>) above sitemap?
Thank you,
Alex
Re: include sitemap
Yes. Just use the following function:stargazer96 wrote:would it be possible to appear also the -sitemap- heading (<h1>Sitemap</h1>) above sitemap?
Code: Select all
function showSitemap()
{
global $cl, $h, $tx;
$ta = array();
for($i = 0; $i < $cl; $i++)if(!hide($i))$ta[] = $i;
return '<h1>' . $tx['title']['sitemap'] . '</h1>' . li($ta, 'sitemaplevel');
}
Christoph M. Becker – Plugins for CMSimple_XH
-
- Posts: 28
- Joined: Sat Jul 07, 2012 6:16 pm
- Location: Budapest, Hungary
Re: include sitemap
EXCELLENT! Just working PERFECTLY !
(I used <h2> as you recommend it).
Thank you very much, I wish you a nice weekend!
(I used <h2> as you recommend it).
Thank you very much, I wish you a nice weekend!