8 posts by 5 authors in: Forums > Off Topic / Other
Last Post: October 8, 2002   (RSS)

By Dave - October 6, 2002

Would anyone like to see template logic? eg:

<!--[ if nextpage > 0 ]-->
<a href="...">next</a>
<!--[ else ]-->
<font color="gray">next</font>
<!--[ end if ]-->

If we were to add something like this it would give a lot more control to template developers, and we'd have a lot less templatecells. But, it might make things a little more complicated.

What does everyone thing? Have you seen any template logic/code systems you really liked?

Please note, even if we do decide to go with something like this, it won't likely be in the first release of Article Manager 2.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Template Logic, good or bad?

This sounds extremely interesting Dave.

What other stuff can we do with this? can you give us more examples on what we can control?
--------------
Sure you can spell it, but do you get it?

Re: [MalaK_3araby] Template Logic, good or bad?

By Dave - October 7, 2002

>What other stuff can we do with this? can you give us more examples on what we can control?

Well you'd have basic programming logic. So you'd have if, else if, else, math operators, etc.

So, all those times in the forum when people ask about displaying an image or some content in one situation, but not another, they'd be able to put some tags around it like this:

<[ if situation1 ]>
Show this html
<[ end if ]>

<[ if situation2 ]>
Show this other html
<[ end if ]>

One example might be if we supported multiple page articles in the future and you wanted to publish some content only on the last page. If their was a placeholder for total_pages and current_page you could say

<[ if current_page == total_pages ]>
display this content here
<[end if]>

Which would mean you on the last page in the set.

Does that make any sense? : )
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Template Logic, good or bad?

Yes Dave ... it makes good sense.

So we will be able to run conditions using existing variables .. this is GREAT and it feels like developing our own language.

Dave.. while you are at it .. i might have a good idea for this:
How about enabling us to define our own variables from the admin interface?
Say i set a variable $var_1$ and i set the value to something like: <javascript etc... >
or $var_2$ and value is http://www.domain.com/exec/search.cgi?perpage=8&..
then i can use those variables in our if .. else statment?!

i hope i am making sense .. the idea just came to me and i jotted the thought down.

Offtopic
P.S: I am sure that alot of ppl out there fell in love with AM because its so easy to use and maintain, so it might be wise for V2.0 to stay simple enough for ppl to use right away yet still have all the Advanced Setting for power users[/#0000ff].
--------------
Sure you can spell it, but do you get it?

Re: [MalaK_3araby] Template Logic, good or bad?

By Dave - October 7, 2002

>How about enabling us to define our own variables from the admin interface?

We want to add something like that to 2.0, where users can defined "global placeholders" that are available everywhere. So you can change the site title, copyright footer, etc, in one place and just hit republish.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Template Logic, good or bad?

By Teambldr - October 7, 2002 - edited: October 7, 2002

Hi Dave,



IF statements are A LOT of fun.

For example, if your have registered and unregistered users you can show items to the registered users that unregistered can't see and vice versa.

If unregistered: Show this
If registered: Show this
If Editor: Show this
etc...

So count me in on IF's![cool]
Brian

Re: [Dave] Template Logic, good or bad?

By Zyllyx - October 8, 2002


>How about enabling us to define our own variables from the admin interface?

We want to add something like that to 2.0, where users can defined "global placeholders" that are available everywhere. So you can change the site title, copyright footer, etc, in one place and just hit republish.

I would love you guys forever if you implemented this... [;)]