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.

How to modify the layout of the panel asset

Apologies for a string of questions. Still very fresh to this framework, and couldn't find the answer to this specific question in the tutorials.

So, as I understand it; beyond CSS, default.master handles the overall wrapper of the forum, and you can get down to specifics by creating view overrides in your template folder for other things like the discussions view, etc. What I can't seem to figure out is how and where the Panel is rendered and how to override that.

I get that I can add content above and below my panel in the default.master, and I can style the panel via my custom CSS, but how would one go about editing the HTML content within the panel?

Thanks,

Pete

Comments

  • hgtonighthgtonight ∞ · New Moderator

    All calls to Gdn_Controller::RenderAsset($AssetName) render the associated assets. So you are looking to modify the assets content for the 'Panel' asset container. While all assets are strings, most assets are generated via modules. Most modules use views that can be overridden via the template system. Modules that do allow overrides have defaults that can generally be found in the /views/modules/modulename.php.

    For example, the default guest module that says "Howdy, Stranger!" has its default view at /applications/dashboard/views/modules/guest.php. Copy that file into your theme starting at the views folder. Change the markup how ever you want to. The framework will automatically load your override on the next render.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Great, thanks for the tip - very helpful.

  • Ok, cracked about 95% of it now, just a one main thing foxing me now. Trying to find the code responsible for displaying the list of active discussions (e.g., the default view) and others, such as My Discussions (I think). I had assumed it was /vanilla/views/discussions/table.php as that script looks very much like matches the output, but changing that doesn't seem to effect the rendered list.

  • Ok, spotted it. The table.php script is only if I'm using the table layout, not the default modern view. Doh!

  • edited February 2015

    @hgtonight said:
    All calls to Gdn_Controller::RenderAsset($AssetName) render the associated assets. So you are looking to modify the assets content for the 'Panel' asset container. While all assets are strings, most assets are generated via modules. Most modules use views that can be overridden via the template system. Modules that do allow overrides have defaults that can generally be found in the /views/modules/modulename.php.

    For example, the default guest module that says "Howdy, Stranger!" has its default view at /applications/dashboard/views/modules/guest.php. Copy that file into your theme starting at the views folder. Change the markup how ever you want to. The framework will automatically load your override on the next render.

    Hi! Nice tip, thank you. But, if I want change {serchbox} or another module which template not situated in /applications/.../views/modules/, what I must do?

  • hgtonighthgtonight ∞ · New Moderator

    You need to override the smarty plugin with your code.

    Check out this post for more information: http://vanillaforums.org/discussion/comment/225311/#Comment_225311

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.