Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Answer:Create a subcategory
  • Posted: 25.03.2008, 19:44
     
    alverman
    rank:
    Freshman Freshman
    registered:
     March 2008
    Status:
    offline
    last visit:
    13.05.08
    Posts:
    36
    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
  • Posted: 25.03.2008, 21:45
     
    rgasch
    rank:
    Professional Professional
    registered:
     January 2003
    Status:
    offline
    last visit:
    03.12.08
    Posts:
    569
    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
  • Posted: 25.03.2008, 22:39
     
    alverman
    rank:
    Freshman Freshman
    registered:
     March 2008
    Status:
    offline
    last visit:
    13.05.08
    Posts:
    36
    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 :)
  • Posted: 25.03.2008, 23:14
     
    nestormateo
    rank:
    Team Member Team Member
    registered:
     September 2006
    Status:
    online
    Posts:
    1496
    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
  • Posted: 26.03.2008, 18:28
     
    cyber_wolf
    rank:
    Helper Helper
    registered:
     June 2002
    Status:
    offline
    last visit:
    09.09.08
    Posts:
    288
    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.
  • Posted: 27.03.2008, 16:25
     
    rgasch
    rank:
    Professional Professional
    registered:
     January 2003
    Status:
    offline
    last visit:
    03.12.08
    Posts:
    569
    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
  • Posted: 27.03.2008, 18:19
     
    cyber_wolf
    rank:
    Helper Helper
    registered:
     June 2002
    Status:
    offline
    last visit:
    09.09.08
    Posts:
    288
    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.

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula