rejetto forum

if urlval then show something and die else show page

Guest · 5 · 4306

0 Members and 1 Guest are viewing this topic.

JellyFrog

  • Guest
Hello
Is it possible to do something like this:

{.if| {.?query.} | do something then STOP PAGE /if.}

If I add .disconnect it aint showing something at all...

The problem is if I run:
{.if| {.?query.} | do something | REST OF PAGE /if.}

The rest of page will break the if? How should I do?


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13521
    • View Profile
the right way is the second one.
i don't understand what you meant by "break the if".
my advice is to put the "rest" in a section, and include it by {.$rest of the page.}


JellyFrog

  • Guest
the right way is the second one.
i don't understand what you meant by "break the if".
my advice is to put the "rest" in a section, and include it by {.$rest of the page.}
Well I want to put this at the top of the page so if I request the page:
http : // adress/?query
then it shows one page
else it shows the normal page.

"break the if" well if i put like .. 260 lines of code after the "|" I guess it wont work?
can a section contain other sections? If so your solution should work.

Easiest way would be if it was possible to stop the page after it has load something, like in PHP: die();
for example:
{.if| {.?query.} | print something {.die.} /if.}
(disconnect kills the page before it print something)


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13521
    • View Profile
> 260 lines of code after the "|" I guess it wont work?

it will if you use this syntax
{.if| {.?query.} | something | {:
all you want
:}.}

> can a section contain other sections?

this way

{.$sec1.}

[sec1]
{.$sec2.}

[sec2]
hi!


Offline JellyFrog

  • Occasional poster
  • *
    • Posts: 39
    • View Profile
Yes it works fine like that... For example:

{.if|{.?xml.}| {.$xmlpage.} | {.$stdpage.} /if.}

[xmlpage]
Special page, works with %list% and everything


[stdpage]
Normal page, works with %list% and everything