By Philippe on Saturday, 11 November 2017
Posted in Technical Issues
Replies 12
Likes 0
Views 688
Votes 0
Hello,

For the moment we can not rearrange the order of the elements/applications in the Navigation bar, nor in the Story.
Although apparently you plan to revisit this in the future (see attachment).

However it is important for me that EasyBlog App and EasyDiscuss App are in the foreground of Navigation Bar and Story.
Can you tell me which files should I change for User, Page and Group Pages ?


Thank you very much,
Philippe
This is the files involved to populate these app in the story form.

JoomlaFolder/components/com_easysocial/themes/wireframe/story/default.php (theme layout)

JoomlaFolder/administrator/components/com_easysocial/includes/story/story.php (html function > then it call the prepare function)



// StoryAttachment service
$panels = $dispatcher->trigger($this->type, 'onPrepareStoryPanel', $args);

if ($panels) {
foreach ($panels as $panel) {
if ($panel === false) {
continue;
}

if ($panel instanceof SocialStoryPanel) {

// Check for specific panel
if ($panelType) {
if ($panel->name == $panelType) {
$this->panels = array($panel);
$this->plugins = array($panel);
}
} else {
if (in_array($panel->name, $this->priorityPanels)) {
$this->panelsMain[] = $panel;
} else {
$this->panelsSecondary[] = $panel;
}

$this->plugins[] = $panel;
}
}
}
}


These following files use to display user profile/group/event/page header navigation :
JoomlaFolder/components/com_easysocial/themes/wireframe/helpers/cover/user.php
JoomlaFolder/components/com_easysocial/themes/wireframe/helpers/cover/group.php
JoomlaFolder/components/com_easysocial/themes/wireframe/helpers/cover/event.php
JoomlaFolder/components/com_easysocial/themes/wireframe/helpers/cover/page.php


JoomlaFolder/administrator/components/com_easysocial/includes/template/helpers/cover.php
Method :
- user
- group
- event
- page
·
Monday, 13 November 2017 10:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you Arlex.

I did a few tests, and I ended up getting some small things by adapting the code.

Here is what I inserted after "About" in the file : /components/com_easysocial/themes/wireframe/helpers/cover/group.php

<?php if ($apps) { ?>
<?php foreach ($apps as $app){ ?>
<div class="es-profile-header-nav__item <?php echo $active == 'info' ? 'is-active' : '';?>">
<a href="<?php echo $group->getAppsPermalink($app->getAlias());?>" class="es-profile-header-nav__link"><span><?php echo $app->getAppTitle(); ?></span></a>
</div>
<?php } ?>
<?php } ?>


My question is how to specifically display the Blog and EasyDiscuss App ?
Because here it shows the list of all Apps. See screenshot attached.

Thank you Arlex for your help.
Philippe
·
Wednesday, 15 November 2017 05:11
·
0 Likes
·
0 Votes
·
0 Comments
·
You can take a look of my attached screenshot below, i think you can use array sorting to re-arrange which app should render first.

You can learn more from http://php.net/manual/en/array.sorting.php
·
Wednesday, 15 November 2017 09:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks Arlex.

I spent hours researching and trying.
But I did not really succeed.

The simplest solution I found for posting a Blog link in the navigation bar is:
In /components/com_easysocial/themes/wireframe/helpers/cover/group.php
Insert

<div class="es-profile-header-nav__item <?php echo $active == 'apps' || $isAppActive ? 'is-active' : '';?>">
<a href="<?php echo $group->getAppPermalink('blog');?>" class="es-profile-header-nav__link"><span><?php echo JText::_('Blog');?></span></a>

</div>


But I have a problem.
If the visitor visits an App Page (among the Dropdown), my Blog link is also underlined.


According to you, how to specify the Blog Application in the line :

<?php echo $active == 'apps' || $isAppActive ? 'is-active' : '';?>

To make sure that my Blog link is underlined when I'm only on the Blog App.

See screenshots in attachments.

I thank you very much.
Philippe
·
Monday, 20 November 2017 02:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes, by default it will highlighted that "Show more" link as well because inside this "show more" link div wrapper did check whether you current view that is under app or not.

Since you display your blog link beside the "About" link, you have to skip that blog app shouldn't render inside the "Show more", you can refer on my attached screenshot below.

Hope this will help.
·
Monday, 20 November 2017 10:14
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you very much Arlex for your precious help !!
All is almost as i want now

One last thing before closing this post.
The code used for Groups, Pages, and Events does not work for Profiles (Users Pages).

To manually integrate the two links for EasyBlog User App and EasyDiscuss User App, I tried the following lines but it does not work.

[gist type="php"]
<div class="es-profile-header-nav__item <?php echo $active == 'apps.blog' ? 'is-active' : '';?>">
<a href="<?php echo $user->getAppPermalink('blog');?>" class="es-profile-header-nav__link"><span><?php echo JText::_('Blog');?></span></a>
</div>

[/gist]

[gist type="php"]
<div class="es-profile-header-nav__item <?php echo $active == 'apps.blog' ? 'is-active' : '';?>">
<a href="<?php echo $profile->getAppPermalink('blog');?>" class="es-profile-header-nav__link"><span><?php echo JText::_('Blog');?></span></a>
</div>
[/gist]

[gist type="php"]
<div class="es-profile-header-nav__item <?php echo $active == 'blog' ? 'is-active' : '';?>">
<a href="<?php echo ESR::blog(array('uid' => $user->getAlias(), 'type' => SOCIAL_TYPE_USER));?>" class="es-profile-header-nav__link"><span><?php echo JText::_('Blog');?></span></a>
</div>
[/gist]

Can you help me Arlex please ?
After it's over.

Thank you again,
Philippe
·
Friday, 24 November 2017 00:38
·
0 Likes
·
0 Votes
·
0 Comments
·
You can try use this following code :

[gist type="php"]
<?php
// 247 refer your current user blog app id
$blogUserApp = ES::app(247);
$bloglink = ESR::profile(array('id' => $user->getAlias(), 'appId' => $blogUserApp->getAlias()));
?>

<div class="es-profile-header-nav__item <?php echo $active == 'apps.blog' ? 'is-active' : '';?>">
<a href="<?php echo $bloglink;?>" class="es-profile-header-nav__link"><span><?php echo JText::_('Blog');?></span></a>
</div>
[/gist]
·
Friday, 24 November 2017 11:10
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post