toc

General questions about CMSimple
ustalo
Posts: 139
Joined: Mon Aug 16, 2010 7:42 am
Location: Russia
Contact:

toc

Post by ustalo » Sun Aug 09, 2020 9:15 am

{{toc(????)}}

Masters
haw to add toc with all open sub levels as sitemap
http://daiart.ru/?&sitemap

sorry for stupid question
Aleksei

lck
Posts: 2466
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: toc

Post by lck » Sun Aug 09, 2020 11:00 am

ustalo wrote:
Sun Aug 09, 2020 9:15 am
haw to add toc with all open sub levels as sitemap
See viewtopic.php?f=16&t=13988
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

Tata
Posts: 3438
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: toc

Post by Tata » Sun Aug 09, 2020 11:04 am

Quick idea (not tested):
1. Create a single hidden page (e.g. :sitemap-page)with

Code: Select all

{{{li($hc,'sitemaplevel')}}}
and use in your template:

Code: Select all

		<div class="navigation">	
			<?php echo newsbox('sitemap-page');?>
		</div>		
Then set your styling for

Code: Select all

/* navigation numbering */
.navigation ul { counter-reset: item; list-style: none; margin-left: 0; }
.navigation > ul li { display: block;}
.navigation li:before { content: counters(item, ".") " "; counter-increment: item; color: #fff; padding-right:1rem;}

ul.sitemaplevel1 li{font-size: 1rem; color: white;}
ul.sitemaplevel1 li span:after{content: "\25ba"; float: right;}
ul.sitemaplevel1 li a{color: orange;}
ul.sitemaplevel1 li a:hover{color: #fff;}

ul.sitemaplevel1 li:hover{background: #000; color:#fff;}
ul.sitemaplevel1 li ul li:hover{background: #444; color:#fff;}
ul.sitemaplevel1 li ul li ul li:hover{background: #666; color:#fff;}
In this very case the items are numbered automatically. So you may remove/restyle the "counters".
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

ustalo
Posts: 139
Joined: Mon Aug 16, 2010 7:42 am
Location: Russia
Contact:

Re: toc

Post by ustalo » Sun Aug 09, 2020 1:04 pm

Also I need not full sitemap, but from some point menu and inside.
Aleksei

Tata
Posts: 3438
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: toc

Post by Tata » Sun Aug 09, 2020 3:22 pm

It is also possible. But it has only very little in common with an automatically generated "TOC" and it is also too complicated, though. Further editing and adjusting of a website would require often adjustments in the template. It is then easier create a subpage with a manually written list of pages and call this page separately in a newsbox.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

lck
Posts: 2466
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: toc

Post by lck » Sun Aug 09, 2020 4:58 pm

ustalo wrote:
Sun Aug 09, 2020 1:04 pm
Also I need not full sitemap, but from some point menu and inside.
I suppose this is not what you are looking for either, but I don't know any other solution now.
Paste on the page in the source code view.

Code: Select all

{{{submenu();}}}
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

ustalo
Posts: 139
Joined: Mon Aug 16, 2010 7:42 am
Location: Russia
Contact:

Re: toc

Post by ustalo » Mon Aug 10, 2020 4:37 am

it works like {{{toc(2,9)}}}
all levels collapsed
I need open
Aleksei

ustalo
Posts: 139
Joined: Mon Aug 16, 2010 7:42 am
Location: Russia
Contact:

Re: toc

Post by ustalo » Fri Aug 14, 2020 5:19 am

is it possible to use {{{toc(2,9)}}}
with all menu post open not collapsed?
Aleksei

Tata
Posts: 3438
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: toc

Post by Tata » Fri Aug 14, 2020 7:48 am

Resume:
1. The function toc() generates the TOC automatically.
2. The function sitemap() generates the sitemap automatically.
3. To use the sitemap feature only for some specific part of TOC requires:
a) rewite the toc() and/or sitemap() functions
b) redesign the respective CSS classes
Anyway, because of touching the automatically generated values, it requires checking/rewriting/redesigning everything after any deeper changes in the webpage content.
It seems to me the simplest:
1. exclude the toc and sitemap functions from the template completely.
2. Write the hidden "TOC" page manually as desired - with all levels and create links to all respective subpages targetting to the "content".
3. Place this "TOC" page into a newsbox (as TOC replacement).
This solution requires permanently checking/adjusting of the "TOC" page, however.
Partially is also possible to use the toc() function with hidden lover levels and use the submenu() function only on desired pages. In this case the content of the subpages will only be visible on the page with the submenu() function on it.
One more possibility is to use the "TOC" in two columns with the submenu() in the 2nd column. But, again, the submenu only comes on if there are any subpages available for the item clicked in the 1st column.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

lck
Posts: 2466
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: toc

Post by lck » Fri Aug 14, 2020 12:12 pm

ustalo wrote:
Fri Aug 14, 2020 5:19 am
is it possible to use {{{toc(2,9)}}}
with all menu post open not collapsed?
No unfortunately not, the code would first have to be adapted accordingly, by our programmers (@Christoph, @Holger, @Olaf, @Manu), Keyword MyLi.

An alternative would be:
In a page add.

Code: Select all

<div class="lck-sitemap">{{{li($hc, 'sitemaplevel');}}}</div>
stylesheet.css add to end
.lck-sitemap .sitemaplevel1 > li > a:first-of-type {
display: none;
}
This hides all menulevel 1 and shows only level 2 to 9, but all of the website.
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

Post Reply