Fork me on GitHub

Categories problem  Bottom

  • Trying to enable categories in a modulestudio generated module.

    It seems setting categorization to TRUE in modulestudio merely enables it for the table in pntables.php - or am I missing somewhere else to create settings?

    I didn't see any other code generated for categories.

    SO, followed the category Wiki entry, adding code to the pninit.php to set up the categories and registry. This part works.

    Also put code to pass the categories in the EDIT function to the pnForm instance.

    Then, put the selector code in the template.

    This all works, everything shows up fine.

    BUT

    Whatever category is selected is never saved. Does pnForm natively discover categories? Do I need to do something in the pnForm handler functions to process this, or configure it to recogize a category is being selected? Or, is there a specific way to present the category selector in the template so the the pnForm process recognizes the category?

    Thanks for any further direction (still wrapping my head around pnForm icon_smile )

    NCM
    SwitchBit, UHE
  • No one uses categories and pnForm? Anyone know of a module that uses both so I can at least follow their code and see what I'm missing?

    EDIT: Ok, found TimeIt used categories and pnForm.

    One thing, when print_r the TimeIt object, there is a cats variable.
    When trying this in my own, there isn't no matter what I name the category field in the edit template.

    Does a data field need to register somehow with pnForm to be passed back - ie, any unregistered fields are not returned in the object data?

    If so, how to register said data fields? I'm calling the categories and assigning them in the pnForm handler class.

    Any clues on how to get the categories to save? I can't even get them returned in the object data in the pnForm handler.

    NCM



    edited by: uheweb, Sep 29, 2009 - 12:03 AM
  • Ok...found this thread:

    http://groups.google…cdfbc10857da7?fwc=1

    Which led me to remove everything I tried, and just ad:

    Code

    <!--[pnformcategoryselector id="Main" category=$__CATEGORIES__.Main.id selectedValue=$__CATEGORIES__.Main.parent_id  enableDBUtil=1]-->


    Now, the object is saved AND the category is saved in the categories_mapobj table correctly.

    Whew. So, long story short. pnForm seems to need to have this plugin called to initialize and let it know categories will be passed to DBUtil?
  • Thanks for sharing this! I'll be battling with the same thing in the next two weeks.

This list is based on users active over the last 60 minutes.