I am using Exhibit on one project. It works great. Thanks for such a wonderful module that makes it all so easy to present great Semantic web user interface experience for the Drupal site's data.

In my current project, I have configured a View that generates the Exhibit JSON feed. it works great. When I created the View, it lets you select the Exhibit JSON feed that you can choose for the Exhibit node. I have a situation where I am using many Exhibit nodes - where most underlying views are identical except for one filter criteria. Ideally, I would like to have just one view that receives the argument and generates different Exhibit JSON output. Even better would have been to have the ability to expose the filter on the Exhibit page.

I was wondering if it possible to pass some arguments to the views when you select the Exhibit JSON generating feeds on the create Exhibit node page? That will make this wonderful module even more feature rich - letting you to choose the Exhbibit JSON generating feed and then letting you to enter arguments to be passed to the feed url.

If there is a way to expose the Views filter on the Exhibit page, that will be even more awesome.

Thanks.

Comments

rkarajgi’s picture

I am trying to use Exhibit where the arguments to the exhibit node are passed to the feed.

In my project,
- The path of my view that generates Exhibit JSON is "exh_list". This "exh_list" view supports arguments. It generates a list according to the arguments passed - this is working just fine in the Views' Preview.
- node 14030 is the Exhibit page. This Exhibit page is linked to the "exh_list"

So, if I figured that if I invoke /node/14030/ca/90210, then I am hoping the Exhibit will invoke "exh_list/ca/90210" to obtain the Feed data and my view feed will get the argument "ca/90210".

I looked at the Exhibit source code (exhibit.module) lines 378-395 that have the exhibit_get_url function. That code in Exhibit module seems to pass the page arguments to the internal feed.

When I invoke /node/14030/ca/90210, I do not get the list that I should get when arguments are passed - it outputs all elements - that is the arguments default.

Am I missing something?

On the admin/content/exhibit does one need to specify that a particular feed is capable of handling arguments? How does one specify that?

Any help will be greatly appreciated.

Thanks

valderama’s picture

i would have the same request..

it would be great if an URL argument could be passed to the underlying view in order to narrow down the data-basis for the exhibit..

valderama’s picture

any idea, anyone?

valderama’s picture

Status: Active » Closed (fixed)

hi there!

the functionality to add arguments to exhibits which are based on views it implemented already. its just not so well documented. so here is what you have to do:

1) add the argument to your view
2) in the view, add a placeholder in the feed-path: list_of_nodes/%/
3) call the exhibit node, with node/?args=11

then the exhibit json feed will be called by this url: list_of_nodes/11/ . And if your argument is configured correctly, your result list is filtered by the argument.

UPDATE: in order to make it also work without any argument, i had to modify line 384 in exhibit.module and remove the placeholder in the feed-path. as soon as i have the placeholder there, the view does not work without any argument anymore. therefor i go without a placeholder and change the way, how the argument is added to the path:

if you have just one argument, you can change line 384 in exhibit.module form this

$url_parts['path'] = preg_replace('/\%/', $_GET['args'], $url_parts['path']);

to this

$url_parts['path'] .= '/'. $_GET['args'];