Scot Ranney • December 19, 2023
<MvCOMMENT> | | get_meta is a great function to grab meta from anything in the store. | type: page, category, product | typedata: full structure of page, cat, or prod | </MvCOMMENT> <MvFUNCTION NAME = "get_meta" PARAMETERS = "type,typedata" STANDARDOUTPUTLEVEL=""> <MvIF EXPR = "{ l.type EQ 'page' }"> <MvASSIGN NAME = "l.ok" VALUE = "{ [ g.Module_Root $ '/modules/component/cmp-mv-prodctgy-meta.mvc' ].METANameAndValueList_Load_Page_All(l.typedata:id,l.metavalues) }" /> </MvIF> <MvIF EXPR = "{ l.type EQ 'category' }"> <MvASSIGN NAME = "l.ok" VALUE = "{ [ g.Module_Root $ '/modules/component/cmp-mv-prodctgy-meta.mvc' ].METANameAndValueList_Load_Category_All(l.typedata:id,l.metavalues) }" /> </MvIF> <MvIF EXPR = "{ l.type EQ 'product' }"> <MvASSIGN NAME = "l.ok" VALUE = "{ [ g.Module_Root $ '/modules/component/cmp-mv-prodctgy-meta.mvc' ].METANameAndValueList_Load_Product_All(l.typedata:id,l.metavalues) }" /> </MvIF> <MvFOREACH ITERATOR = "l.metavalue" INDEX = "l.pos" ARRAY = "l.metavalues"> <MvASSIGN NAME = "l.ok" VALUE = "{ [ g.Module_Root $ '/modules/component/cmp-mv-prodctgy-meta.mvc' ].METAName_Load_Name(l.metavalue:name,l.metaname) }" /> <MvASSIGN NAME = "l.metaname:value" VALUE = "{ l.metavalue:value }" /> <MvASSIGN NAME = "l.metanames" INDEX="{ l.pos }" VALUE = "{ l.metaname }" /> </MvFOREACH> <MvFUNCRETURN VALUE = "{ l.metanames }"> </MvFUNCTION>
mvkb_mivascript mvkb_schema