I have a problem with widget. I'm using Ultimate cool theme 2.1.1 (WISB), and I can add widget to dashboard, it appears but doesn't work, althought it works well in profile page, group page... How can I fix it?!
Below is my dashboard.php file in WISB/pages folder.
<?php
gatekeeper();
$user = elgg_get_logged_in_user_entity();
elgg_set_page_owner_guid($user->guid);
$title = elgg_echo('newsfeed');
$composer = elgg_view('page/elements/composer', array('entity' => $user));
$db_prefix = elgg_get_config('dbprefix');
$activity = elgg_list_river(array(
'joins' => array("JOIN {$db_prefix}entities object ON object.guid = rv.object_guid"),
'wheres' => array("
rv.subject_guid = $user->guid
OR rv.subject_guid IN (SELECT guid_two FROM {$db_prefix}entity_relationships WHERE guid_one=$user->guid AND relationship='follower')
OR rv.subject_guid IN (SELECT guid_one FROM {$db_prefix}entity_relationships WHERE guid_two=$user->guid AND relationship='friend')
"),
));
$options = array();
$page_type = preg_replace('[\W]', '', get_input('page_type', 'all'));
$type = preg_replace('[\W]', '', get_input('type', 'all'));
$subtype = preg_replace('[\W]', '', get_input('subtype', ''));
if ($subtype) {
$selector = "type=$type&subtype=$subtype";
} else {
$selector = "type=$type";
}
if ($type != 'all') {
$options['type'] = $type;
if ($subtype) {
$options['subtype'] = $subtype;
}
}
switch ($page_type) {
case 'mine':
$title = elgg_echo('river:mine');
$page_filter = 'mine';
$options['subject_guid'] = elgg_get_logged_in_user_guid();
break;
case 'friends':
$title = elgg_echo('river:friends');
$page_filter = 'friends';
$options['relationship_guid'] = elgg_get_logged_in_user_guid();
$options['relationship'] = 'friend';
break;
default:
$title = elgg_echo('river:all');
$page_filter = 'all';
break;
}
$activity = elgg_list_river($options);
if (!$activity) {
$activity = elgg_echo('river:none');
}
$content = elgg_view('core/river/filter', array('selector' => $selector));
//$sidebar = elgg_view('core/river/sidebar');
$params = array(
'title' => $title,
'content' => $composer . $content . $activity,
//'sidebar' => $sidebar,
//'filter_context' => $page_filter,
'class' => 'elgg-river-layout',
);
elgg_set_page_owner_guid(1);
$content = elgg_view_layout('two_sidebar', $params);
echo elgg_view_page($title, $content);
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
After
Add this
Thanks RvR, but there's another problem.
Before I edit the code: the "Add widget" button only appears for admin, not for all user. The widget appears but it doesn't work, nothing in content.
After I edit the code: the "Add widget" button appears, widget appears and works well, but the old widget column still appears.
As you can see in these images above, now I want to replace the box 2 by the box 1, and show the "Add widget" button for all user, not only admin. Thank you.
Thank you RvR but it doesn't work. There's still two column, nothing changes. The column1 is within <div class="elgg-body elgg-main">, and the column2 is within <div class="elgg-sidebar-alt">. Can you help me, please?!
If you want to show your widgets on sidebar then try it:
After
Add this
I can't test it now but should be work
BTW, better if you'll make
with
then into aboving code change on
Thanks RvR. I think I didn't provide enought information for you. I'm using Ultimate cool theme, and it uses two sidebar layout, so it has a sidebar on the left, and a sidebar_alt on the right.
First the widgets appear on the sidebar_alt div tag, but they don't work. After I change the code, they appear within both the body and the sidebar_alt tag.
I don't know how widget appears before I change my code. It still appears but doesn't work.
Beside that, there's a file named sidebar_alt.php in the folder mod\WISB\views\default\page\elements contents code below:
Hope you understand clearly my problem. I really confused about it.
You can change 'sidebar' on 'sidebar_alt'
Or edit your sidebar_alt.php in mod\WISB\views\default\page\elements with
If this then no need to create views\default\pages\sidebar\widgets.php
Thanks RvR. I try and it still doesn't work. So complicated. Now the widget appears within the sidebar_alt tag, but it still doesn't work. You can see in the image below. I try all of what you said. I think we have to remove the old sidebar_alt but I don't know how to do that. Can you help me to fix it?
//Sorry for my bad English :D
Sounds like FB Theme's Issue with Widgets
I'll try your theme now. Wait my answer soon ;)
- Previous
- 1
- 2
- Next
You must log in to post replies.