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

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
cmsler
Posts: 22
Joined: Mon 5. Jul 2004, 17:32

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

Post 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
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Post 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
stevenlyons
Posts: 69
Joined: Fri 2. Jul 2004, 01:46
Contact:

Post 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?
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Post 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
stevenlyons
Posts: 69
Joined: Fri 2. Jul 2004, 01:46
Contact:

Post 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.
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

a 'sticky' button for content parts would be useful here ;)
sticky top/ sticky bottom/ and sticky to ID :)
Post Reply