Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Theme Design 2.3.1

So I am working on a theme using foundation6 x-grid, I have everything laid out and responding correctly. 2 files I need to find to add to my theme is all categories then discussions i want to change where the post counts and replies as well as who posted is at where do i locate these 2 files and i assume i place them in my theme/ThemeName/view ?

@R_J @vrijvlinder

Comments

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    You should not need to clone views at all.

  • Options

    well im using smarty theem hook and i want to make the post number to the right and the poster.

    @vrijvlinder

  • Options

    I need to add topics and posts by the numbers

    @vrijvlinder

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    @Gotcha said:
    well im using smarty theem hook and i want to make the post number to the right and the poster.

    @vrijvlinder

    Either you use smarty functions or theme hooks. If you use smarty functions, you need to change views, using theme hooks you can stick with the default views.

    As vrijvlinder said, there is almost no reason to override views. And there are good reasons not to do:
    1. If there are security flaws in one of the used views and you have copied that issue, the next update will fix the issue for all properly written themes, but not for yours.
    2. If there are new features in the next Vanilla version which require an addition in the view, your theme will not show that enhancement.
    3. Plugins rely on the default theme. Your change might break plugin layouts.

    All in all: if someone uses a theme which replaces a lot of views, updating to a new Vanilla version will become a major burdon.
    Don't override views without a real need.

    @Gotcha said:
    I need to add topics and posts by the numbers

    @vrijvlinder

    If you want to add/hide/change something do it in this priority:

    1. Use CSS if possible
    2. Try harder to do it with CSS
    3. Ask someone to help you to achieve your goal with CSS
    4. Use a themehook
    5. Override a single function/override a view (both are equally bad)
    6. Change core file

    1-3 are not applicable here. Therefore try 4th and add this to your themehooks file:

        public function discussionController_authorInfo_handler($sender, $args) {
            $count = $args['Author']->CountDiscussions + $args['Author']->CountComments;
            echo '<span class="MItem PostCount">'.sprintf(t('Post Count: %s'), $count).'</span>';
        }
    

    See how easy it is to extend Vanilla?


    Please don't abuse the mentioning feature. Thanks.

Sign In or Register to comment.