Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorvito
    • CommentTimeJun 20th 2008
     # 1
    i'm trying to write a plugin that will add some text to the categoryGird(preferably just after Discussions, Options), but i don't really know how to use the categoryList delegate, i tried the following:


    function CategoryGridView_Add(&$CategoryList)
    {
    $CategoryList .= '<li class=CategoryView"><span>stuff</span>100</li>';
    }
    $Context->AddToDelegate("CategoryList"," ","CategoryGridView_add");



    however the text doesn't get added to categoryGrid, does anyone know how to do it? (i don't want to do the nasty way - customize the themes/categories.php file).
    • CommentAuthormiquel
    • CommentTimeJun 20th 2008
     # 2
    maybe I'm wrong, but it seems you're missing a parameter on the AddToDelegate function:
    1 - the name of the control which has the delegate you want to attach your function to
    2 - the actual name of the delegate
    3 - the name of the function you want to attach to the delegate
    • CommentAuthorvito
    • CommentTimeJun 20th 2008
     # 3
    i was missing the second argument is because i can't find any delegate for categorylist(onley PreRender and PostRender available for CategoryList).

    as far as i can see i will need to modify /thme/categories.php to put something in the categorygrid.
  1.  # 4
    You can only inject your own code where there are CallDelegate() methods placed in the Vanilla source code. Leaving that second parameter as a space would tell Vanilla to execute your code when the " " delegate is called.

    Since there are no delegates in the themes/categories.php theme file, you will need to request a delegate (recommended) or make a new theme file (easiest).

    Delegation Documentation
    • CommentAuthorvito
    • CommentTimeJun 20th 2008
     # 5
    i think i will just modify the themes/categories.php file, since its the easiest way. but request a delegate will be a good idea, since there might be some other poeple want to customized their categorygrid. by the wya how do i request a delegate?
    • CommentAuthormiquel
    • CommentTimeJun 20th 2008
     # 6
    it's adviseable not to modify the default vanilla theme so, just, as suggested in the documentation, create a new theme just with this modified file you need
    •  
      CommentAuthorWallPhone
    • CommentTimeJun 20th 2008
     # 7
    Where do you want the code inserted? I'll put this in as a request for a new delegate, then you can upgrade just the theme file to use yourself, and it will be available in the next version for everybody else.
Add your comments
    Username Password
  • Format comments as