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
{BROWSE:NEXT:Next:1} in just one level
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
{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
-
- Posts: 69
- Joined: Fri 2. Jul 2004, 01:46
- Contact:
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
kind regards
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
kind regards
-
- Posts: 69
- Joined: Fri 2. Jul 2004, 01:46
- Contact: