SOLVED: Pre-filter using Variable parsed from URL

daduts

New Member
Greetings,

I'm having problems getting a pre-filter working in a manner I hope.

I'm using Fabrik to augment the capabilities of JEvents and am adding a Fabrik List Module to the JEvents event detail pages to provide more info to event organizers.

The table I've constructed is based on registrations for a certain event and as such needs pre-filtered to only display the attendees for that event.

I've created a php routine to parse the page url and pull an $Eventid which I've been trying to use in the module pre-filters. I've not yet found a format for that pre-filter that works with the variable. (It works fine if I use a value in the pre-filter.)

What do you prescribe ?

Here's an example page. A login is available in my profile.

tryoutzz.com/calendar/eventdetail/58/-/bombers-baseball-boys-u16


BTW, I purchased a month of standard support but the forum is not letting me post there yet.

Thanks,

Dave
 
You should be able to use {query_string_arg_name} in your prefilter value, like {eventid} if your query string is &eventid=123. And set the "type" to "text".

Try posting on standard again, I reset your group details in the forums.

-- hugh
 
Hey Hugh,

Thanks for the quick reply and the account fix.

I tried a couple different variations of {Eventid} in the pre-filter without success.

Let me give you some more details....


Here's an example url....

tryoutzz.com/calendar/eventdetail/57/-/bombers-u12-boys-baseball


Here's my php routine that currently resides in the Fabrik List Introductions using the Regular Labs Sourcerer plugin....

{source}

<?php

$link = "$_SERVER[REQUEST_URI]";

echo $link;

$pieces = explode("/", $link);

$Eventid = $pieces[3];

echo '<br/>';
echo '$Eventid= ';
echo $Eventid;

?>

{/source}


It seems to be accomplishing it's task by outputting....

/calendar/eventdetail/57/-/bombers-u12-boys-baseball
$Eventid= 57

Below is my prefilter setup.... I've tried it with {Eventid} and {$Eventid} without getting a proper results.

If I change the value to 57, it filters properly for event #57.

Fabrik  edit list  Registrations    TRYOUTzz.com   Administration.jpeg

Whattya think ?

Cheers,

Dave
 
You must use a querystring argument in your url
like {eventid} if your query string is &eventid=123.
If you want to use just "something" you can use your code and return the string your need, put it in "value" (without php tags)
and set type to Eval
 
Yup, as Troester says, easiest way to do that is just use an eval'ed filter and return the value. And rather than try and parse the URL yourself, just set the pre-filter value type to "eval", and return the J! request input ...

Code:
return (string) $this->app->input->getInt('eventid', '');

... or whatever the query string arg name for that third part of the SEF'ed route would be on a normal (non SEF'ed) &option=com_jevents&view=eventdetail&eventid=123 URL. The J! router will have parsed that URL out into the request with the appropriate arg names.

Actually, probably just {id} (or whatever the arg name is) as type 'text' would do it, as the code we have that allows query string placeholders would find that in the request data.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top