We are developing a patch for the 2.x-dev version that would restore the D5 functionality, allowing you to override the number of items set for a view display in the embed code. We have it partially working, we still need to tweak the regexp a little bit :)

The syntax we are currently developing for is

[view:name of view=name of display=arg1=items:x]

We have included the items: as otherwise it might be confused with single numeric arguments.

I am creating this issue just to check that everyone agrees that this syntax is a good idea.

Comments

Pasqualle’s picture

I disagree, no such features should be added to insert_view. you can do the same in view display

nirbhasa’s picture

The raison d'etre of insert_view (as I see it) is to enable editors to embed views into their pages, without necessarily giving them access to the view edit pages.

My use-case is a site with 40+ different editors. Rather than tying up the admins with creating new displays every time my editors want 6 instead of 5 items displayed (and right now the JS on the Views edit page isn't up to handling more than 15 displays per view) I was hoping to use the code above to empower the editors themselves.

But I can understand there are cases where people wouldn't want editors to override their displays. Perhaps we can cater for both our use cases. How about we make the option to 'override the view display' configurable via a checkbox on a settings page? I'd happily include that in the patch.

Pasqualle’s picture

I really do not know a good and simple syntax to add the different view options into insert_view tag, as there are too many and contrib modules may add even more. It would be like putting the whole view export into the insert_view tag.

If you really want your views displays to be altered, then I would suggest to write a views argument handler which will change the items_per_page option. If such handler could be created, then you can use something like [view:name=display=items_per_page/arg1/arg2] (but of course the syntax depends on the position of your handler in the specific view).

nirbhasa’s picture

Ok, I'll take a look at that - I found something on http://drupal.org/node/259034

I don't want to add all the views options either, but I would still argue that 'number of items' is a special case, there are perhaps a few other view options which you might want to delegate to editors, but not many :)

Even if we did want to write regex code for all the view options, it would still differ from view_export in that we are witholding the ability to write PHP code from editors - that's the crucial feature of insert_view, in my humble opinion.

Pasqualle’s picture

Status: Active » Closed (won't fix)