Announcement

Collapse
No announcement yet.

Displaying only Active

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

  • lesliekirk
    replied
    Originally posted by Bruce - PhosphorMedia View Post
    oh, try replacing cssui with mmui (not tested, been a while since i've worked on an mmui).
    Thanks, Bruce, that got it. So those of you out there that still have MMUI stores here ya go (make sure you put it inside the foreach loop):

    Code:
    <mvt:do file="g.Module_Root $ '/modules/component/cmp-mmui-cattitle.mvc'" name="l.success" value="MMUI_CatTitle_Load(l.settings:subcat:id, l.settings:subcat:cat_title)" />
    <img src="&mvt:subcat:cat_title:image;" alt="&mvt:subcat:name;">

    Leave a comment:


  • Bruce - PhosphorMedia
    replied
    oh, try replacing cssui with mmui (not tested, been awhile since i've worked on an mmui).

    Leave a comment:


  • lesliekirk
    replied
    Originally posted by Bruce - PhosphorMedia View Post
    Code:
    <mvt:do file="g.Module_Root $ '/modules/component/cmp-cssui-cattitle.mvc'" name="l.success" value="CSSUI_CatTitle_Load(l.settings:subcat:id, l.settings:subcat:cat_title)" />
    That would work IF the site were CSSUI...

    Leave a comment:


  • Bruce - PhosphorMedia
    replied
    Code:
          <mvt:do file="g.Module_Root $ '/modules/component/cmp-cssui-cattitle.mvc'" name="l.success" value="CSSUI_CatTitle_Load(l.settings:subcat:id, l.settings:subcat:cat_title)" />

    Leave a comment:


  • lesliekirk
    replied
    Follow up question - how do I display the subcat image?

    Leave a comment:


  • Bruce - PhosphorMedia
    replied
    You can also use:

    Runtime_Category_Load_Code()

    Which is useful because it lists only categories that should be shown to a user based on availability groups AND active.

    Leave a comment:


  • lesliekirk
    replied
    Thanks Scot! That's exactly what I needed.

    Leave a comment:


  • Scot - ScotsScripts.com
    replied
    Try adding an mvt:if that checks for active in the loop and then going to the next record if the item is not active:

    Code:
    <mvt:foreach iterator="subcat" array="sub_categories">
      <mvt:if expr="NOT l.settings:subcat:active">
        <mvt:foreachcontinue />
      </mvt:if>
    &mvt:subcat:active; &mvt:subcat:agrpcount; &mvt:subcat:code; &mvt:subcat:disp_order; &mvt:subcat:id; &mvt:subcat:name; &mvt:subcat:parent_id;
    </mvt:foreach>

    Leave a comment:


  • lesliekirk
    started a topic Displaying only Active

    Displaying only Active

    This snippet of code posted here https://docs.miva.com/code-samples/subcat does a great job of displaying the sub-categories - too good of a job - as it also displays the inactive categories. How do I display just the active categories?

    Code:
    //load current category data
    
    <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_Code( g.Category_Code, l.settings:current_category )" /> <mvt:do name="l.result" file="g.Module_Library_DB" value="CategoryList_Load_Parent( l.settings:current_category:id, l.settings:sub_categories )" /> <mvt:foreach iterator="subcat" array="sub_categories"> &mvt:subcat:active; &mvt:subcat:agrpcount; &mvt:subcat:code; &mvt:subcat:disp_order; &mvt:subcat:id; &mvt:subcat:name; &mvt:subcat:parent_id; </mvt:foreach>
Working...
X