load a resource in elgg-lightbox

Hi everyone,

I want to know if it is possible to load a resource in elgg-ligthbox.

I try something like this in a lightbox but nothing happens.

echo elgg_view_resource('pessektress/all');



  • Why would you want to load the entire page shell in a lightbox? Mostly (I think) you want to load a specific part of a page in a lightbox. That's what the views are for.

    However if you want it should work like you tried. Did you confirm you get in the view? Cache flush is always what makes stuff work for me as I forget that I added a new view ;)

  • Thanks @jerome,

    Yes I confirm that I dit it from a view. But nothing happen.
    The lightbox try to load and remains in progress.




  • Is the view registered as an AJAX view? What does the webbrowser console (or network tab) say the response in from the request to the url the lightbox is trying to load?

  • Yes the view is registered as an AJAX view. For instance when I replace elgg_view_resource  by elgg_view_form the form is displayed in the lightbox. 

    The are the errors I got in my console when using elgg_view_resource

    Uncaught TypeError: require is not a function
        jQuery 16
        open https://pessek-elggfinal331.com/cache/1594563187/default/elgg/lightbox.js:9
        bind https://pessek-elggfinal331.com/cache/1594563187/default/elgg/lightbox.js:9
    Uncaught Error: Mismatched anonymous define() module: function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this.…
        makeError https://pessek-elggfinal331.com/cache/1594563187/default/require.js:17
        intakeDefines https://pessek-elggfinal331.com/cache/1594563187/default/require.js:81
        localRequire https://pessek-elggfinal331.com/cache/1594563187/default/require.js:104




  • I would say, it is not possible. As you still haven't told us why you even think this necessary I don't think it's worth for any of us spending any time on it anyway.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking