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

if I call a render asset handler, how do I isolate asset conditionally.

peregrineperegrine MVP
edited July 2012 in Vanilla 2.0 - 2.8

e.g.
public function CategoriesController_BeforeRenderAsset_Handler($Sender) {

if I only want something to act on the content, but not the footer, not the header and not the panel.

what would be the way to test for that?

I haven't been successful in retrieving the AssetName out of wherever it is.

I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Comments

  • Options

    Is it even possible to check for the asset it is about to render.

    Is this a stupid question or do the people who know just ignore my questions?

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    peregrineperegrine MVP
    edited July 2012

    If you don't see me answering any of your questions or posting on the board as frequently.

    • its because I will be trying to solve the numerous unanswered questions that I have posted and never have been responded to or answered. I'll be back when either I figure out the answers or someone else provides some help to them.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    peregrineperegrine MVP
    edited July 2012

    @x00

    if it is not clear.

    I was trying to echo something to the Content Asset after the event BeforeRenderAsset

    public function CategoriesController_BeforeRenderAsset_Handler($Sender) {

    since there is no other event just for ContentAsset in Vanilla 2.1

    so if something is echoed in this function it gets echoed to the footer, panel, header, and every other assert with respect to the CategoryController.

    I can remedy it by displaying none for the other asset classes in the css, but what is the better way besides adding my on event.

    You seemed to be on to something similar in the CategoryAccordion plugin, but I'm stumped. And you seem to be the only one with the know how who is willing to help occasionally.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    have a look at the pokets plugin

    public function Base_BeforeRenderAsset_Handler($Sender) {
        $AssetName = GetValueR('EventArguments.AssetName', $Sender);
    }
    

    grep is your friend.

  • Options

    will do. thanks much, you are the "superstar" in this forum @x00.

    If I get it working with that, which seems pretty easy, it should make my plugin better.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    x00 said:
    have a look at the pokets plugin

    public function Base_BeforeRenderAsset_Handler($Sender) {
    $AssetName = GetValueR('EventArguments.AssetName', $Sender);
    }

    worked perfectly thanks again x00.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.