• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XenForo News Feed (adding recent activity to a different place)

Cryptaline

Active member
#1
On each page refresh Recent activity is hidden (first screen)
I want to dispay it always. (second screen)

Question is, which template I'm missing.

Right now I'm using templates from news_feed_page_global:
<xen:include template="news_feed">
<xen:set var="$noContentHtml">{xen:phrase news_feed_is_currently_empty}</xen:set>
</xen:include>
<xen:include template="news_feed_end">
<xen:set var="$itemLoaderUrl">{xen:link recent-activity}</xen:set>
</xen:include>
and it looks like this (right-top corner):
social-top.png

and thats how i want to display it:


social-top.png
 

Attachments

Cryptaline

Active member
#3
I'm using page_container to dispay news feed on all pages.
This looks like this:

cusom header body hook then I'm adding this code to the place where i want to display it & body templates after:

<!--eden galaxy -->
<div id="e_g"><div class="g_newsfeed"><div class="activity">

<xen:require js="js/xenforo/news_feed.js" />
<div class="newsFeed">


<xen:include template="news_feed_end">
<xen:set var="$itemLoaderUrl">{xen:link recent-activity}</xen:set>
</xen:include>

<xen:include template="preview_tooltip" />
</div>


</div></div>
I know i need to add smth above news_feed_end to show all recent activity without clicking on a "news_feed_end" but can not find template whic will help to do so :coffee:
 

Cryptaline

Active member
#4
Which template is including the news_feed template? On which page?
I ve added this in to my own div class so there are no other connected templates to news_feed template. If we will "delete" all my custom ids & classes, <xen:hook name="body"> will be above news_feed template only.
 

Jake Bunce

XenForo moderator
Staff member
#5
Something custom then? There are normally no news feed items available in the container. You would need an addon for this.
 

Cryptaline

Active member
#7
Changing code to:


<xen:require css="events.css" />
<xen:require css="news_feed.css" />
<xen:require js="js/xenforo/news_feed.js" />

<div class="newsFeed">

<xen:include template=" news_feed " />

<xen:include template="news_feed_end">
<xen:set var="$itemLoaderUrl">{xen:link recent-activity}</xen:set>
</xen:include>

<xen:include template="preview_tooltip" />
</div>
gives only result which you can see on the first screen. By some reason it wont to show <xen:include template=" news_feed " /> content which looks like this:

<xen:require css="events.css" />
<xen:require css="news_feed.css" />
<xen:require js="js/xenforo/news_feed.js" />

<xen:if is="{$newsFeed}">
<ol class="eventList">
<xen:foreach loop="$newsFeed" value="$item">
<xen:include template="news_feed_item">
<xen:set var="$itemTemplate">{xen:raw $item.template}</xen:set>
<xen:set var="$itemDate">{$item.event_date}</xen:set>
</xen:include>
</xen:foreach>
</ol>
<xen:else />
{xen:raw $noContentHtml}
</xen:if>
I will really apreciate any adea/tip why it's showing only


<xen:include template="news_feed_end">
<xen:set var="$itemLoaderUrl">{xen:link recent-activity}</xen:set>
</xen:include>
and don't want to show
<xen:include template=" news_feed " />
 

Jake Bunce

XenForo moderator
Staff member
#10
Because the news feed items are not available to the container. You need to create a listener for the container_public_params event to add the news items as one of the params. That will allow you to display the news_feed in the container.