Creating a new widget view

Hi All,

I am trying to edit the widget view for a custom plugin (unfortunately, I haven't been able to get a hold of the plugin creator).

The plugin has a list view which also shows up as the widget view on the profile page. The list view does not look good as a widget. I was wondering if anyone had an idea on how to create a custom view for the widget? I can post the code from the view.php file in the widget folder if that will be of any help. 

  • Ok, I have managed to create a new file which is perfect for the widget view. However when I change the paths in file in the object folder, it changes it for the list view as well. Is there a way to indicate I want a particular path for the list view and another path for the widget view?

  • Any help please :(

    Not really a programmer so a nudge in the right direction will be quite helpful

  • You can probably set the context and test for it in your view file so that you can decide on how to display it.  See mod/file/views/default/object/file.php on how it uses the context "search".

  • Thanks Deds, It seems one has already been set for the list view, it looks something like this

    <?php

    gatekeeper();

    $entity = $vars['entity'];

    if ($vars['full']) {

    $view = elgg_view("review/show_review",array('entity' => $entity));

    } else {

    if (get_input('search_viewtype') == "gallery") {

      $view = elgg_view("review/list_review", array('entity' => $entity) );

    } else {

    $view = elgg_view("review/list_review", array('entity' => $entity) );

    }

    }

    echo $view;

    ?>

     

    It seems to call the list_view file when displaying the lists. So I created a new view called widg_review in the same folder and tried creating a new file in the object folder using the same code just replacing list_review with widg_review... didn't work.

    I think i might need to define something somewhere, but have no idea at the moment :(

  • Still can't seem to figure this out... I am sure the answer will turn out to be quite simple but my pea brain cannot seem to comprehend it at the moment.

    Help please!!!