[SOLVED] list in details page

Status
Not open for further replies.
Hi every one , hope you all had a good festivities for this new year.

When I add {fabrik view=list id=4 test___size= [test2___size] layout=bootstrap } in the default detail template it returns no record but the pagination is rendered,

For testing I added {test2___size} in the default detail template and the value 1 is displayed correctly.

If I add {fabrik view=list id=4 test___size= 1 layout=bootstrap } in the default detail template it's working correctly.

The detail of the item selected in the list test___size is displayed with every corresponding items from test2___size table

Thanks in advance for any support.


Windows NT X-PC 6.1 build 7601 (Windows 7 Business Edition Service Pack 1) i586
Database Version 5.6.15-log
Database Collation latin1_swedish_ci
PHP Version 5.5.8
Web Server Apache/2.4.7 (Win32) PHP/5.5.8
WebServer to PHP Interface apache2handler
Joomla! Version Joomla! 3.4.8 Stable [ Ember ] 24-December-2015 19:30 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Fabrik 3.4
 
Where is test2___size coming from? I presume it's an element from the detail view?

The list being rendered with the content plugin doesn't "know" anything about the detail view it is embedded in. When you use [something] in a content plugin, that value is expected to come from the query string on the URL. So if you put &test2___size=1 on the URL, that would work. But obviously that's not going to be possible to do as a link.

I think what you'll need to do is this ... grab the value of that element from the data, something like this ...

Code:
<php?
$test2___size = $this->groups['Group name']->element['test2___size']->element_raw;
?>
{fabrik view=list id=4 test___size=<?php echo $test2___size; ?> layout=bootstrap}

Substitute the group name for your group name.

-- hugh
 
Hi Hugh

thanks for your quick response

yes you assume correctly test2___size is a value from the detail page

I just tried your suggestion but I can't get it to work .
I echoed $test2___size no value is returned


something I don't understand
1) if I add a value manually {fabrik view=list id=4 test___size= 1 layout=bootstrap } it works , the list is rendered all items with size 1 are shown.
2), if I put {test2___size} the correct value is returned. if I click on detail of an item with size 2 the value 2 will be returned in detailed page.

So did 2 tests

1)
<?php
$test2___size = 2;
?>
{fabrik view=list id=4 test___size=<?php echo $test2___size; ?> layout=bootstrap}

that's working

2)
$test2___size = '{ test2___size }';
echo $test2___size;

the correct value is echoed

so I tied

<?php
$test2___size = '{ test2___size }';
?>
{fabrik view=list id=4 test___size=<?php echo $test2___size; ?> layout=bootstrap}

strangely layout=bootstrap} is shown under the pagination


thanks for the support
 
Maybe { test2___size } is replaced only AFTER the php code is executed (I can recall something like that, confusing if debugging; you can do var_dump($test2___size); and have a look at the string size).
Did you try Hugh's suggestion?
$test2___size = $this->groups['Group name']->element['test2___size']->element_raw;
 
Hi Troester

I did try Hugh's suggestion without success

for your information I get a string(17) "4" if the size value is 4

I was thinking that could be the reason , I have tried to change the variable to an int but it returns 0 :-( all the time

Best Regards
Manuel
 
for your information I get a string(17) "4" if the size value is 4
yup, this is what I thought, it's echoing {xxxxx} and then replacing afterwards.

Try
$test2___size = $this->groups['Group name']->elements['size']->element_raw;

(Did you replace 'Group name' with your actual group name?)
 
Status
Not open for further replies.
Back
Top