By Steven Koontz on Monday, 23 April 2018
Posted in General Issues
Replies 5
Likes 0
Views 715
Votes 0
Hi.

In both groups and events I need to show the "Create Announcement" link directly in the group/event menu. Right now it is hidden in the drop-down to the right of the cover. I want to be able to put the link shown in the screenshot into the the group toolbar (where the red arrow is pointing).

In /components/com_easysocial/themes/wireframe/helpers/cover/group.php I have found the following code:


<?php foreach ($apps as $app) { ?>
<li class="<?php echo $active == 'apps.' . $app->element ? 'is-active' : '';?>">
<a href="<?php echo $group->getAppsPermalink($app->getAlias());?>" class="es-profile-header-nav__dropdown-link">
<?php echo $app->getAppTitle(); ?>
</a>
</li>
<?php } ?>


However, I do not need the for each. I only need to echo the "Create Announcement". Can you point me to the place in the file system where this link is generated? So that I can echo only that app and none of the other ones. Thanks!
Hi there,

You can codes below and see how it goes.

[gist type="php"]
<?php foreach ($apps as $app) { ?>
<?php if ($app->element == 'news') { ?>
<div class="es-profile-header-nav__item">
<a href="<?php echo $group->getAppsPermalink($app->getAlias()); ?>" class="es-profile-header-nav__link">
<span><?php echo $app->getAppTitle(); ?></span>
</a>
</div>
<?php } ?>
<?php } ?>
[/gist]
·
Tuesday, 24 April 2018 12:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for that, but it is not the link I am looking for. I am looking for the link to the new announcement form, to create a new announcement. The one in the hidden menu under the dots to the right of the cover, titled "New Announcement". The one with language string "APP_GROUP_NEWS_NEW". Please look at the screenshot again.

On the Announcements page itself there is a button with this code:


<a href="<?php echo ESR::apps(array('layout' => 'canvas', 'customView' => 'form', 'uid' => $cluster->getAlias(), 'type' => $cluster->getType(), 'id' => $app->getAlias()));?>" class="btn btn-es-primary btn-block t-lg-mb--xl">
<?php echo JText::_('APP_GROUP_NEWS_NEW'); ?>
</a>


However, on the Groups page that code causes a call to null on getAlias.

All I need to do is to show that "New Announcement" link directly in the Group toolbar.
·
Tuesday, 24 April 2018 20:50
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

Can you try codes below and see how it goes.
[gist type="php"]
<?php foreach ($apps as $app) { ?>
<?php if ($app->element == 'news') { ?>
<div class="es-profile-header-nav__item">
<a href="<?php echo FRoute::apps( array( 'layout' => 'canvas' , 'customView' => 'form' , 'uid' => $group->getAlias() , 'type' => SOCIAL_TYPE_GROUP , 'id' => $app->getAlias() ) );?>" class="es-profile-header-nav__link"><span><?php echo $app->getAppTitle(); ?></span></a>
</div>
<?php } ?>
<?php } ?>
[/gist]
·
Wednesday, 25 April 2018 11:56
·
0 Likes
·
0 Votes
·
0 Comments
·
Perfect! That's exactly what I was looking for. I was also able to do this for Event announcements. Thanks!

I am sure I will be moving some more links around and this is pretty easy modifications. So to not bother you anymore with this, could you just point me to the general area of the filesystem where these links are generated? Must be some kind of controller but I haven't been able to find them.
·
Wednesday, 25 April 2018 19:45
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

Some of them should render differently, but based on your requirement on announcement, this where you can refer to media/com_easysocial/apps/group/news/themes/default/widgets/widget.menu based on each apps, there should be widget views.

Hope this helps.
·
Thursday, 26 April 2018 10:49
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post