adding a simple HTML page with no pageshell/layout_canvas to a plugin?

hey all,

i'm looking for a way to add an HTML page/ elgg view to a plugin such that the rendered page has its own URL but is not surrounded by the usual page content (i.e. menu, header, footer and main page background).. so it would be similar to a widget panel but with its own URL..

this is to allow elgg content to be displayed in external apps, such as browser apps.

does anyone know how to go about doing this?

i've read through the docs but the closest i've seen is to over-ride the template system for the entire site, if i understood it correctly.

thanks

  • LOZL LOLZ

    Why yew not send me PM re: this ?

     

  • did i already ask you about this?
    i thought that was a question about a similar thing but not the same?

  • You can try creating your own custom page shell. When you're building your page do something like: 

    page_draw($title, $body, 'page_shells/my_custom_shell');

    Create that file under the following directory: myplugin/views/default/page_shells/my_custom_shell.php

    Use the contents of the default page shell as a starting point, and just trim away the parts you don't need. 

  • ah elggcellant! thanks jeff, i'll give that a go. :)

  • well, that sounded like a great idea.. but page_draw doesn't accept a parameter for page_shells, only sidebars..

    i was going to make my own version of page_draw but looking at the guides for theming there is obviously a way of over-riding the pageshell for certain pages.. hmm

  • Hi, i did thing like that using the sidebar parameter

    you just need to use it as a flag, test its value in the regular pageshell script that you can easily override,  and then branch to another pageshell script if needed

     

  • Sorry about that, I was looking at the Elgg trunk code. You could override the 'pageshells/pageshell' view.. 

    Even better you could create your own view type, so your url would look like this http://myelgg.com/pg/mything/1234/?view=my_stripped_down_view

    In your plugin directory: myplugin/views/my_stripped_down_view/viewstuff....

    This would be similar to the JSON/XML/RSS views.. but for your own external site to consume. 

    In theory, that should work. It's best to leverage the existing view system for this type of thing. 

  • Jeff Tilson,

    but isn't the view only for the main content? i mean, how ould that change the pageshell?

     

    Fabrice,

    Could you please say that in again in a way that is somewhat easier to understand?

     

     

  • Can we bring this thread back to life? Can my site have more than one pageshell? If not, who the heck came up the plural "pageshell(s)"? So let's play along and assume we can have more than one.

    Next question, how, where, when? I am trying to create a blog plugin that changes blogs the look quite different that my main site. Things I would like.

    1. different header, size width etc.

    2. wider page content

    3. 3 columns instead in my sites 2

    4. eventually some drop in widgets like html code

    Anyone know how we can use pageshells to start a new page layout in blogs?

  • For my $0.97 cent's worth - here's the DDS style of following the "standards" while still cheating to get the any-way-you-like-it page layouts ->

    <?php 
        $DBG=TRUE;
        $DBG=FALSE;
        require_once("../../engine/start.php");
        global $CONFIG;
        //---------------------------------------------------------------------
        gatekeeper();
        $BodyText = $_SERVER["HTTP_HOST"];
        $BodyText = "<!-- 1 col, 2 cols, umpteen cols of page data ;-) -->";
        //---------------------------------------------------------------------
        /**
        ***********************************************************************
        * FBFCards
        * Version: 1.0
        * Date: 2010
        ***********************************************************************
        **/
    . . .etc, etc
                if ($isValid && !(checkdnsrr($domain,"MX") || checkdnsrr($domain,"A")))
                {
                    // domain not found in DNS
                    $isValid = false;
                }
            }
            return $isValid;
        } // function validEmail($email)
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        // This function displays the available images within $Category
        function displayPhotos($Category)
        {
            global $BodyText;
    . . .etc, etc
            $BodyText .= "<tr>";
    . . .etc, etc
                $BodyText .= "</tr>";
        } // function displayPhotos($Category)
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        $title="FBF Gifts Pokes Cards";
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        page_draw($title, $BodyText);
    ?>