Announcement

Collapse
No announcement yet.

What's the real deal on "pos1?"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    What's the real deal on "pos1?"

    Hi folks,

    One of my clients just asked me to look into a shipping problem, and it turned out to be caused by the fact that the "pos1" variable in one of the page templates didn't contain the expected value. I've seen some documentation on pos1, but I'm not clear on what it really is. Is it a local variable (l.pos1), or is it a member of l.settings? The doc says that "POS1 can only be tested for in 'if' statements. It cannot be output to the screen." If that;s true, it suggests that pos1 isn't a real variable at all; it's more of a reserved symbol that can only be used in mvt:if elements. In that case, I suppose it would be completely separate from any normal variable that's also named "pos1." Is that correct?

    Thanks --
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    #2
    pos1 is a local variable available within each for each loop.

    http://docs.miva.com/template-language/pos1-counter

    http://docs.miva.com/videos/post-loop-counter

    The reason it can't be output to the screen is because it is not part of the l.settings structure (or a global variable)
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      If it's a local variable, I think you can display it with:
      Code:
      <mvt:eval expr="l.pos1" />
      Kent Multer
      Magic Metal Productions
      http://TheMagicM.com
      * Web developer/designer
      * E-commerce and Miva
      * Author, The Official Miva Web Scripting Book -- available on-line:
      http://www.amazon.com/exec/obidos/IS...icmetalproducA

      Comment

      Working...
      X