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

Add elgg.view(name, options) shorthand to js (Trac #3228) #3228

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

Add elgg.view(name, options) shorthand to js (Trac #3228) #3228

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

Comments

@elgg-gitbot
Copy link

Original ticket http://trac.elgg.org/ticket/3228 on 41226110-07-02 by ewinslow, assigned to trac user blacktooth.

Elgg version: 1.7

Been thinking about how to do something like this for a while, and now with Cash's idea for /ajax/view/... it's totally possible.

@elgg-gitbot
Copy link
Author

cash wrote on 41371686-09-11

+1

1.8.x or 1.9?

@elgg-gitbot
Copy link
Author

ewinslow wrote on 41374863-04-08

We could commission Ravindra to implement it as part of the ajaxify project, which I assume would mean 1.8.x.

@elgg-gitbot
Copy link
Author

Milestone changed to Elgg 1.8.x by cash on 41375759-08-14

@elgg-gitbot
Copy link
Author

trac user vazco wrote on 41390504-10-07

It would be great if view could take additional parameters if they are defined as supported by ajax, example of code:

<?php
$vars = array(
    'ajax' => true,
    'ajax_parameters'  => array('param1', 'param2'),
);
echo elgg_view('view_name', $vars);

?>
<script type="javascript/text">
    //invoke view with some_parameter equal
    elgg_refresh_view('view_name',{param1:paramvalue, param2:paramvalue});
</script>

It could be usefull as well if original parameters with which view was invoked in PHP would be passed to it's ajax invocation. This way, we could eg. refresh view which displays entity by it's GUID without having to pass GUID as ajax parameter. This would be more secure as well since such parameter would be fixed to value set in PHP.

@elgg-gitbot
Copy link
Author

cash wrote on 41398139-10-27

vazco - the options parameter in the ticket title is for passing variables to the view. On the PHP side, we already support passing parameters and passing GUID so that an entity is passed to the view. See elgg_ajax_page_handler() in elgglib.php library.

@elgg-gitbot
Copy link
Author

Milestone changed to Elgg 1.9.0 by cash on 41959984-09-14

@ewinslow ewinslow removed this from the Elgg 1.10.0 milestone Jun 13, 2014
@jdalsem
Copy link
Member

jdalsem commented Feb 5, 2015

Currently getting a view is a simple as elgg.get('ajax/view/name_of_view') do we really need to make it more simpler into `elgg.view('name_of_view')'?

@mrclay mrclay closed this as completed Feb 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants