Utilisation des filtres sur champs filtrable

More
12 years 1 month ago #29118 by fgossart
Perhaps should I think about another way of managing mulisite different that using fields filtering.

it should be like the langage filter in joomla. But I don't know really how works langage filtering.

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #29119 by ggppdk
no no , if you want different items displayed,
that depend on the domain,
then you should probably use a FLEXIcontent filter,

is that what you want to do? display different items depending on the domain used in the URL?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #29122 by fgossart
Yes it's what I want, but Flexicontent filter cannot be hidden and permanent depending on domain name as I can see.
I could of course easily hack the Flexi component to add my filter in models GetItems but not a good idea for updates

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #29124 by ggppdk
You can do it via a system plugin ... using the event event onAfterRoute ... you check if current view is category view and set the filter, no hacks, and rather little code ...
Code:
function onAfterRoute() { $app =& JFactory::getApplication(); $option = JRequest::getCMD('option'); $view = JRequest::getVar('view', ''); $cid = (int) JRequest::getVar('cid'); if ( $option == 'com_flexicontent' && $view=='category' ) { // YOU MUST DO DOMAIN CHECK HERE and change the statement bellow ... $app->setUserStateFromRequest( $option.'.category'.$cid.'.filter_47', 'put the field value here'); } }


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #29125 by fgossart
oh yes I am still a newbie in Joomla dev and not familiar with plugins at this time.
I will try to do that and then will give you my results.

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #29145 by fgossart
I create a simple plugin for my specific use as you suggest

class plgSystemFlexiMultisite extends JPlugin
{
function onAfterRoute()
{
$app =& JFactory::getApplication();
$option = JRequest::getCMD('option');
$view = JRequest::getVar('view', '');
$cid = (int) JRequest::getVar('cid');
$servername=$_SERVER[SERVER_NAME];
if ( $option == 'com_flexicontent' && $view=='category' ) {
switch($servername)
{
case 'mymainsite.fr': $app->setUserState( $option.'.category'.$cid.'.filter_53', '1'); break;
case 'subsite1.mymainsite.fr': $app->setUserState( $option.'.category'.$cid.'.filter_3', '15'); break;
case 'subsite2.mymainsite.fr': $app->setUserState( $option.'.category'.$cid.'.filter_3', '16'); break;
}
}
}
}

Where value '1' is boolean value in field #53 : 'must be also in main site ?'
and 15, 16 are the user id for subsites admins, filter #3 is on field created_by.

It's very easy ... I just created users/groups, one user for each subsite admin.
Subsites contents is all flexi data created by himself

Thanks , powerful and easy

For managing multisite I use seblod but only multisite feature ;-)

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.578 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline