Announcement

Collapse
No announcement yet.

SMT code inside Miva Script

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

    SMT code inside Miva Script

    Hi,

    i am working on small miva program and i need to to execute code like <mvt:foreach iterator="item" array="basket:items"> </mvt:foreach> inside miva script is there any way i can execute SMT tags inside miva script so that it will execute value on screen.

    #2
    Miva Script functions can output values directly to the screen based on the attribute STANDARDOUTPUTLEVEL

    Also you want to use the MvFOREACH tag. It behave like he SMT version but with more options. see the example below.

    http://www.mivascript.com/item/MvFUNCTION.html
    http://www.mivascript.com/item/MvFOREACH.html

    Code:
    <MvFUNCTION NAME="MyFunction" PARAMETERS="basket_items var" STANDARDOUTPUTLEVEL="html,text,compresswhitespace">
    
        <MvFOREACH ITERATOR = "l.item" ARRAY = "l.basket_item" INDEX = "l.pos">
    
            <MvEVAL EXPR="{ l.item::code }"> <MvEVAL EXPR="{ l.item:name }"><br>
    
        </MvFOREACH>
    
        <MvFUNCTIONRETURN VALUE="{ miva_arrray_max(l.basket_item) }">
    </MvFUNCTION>
    Also you can use the SMT tag mvt:do to call the compiled function from inside a page template. This is a great way to add functionality to you page templates without writing entire modules.

    Ray Yates
    "If I have seen further, it is by standing on the shoulders of giants."
    --- Sir Isaac Newton

    Comment

    Working...
    X