Problem with "Content Plugin"

rha2000

Member
Hello

I have two layout FAQ1 and FAQ2; FAQ2 is a copy of FAQ1. I have two different "List" (eg, 19 and 21)

In all these cases it works:
Case 1:
{Fabrik view = list id = 19 layout = FAQ1}
{Fabrik view = list id = 21 layout = FAQ1}
Case 2:
{Fabrik view = list id = 19 layout = FAQ1}
{Fabrik view = list id = 19 layout = FAQ1}
Case 3:
{Fabrik view = list id = 19 layout = FAQ1}
{Fabrik view = list id = 19 layout = FAQ2}
Case 4:
{Fabrik view = list id = 21 layout = FAQ1}
{Fabrik view = list id = 21 layout = FAQ1}
Case 5:
{Fabrik view = list id = 21 layout = FAQ1}
{Fabrik view = list id = 21 layout = FAQ2}

But in this case does not work:
{Fabrik view = list id = 19 layout = FAQ1}
{Fabrik view = list id = 21 layout = FAQ2}

Gives the following error:
Fatal error: Can not redeclare fabrik_pagination_item_active () (previously of declared in /home/.../public_html/components/com_fabrik/views/list/tmpl/faq1/default_pagination.php:101) in /home/.../public_html/components /com_fabrik/views/list/tmpl/faq2/default_pagination.php on line 104

How I can solve this problem?

Thanks
 
Wrap those functions in a test to see if they exist or not. So edit the two files referenced in the error msg, and do this:

Code:
if (!function_exists('fabrik_pagination_item_active'))
{
   function fabrik_pagination_item_active(&$item, $listid)
   {
   return '<a title="' . $item->text . '" href="' . $item->link . '">' . $item->text . '</a>';
   }
}
 
if (!function_exists('fabrik_pagination_item_inactive'))
{
   function fabrik_pagination_item_inactive(&$item)
   {
   return '<a href="#">' . $item->text . '</a>';
   }
}

I think I'll do that as a change in github.

This does mean that you can't use different active/inactive rendering in two templates, but that's not possible to work around. There can only be one of each of those functions in any one page load.

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

Thank you.

Members online

No members online now.
Back
Top