Page 1 of 1

{BROWSE:NEXT:Next:1} in just one level

Posted: Tue 20. Jul 2004, 14:36
by cmsler
Hi there,

I would like to use the {BROWSE:NEXT:vor:1} or {BROWSE:PREV:zurück:1} for all the articles inside just one level. So that "PREV" stops at the first article of the level and the "NEXT" stops at the last article of the level. Is that possible?

Thanks for answers, cmsler

Posted: Tue 20. Jul 2004, 16:55
by pepe
Hallo,


{BROWSE:NEXT:vor:1} or {BROWSE:PREV:zurück:1}

Change the 1 to a 0 in the first and the last article of the level.


Have a look on my site for an example of the last page of a level:

http://cms.peperkorn-online.de/index.ph ... 63,0,0,1,0

Posted: Sun 25. Jul 2004, 00:56
by stevenlyons
Can you explain this in more detail? I placed my {BROWSE} code in a template. Should I be placing it in the article?

Posted: Sun 25. Jul 2004, 13:49
by pepe
Hi stevenlyons,

in my example i've put the code into a separat content-part at the bottom of each article.

{BROWSE:PREV:previous book:x} | {BROWSE:NEXT:next book:y}

In the first article i set x = 0 and y = 1 , to set the previous-limit here
In the last article i set x = 1 and y = 0 , to set the next-limit here
In all other cases i set x = 1 and y = 1 , previous and next is allowed

OK, i know: thats not the perfect solution.
If i ADD a new article, which is set at the top of the list by phpwcms, i must change the sequence "by hand", so that my "old 1. article" becomes the FIRST again.

That's only a workaround, but i am an absolute newbee in PHP and have no better solution. The php-freaks inside this forum, will have a better one, i'm shure.

-------

A few minutes ago, i'v made a little tryout, to spare the contentparts with the code in each article.
I have put the following code into my template:

----------------------------------------------------------------------------------
<div>{BROWSE:PREV:backward:{PHP:script/backward_check.php}} | {BROWSE:NEXT:forward:{PHP:script/forward_check.php}}</div>
----------------------------------------------------------------------------------

Inside the two scripts i have a code simmilar to:

----------------------------------------------------------------------------------
<?php
//* xxx = structure-ID | string between '...' = exchange for {PHP:script/backward_check.php} |
//* example: case xx: echo '0'; break; <= if you want to disable the action
//* example: case xx: echo '1'; break; <= if you want to enable the action

switch($GLOBALS['content']['cat_id']) {
case 11: echo '0'; break;
case 17: echo '0'; break;
default: echo '1';
}
?>
----------------------------------------------------------------------------------

It works verry well on my localhost, but the change by hand of the 1. article, wenn adding a new, remains :cry:


kind regards

Posted: Sun 25. Jul 2004, 18:46
by stevenlyons
Thanks, pepe. I will try your solution.


My other problem is how to get Javascript rollovers to work inside the {BROWSE} tag. Still working on that one.

Posted: Mon 26. Jul 2004, 09:44
by pSouper
a 'sticky' button for content parts would be useful here ;)
sticky top/ sticky bottom/ and sticky to ID :)