Fork me on GitHub

Answer:Create a subcategory  Bottom

  • How to create subcategories in a category created by pninit in a my new module?
    Thanks



    edited by: alverman, Mar 25, 2008 - 02:47 PM
  • The the category manager admin, simply click on "Create a new Category" and select the appropriate category as your new category's parent category ...

    Greetings
    R
  • I want to create everything from my code module.
    Even trying because my module on the new versions do not have to continue to create them manually :)
  • Check the Categories module init script.
    It creates a lot of categories by default, it may help you icon_wink

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Mateo,

    I have this same question. I had already thought of looking at the category module's init file. The only problem is that the init file already knows the id and parentid fields as this is the initial filling of the database. When you add a parent category through $MyModule's init file, you don't have that parentid needed to add categories for your module. The category module also has all the path and ipath fields filled out as well.

    I think this is what alverman was talking about.



    edited by: cyber_wolf, Mar 26, 2008 - 08:30 AM

    --
    cyber_wolf
    www.bkbsolutions.com - My Zikula module development site.
  • In that case check the News and/or Quotes init script. They create new categories the IDs of which are not yet known at create time.

    Greetings
    R
  • The migratecategories function of the News init script helps with this request. If I read alverman's question correctly, he wanted to include default categories in his init script when he created his module's root category in the category tree. This function in the News init script is a starting point.

    --
    cyber_wolf
    www.bkbsolutions.com - My Zikula module development site.
  • 0 users

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