Dear support-team,
I wanted to ask if i can restrict the filter options to only User and Friends. I need a more "Facebook" like approach so that it involves more there friends in stead of every member.
Best regards,
Lafemme
HI, Cynthia.
You mean you want to have "Mu Friends & I" filter enabled by default and don't allow to change it?
So remove other filtering options?
If yes, then first you need to set "My friends & I" as default filter here: Backend -> Components -> JomSocial -> Configuration -> Layout ->
Frontpage Activity Stream box -> Default Frontpage Activity Filter set to
i.imgur.com/fQCj8eW.png
Then you'll need to modify filter options by removing some of them.
Copy this file:
ROOT/components/com_community/templates/jomsocial/layouts/frontpage/base.php
to:
ROOT/templates/your-template/html/com_community/layouts/frontpage (if you don't have those folders - feel free to create them)
Edit file and in line 63 replace this:
<ul class="unstyled joms-activity-filter-dropdown joms-postbox-dropdown" style="display: none">
<li <?php echo ($filterKey == 'all') ? 'class="active"' : ''; ?>
data-filter="all"
data-url="<?php echo CRoute::_('index.php?option=com_community&view=frontpage&filter=all'); ?>">
<svg viewBox="0 0 16 18" class="joms-icon">
<use xlink:href="<?php echo CRoute::getURI(); ?>#joms-icon-star3"></use>
</svg>
<?php echo JText::_("COM_COMMUNITY_FILTERBAR_ALL"); ?>
</li>
<li <?php echo ($filterKey == 'apps' && $filterValue == "profile") ? 'class="active"' : ''; ?>
data-filter="apps" data-value="profile"
data-url="<?php echo CRoute::_('index.php?option=com_community&view=frontpage&filter=apps&value=profile'); ?>">
<svg viewBox="0 0 16 18" class="joms-icon">
<use xlink:href="<?php echo CRoute::getURI(); ?>#joms-icon-pencil"></use>
</svg>
<?php echo JText::_("COM_COMMUNITY_FILTERBAR_STATUS"); ?>
</li>
<?php if ($config->get('enablephotos')) { ?>
<li <?php echo ($filterKey == 'apps' && $filterValue == "photo") ? 'class="active"' : ''; ?>
data-filter="apps" data-value="photo"
data-url="<?php echo CRoute::_('index.php?option=com_community&view=frontpage&filter=apps&value=photo'); ?>">
<svg viewBox="0 0 16 18" class="joms-icon">
<use xlink:href="<?php echo CRoute::getURI(); ?>#joms-icon-images"></use>
</svg>
<?php echo JText::_("COM_COMMUNITY_FILTERBAR_PHOTO"); ?>
</li>
<?php } ?>
<?php if ($config->get('enablevideos') == 1) { ?>
<li <?php echo ($filterKey == 'apps' && $filterValue == "video") ? 'class="active"' : ''; ?>
data-filter="apps" data-value="video"
data-url="<?php echo CRoute::_('index.php?option=com_community&view=frontpage&filter=apps&value=video'); ?>">
<svg viewBox="0 0 16 18" class="joms-icon">
<use xlink:href="<?php echo CRoute::getURI(); ?>#joms-icon-camera2"></use>
</svg>
<?php echo JText::_("COM_COMMUNITY_FILTERBAR_VIDEO"); ?>
</li>
<?php } ?>
<?php if ($config->get('enablegroups') == 1) { ?>
<li <?php echo ($filterKey == 'apps' && $filterValue == "group") ? 'class="active"' : ''; ?>
data-filter="apps" data-value="group"
data-url="<?php echo CRoute::_('index.php?option=com_community&view=frontpage&filter=apps&value=group'); ?>">
<svg viewBox="0 0 16 18" class="joms-icon">
<use xlink:href="<?php echo CRoute::getURI(); ?>#joms-icon-users"></use>
</svg>
<?php echo JText::_("COM_COMMUNITY_FILTERBAR_GROUP"); ?>
</li>
<?php } ?>
<?php if ($config->get('enableevents') == 1) { ?>
<li <?php echo ($filterKey == 'apps' && $filterValue == "event") ? 'class="active"' : ''; ?>
data-filter="apps" data-value="event"
data-url="<?php echo CRoute::_('index.php?option=com_community&view=frontpage&filter=apps&value=event'); ?>">
<svg viewBox="0 0 16 18" class="joms-icon">
<use xlink:href="<?php echo CRoute::getURI(); ?>#joms-icon-calendar"></use>
</svg>
<?php echo JText::_("COM_COMMUNITY_FILTERBAR_EVENT"); ?>
</li>
<?php } ?>
<li <?php echo ($filterKey == 'privacy' && $filterValue == "me-and-friends") ? 'class="active"' : ''; ?>
data-filter="privacy" data-value="me-and-friends"
data-url="<?php echo CRoute::_('index.php?option=com_community&view=frontpage&filter=privacy&value=me-and-friends'); ?>">
<svg viewBox="0 0 16 18" class="joms-icon">
<use xlink:href="<?php echo CRoute::getURI(); ?>#joms-icon-user"></use>
</svg>
<?php echo JText::_("COM_COMMUNITY_FILTERBAR_MEANDFRIENDS"); ?>
</li>
<li <?php echo ($filterKey == 'keyword' || $filterKey == 'hashtag') ? 'class="active"' : '' ?>
data-filter="__filter__" data-value="__value__"
data-url="<?php echo CRoute::_('index.php?option=com_community&view=frontpage&filter=__filter__&value=__value__'); ?>"
style="margin-top:20px">
<div class="joms-select--wrapper" style="margin-bottom:4px">
<select class="joms-select">
<option value="keyword" <?php echo ( $filterKey == 'keyword' ) ? 'selected="selected"' : '' ?>><?php echo JText::_("COM_COMMUNITY_FILTERBY_KEYWORD"); ?></option>
<option value="hashtag" <?php echo ( $filterKey == 'hashtag' ) ? 'selected="selected"' : '' ?>><?php echo JText::_("COM_COMMUNITY_FILTERBY_HASHTAG"); ?></option>
</select>
</div>
<input type="text" class="joms-input" value="<?php echo ($filterKey == 'keyword' || $filterKey == 'hashtag') ? $filterValue : '' ?>"
placeholder="<?php echo JText::_("COM_COMMUNITY_ENTER_KEYWORD"); ?>"
data-label-keyword="<?php echo JText::_("COM_COMMUNITY_ENTER_KEYWORD"); ?>"
data-label-hashtag="<?php echo JText::_("COM_COMMUNITY_ENTER_HASHTAG"); ?>"
style="margin-bottom:8px">
<button class="joms-button--primary joms-button--full"
data-label-keyword="<?php echo JText::_("COM_COMMUNITY_SEARCH_KEYWORD"); ?>"
data-label-hashtag="<?php echo JText::_("COM_COMMUNITY_SEARCH_HASHTAG"); ?>"
style="margin-bottom:3px"><?php echo JText::_( $filterKey == "hashtag" ? "COM_COMMUNITY_SEARCH_HASHTAG" : "COM_COMMUNITY_SEARCH_KEYWORD"); ?></button>
</li>
</ul><ul class="unstyled joms-activity-filter-dropdown joms-postbox-dropdown" style="display: none">
<li <?php echo ($filterKey == 'privacy' && $filterValue == "me-and-friends") ? 'class="active"' : ''; ?>
data-filter="privacy" data-value="me-and-friends"
data-url="<?php echo CRoute::_('index.php?option=com_community&view=frontpage&filter=privacy&value=me-and-friends'); ?>">
<svg viewBox="0 0 16 18" class="joms-icon">
<use xlink:href="<?php echo CRoute::getURI(); ?>#joms-icon-user"></use>
</svg>
<?php echo JText::_("COM_COMMUNITY_FILTERBAR_MEANDFRIENDS"); ?>
</li>
<li <?php echo ($filterKey == 'keyword' || $filterKey == 'hashtag') ? 'class="active"' : '' ?>
data-filter="__filter__" data-value="__value__"
data-url="<?php echo CRoute::_('index.php?option=com_community&view=frontpage&filter=__filter__&value=__value__'); ?>"
style="margin-top:20px">
<div class="joms-select--wrapper" style="margin-bottom:4px">
<select class="joms-select">
<option value="keyword" <?php echo ( $filterKey == 'keyword' ) ? 'selected="selected"' : '' ?>><?php echo JText::_("COM_COMMUNITY_FILTERBY_KEYWORD"); ?></option>
<option value="hashtag" <?php echo ( $filterKey == 'hashtag' ) ? 'selected="selected"' : '' ?>><?php echo JText::_("COM_COMMUNITY_FILTERBY_HASHTAG"); ?></option>
</select>
</div>
<input type="text" class="joms-input" value="<?php echo ($filterKey == 'keyword' || $filterKey == 'hashtag') ? $filterValue : '' ?>"
placeholder="<?php echo JText::_("COM_COMMUNITY_ENTER_KEYWORD"); ?>"
data-label-keyword="<?php echo JText::_("COM_COMMUNITY_ENTER_KEYWORD"); ?>"
data-label-hashtag="<?php echo JText::_("COM_COMMUNITY_ENTER_HASHTAG"); ?>"
style="margin-bottom:8px">
<button class="joms-button--primary joms-button--full"
data-label-keyword="<?php echo JText::_("COM_COMMUNITY_SEARCH_KEYWORD"); ?>"
data-label-hashtag="<?php echo JText::_("COM_COMMUNITY_SEARCH_HASHTAG"); ?>"
style="margin-bottom:3px"><?php echo JText::_( $filterKey == "hashtag" ? "COM_COMMUNITY_SEARCH_HASHTAG" : "COM_COMMUNITY_SEARCH_KEYWORD"); ?></button>
</li>
</ul>
Hi, Cynthia.
Please provide us working administrator credentials.
I can't login to your site.
Please, edit your first post and add credentials to corresponding fields.
Dear Michal...
Any idea what have gone wrong?? can i just otherwise remove the filter-box? so that they can not choose anymore? Or only show that filterbox to admin?? because that would be better so that we still can see the whole list so that we have more controle what happends on the website.
HI, Cynthia.
I fixed that on your site - it's fine now.
HI Michal... i am sorry...
but problem now is that page loading takes really long... it takes atleast 14 seconds for the status box to show... so i do not think that is a solution...
Isnt there a way where the filter is just shown to admins and not to normal users and that i will just take controle in the back-end for it?
Hi, Cynthia.
That's a bit strange as when I log in I see stream with post box right away.
Could you check on different device?
edit :D it works :) and i see only my friends with test account. Maybe because i was looking with admin account that i still saw also non-friends?
In safari it loads instantly... in chrome it doesnt... there is takes a long time...