Announcement

Collapse
No announcement yet.

mvt:assign optional index and member attributes please.

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

    mvt:assign optional index and member attributes please.

    The mvt:assign function is not quite complete.

    Please consider adding optional index and member attributes.
    <mvt:assign name="variable_name" index="index " member="member" value="expression" />

    Where index = variable or a numeric expression
    Where member= variable or a string expression


    Also consider:
    <mvt:assign name="variable_name[index_expression]:member" value="expression" />

    Where [index_expression] is recursively parsed: e.g. name="variable_name[ function( variable[ pointer ] ) ]:member"
    Ray Yates
    "If I have seen further, it is by standing on the shoulders of giants."
    --- Sir Isaac Newton

    #2
    Re: mvt:assign optional index and member attributes please.

    I know it was mentioned in a previous thread (here) and Brennan said it was on their radar. This would be very beneficial and I would like to see this added as well.

    Josh

    Comment


      #3
      Re: mvt:assign optional index and member attributes please.

      Have you tried the old work-around of putting a string expression in the name part?
      E.g.
      Code:
      <mvt:assign name="'l.settings:basket:items[' $ g.ItemNumber $ ']:options[' $ g.OptionNumber $ ']:price' " value="some_expression" />
      That syntax may not be quite right, but I seem to recall a previous thread on this topic that indicated this would work.
      Last edited by Kent Multer; 08-06-15, 02:21 PM.
      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


        #4
        Re: mvt:assign optional index and member attributes please.

        You can hard code a index and that will work, but currently you cannot use a variable for an index:

        http://www.miva.com/videos/web_developers/arrays/131
        Brennan Heyde
        VP Product
        Miva, Inc.
        [email protected]
        https://www.miva.com

        Comment

        Working...
        X