Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested extended views (Trac #3448) #3448

Closed
elgg-gitbot opened this issue Feb 16, 2013 · 4 comments
Closed

Nested extended views (Trac #3448) #3448

elgg-gitbot opened this issue Feb 16, 2013 · 4 comments

Comments

@elgg-gitbot
Copy link

Original ticket http://trac.elgg.org/ticket/3448 on 41364693-12-21 by trac user vazco, assigned to unknown.

Elgg version: 1.8 Beta

I'm not sure if this is intended but when we have views:
A which is extended by B
B which is extended by C

when we invoke view A, view B will be displayed but view C won't

@elgg-gitbot
Copy link
Author

cash wrote on 41367730-11-23

Here is the code with unrelated stuff snipped out:

    // Set up any extensions to the requested view
    if (isset($CONFIG->views->extensions[$view])) {
        $viewlist = $CONFIG->views->extensions[$view];
    } else {
        $viewlist = array(500 => $view);
    }

    // Start the output buffer, find the requested view file, and execute it
    ob_start();

    foreach ($viewlist as $priority => $view) {
        $view_location = elgg_get_view_location($view, $viewtype);
        $view_file = "$view_location$viewtype/$view.php";

        $default_location = elgg_get_view_location($view, 'default');
        $default_view_file = "{$default_location}default/$view.php";

        // try to include view
        if (!file_exists($view_file) || !include($view_file)) {
            // cut out code for falling back to default view
        }
    }

    // Save the output buffer into the $content variable
    $content = ob_get_clean();

To support A -> B -> C, we would need to create a tree structure rather than a simple array (or at least build the tree and then flatten to a 1D array)

@elgg-gitbot
Copy link
Author

ewinslow wrote on 41500391-03-16

Or we could call elgg_view recursively.

@elgg-gitbot
Copy link
Author

Milestone changed to Elgg 1.9 by brettp on 41502197-05-02

@ewinslow
Copy link
Contributor

ewinslow commented Aug 9, 2014

Don't think we need to support this. If someone wants they can reopen. Once the views rewrite (#7070) is checked in, should be pretty easy to support if we need to.

@ewinslow ewinslow closed this as completed Aug 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants