[Phplib-users] Template: How to handle conditional html?
Brought to you by:
nhruby,
richardarcher
|
From: Peter H. <PH...@gm...> - 2001-11-24 16:36:57
|
Hi,
maybe some of you came across this problem also:=20
there are somtimes elements of a site, that should be shown only under
certain circumstances, e.g. you have a browsing page with "previous" and
"next" buttons but you don=B4t wnat the 'previous" button to be shown if
there is nothing before the actual shown item, vice versa you want to
hide the "next"-button, if there is nothing next to show. Maybe you have
different pictures for this situation and maybe, to make it even more
complicated, someone wants you to have a rollover only on the "active"
next/previuos buttons.
OK, this would be easy usually with some if-statements in the code, but
when using templates, this breaks the sense of them somehow. If you use
something like {NEXT} in your template-file which contains the whole
html for that link ('a href' and img), there is nothing to see in the
template anymore (if someone is generating it with an graphic al tool).
Otherwise it is not good to use some php-code in the template-file, so I
tend to the first solution, what makes some more work...
Does anybody have any other ideas about that?
Thanks for your attention,
Peter
Have a nice thread,
Peter
|