By Philippe on Sunday, 25 March 2018
Posted in Technical Issues
Replies 13
Likes 0
Views 494
Votes 0
Hello,

I would like to change default page when we click on Pages and Groups links on User Dropdown App Menu.

And for example that the url : http://easysocial.stackideas.com/pages/584-sophia/pages
Point to : http://easysocial.stackideas.com/pages/584-sophia/pages/participated

Instead of http://easysocial.stackideas.com/pages/584-sophia/pages/created

Same thing for Groups.

Please, can you enlighten me and tell me what file I have to change ?

Thank you,
Philippe
You could modify it in the template file /components/com_easysocial/themes/wireframe/helpers/cover/user.php but it is a little tricky because it is iterating through the list of available apps.

Current:


<?php if ($appsDropdown && $this->config->get('users.layout.sidebarapps')) { ?>
<?php foreach ($appsDropdown as $app) { ?>
<li class="<?php echo $active == $app->active ? 'is-active' : '';?>">
<a href="<?php echo $app->permalink;?>" class="es-profile-header-nav__dropdown-link" title="<?php echo $app->pageTitle; ?>">
<?php echo $app->title; ?>
</a>
</li>
<?php } ?>
<?php } ?>



Example modification:


<?php if ($appsDropdown && $this->config->get('users.layout.sidebarapps')) { ?>
<?php foreach ($appsDropdown as $app) { ?>
<?php
if ($app->active == 'pages') {
$app->permalink = ESR::pages(array('userid' => $user->getAlias(), 'layout' => 'participated'));
}
?>
<li class="<?php echo $active == $app->active ? 'is-active' : '';?>">
<a href="<?php echo $app->permalink;?>" class="es-profile-header-nav__dropdown-link" title="<?php echo $app->pageTitle; ?>">
<?php echo $app->title; ?>
</a>
</li>
<?php } ?>
<?php } ?>
·
Sunday, 25 March 2018 22:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Sorry but it doesn't work. It generated an error.

There must be errors in the following lines:

<?php
if ($app->active == 'pages') {
$app->permalink = ESR:ages(array('userid' => $user->getAlias(), 'layout' => 'participated'));
}
?>


Thank you
Philippe
·
Wednesday, 04 April 2018 23:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Philippe,

Seems like there is typo there where is suppose:
[gist type="php"]
ESR::pages
[/gist]
·
Thursday, 05 April 2018 14:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes it works better now.

But now, here is the url that I have when I click in Dropdown pages :
domain.com/pages/philippe/pages/COM_EASYSOCIAL_ROUTER_PAGES_LAYOUT_PARTICIPATED

An idea to replace COM_EASYSOCIAL_ROUTER_PAGES_LAYOUT_PARTICIPATED ?

Thank you,
Philippe
·
Thursday, 05 April 2018 17:41
·
0 Likes
·
0 Votes
·
0 Comments
·
Ops, can you change the
[gist type="php"]
'layout' => 'participated'
[/gist]
to
[gist type="php"]
'filter' => 'participated'
[/gist]
and see how it goes?
·
Thursday, 05 April 2018 18:49
·
0 Likes
·
0 Votes
·
0 Comments
·
It works perfectly now ! Thanks Fadhli for your precious help

To conclude, here is the final code :
[gist type="php"]
<?php
if ($app->active == 'pages') {
$app->permalink = ESR::pages(array('userid' => $user->getAlias(), 'filter' => 'participated'));
}
?>
[/gist]
Philippe
·
Thursday, 05 April 2018 19:50
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome Philippe Glad to hear your issue has resolved.

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.

Thanks for understanding and have a nice day ahead
·
Friday, 06 April 2018 10:09
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post