Module Simple Portfolio language filter - Forum | JoomShaper
Solved Extensions

Module Simple Portfolio language filter

Asked by Vangelis Eftaxopoulos 4 years ago Last activity 3 years ago

Hello,

I recently purchased wimble for Joomla.
I am trying to show portfolio items with simple portfolio module, but the items are not filtering with language (displays all items).
I am using Joomla 4.1.

Thank you

Accepted answer

Marked as the solution
Vangelis Eftaxopoulos Asked this

As I see you cannot find the error, so add after $db = Factory::getDbo(); in helper.php file the following code.

        $languageTag = JFactory::getLanguage()->getTag();
        $languageFilter = $db->Quote($languageTag).", ".$db->Quote('*');

        $query = $db->getQuery(true);

        $query->select('a.*, a.id AS spsimpleportfolio_item_id , a.tagids AS spsimpleportfolio_tag_id, a.created AS created_on')
        ->from($db->quoteName('#__spsimpleportfolio_items', 'a'))
        ->where($db->quoteName('a.published') . ' = 1');

        if ($languageFilter) {
           $query->where($db->quoteName('a.language') . ' IN (' . $languageFilter . ')');
        }

4 more replies

Vangelis Eftaxopoulos Asked this

Hi!

Maybe I didn't explain correctly. I have a multilingual site with two languages (Greek and English). When I am on portfolio page on greek language I expect to see only Greek portfolio items and the same when I am on english page. But I get all items on both pages.
At least this is the expected result for most joomla modules.
I also tried with different modules with different languages but I got the same result.

Thank you

Rashida Rahman Staff

Hi,

Really sorry for the unwanted delay.

Would you please give me your site URL here?

Best Regards

Vangelis Eftaxopoulos Asked this

Hello,

Sorry for the late response.

Log in to reply.