MyBB Community Forums

Full Version: Persistent Announcement for Portal
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I like the idea of the portal and am considering using it as the front page for my site. However, I'd like the first announcement to be a sticky of some kind that describes what the site is all about. Unfortunately 'stickies' don't appear at the top of the announcements in the portal view.

Another alternative is to have some other kind of fixed content to go above the Announcements but I'd need it in the same style as the other boxes. I've looked for, but can't find, a plug-in to do this.

Is it a relatively simple exercise to take the code for $announcements and modify it, calling it say '$about', to drop into the portal template or am I being a bit ambitious for somebody new to MyBB and PHP?

Thanks

David
I'd simply recommend copying the contents of the portal_announcement template (hope I got the name right) and paste it into the portal template, replacing some of the variables with your own stuff.
(2008-07-29, 06:25 AM)ZiNgA BuRgA Wrote: [ -> ]I'd simply recommend copying the contents of the portal_announcement template (hope I got the name right) and paste it into the portal template, replacing some of the variables with your own stuff.
I guessed that this would be the way to do it but what I haven't yet figured out is the relationship between variable names like $announcements and the actual template used like portal_anouncement - is there a lookup table somewhere or is there something in-between that connects the two together? The same applies to other areas of myBB. It's one of the mysteries I haven't worked out yet.

David
Hi, i think you mean something like this.

Open up your Portal template.

Find
<td valign="top">

Replace with
<td valign="top">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead"><strong>Box heading here</strong></td>
</tr>
<tr>
<td class="trow1">Box content here</td>
</tr>
</table>
<br />

Then find and delete
<td>&nbsp;</td>
That seems to be an easy and neat solution - thanks Darren.
(2008-07-29, 08:16 AM)SteelD Wrote: [ -> ]
(2008-07-29, 06:25 AM)ZiNgA BuRgA Wrote: [ -> ]I'd simply recommend copying the contents of the portal_announcement template (hope I got the name right) and paste it into the portal template, replacing some of the variables with your own stuff.
I guessed that this would be the way to do it but what I haven't yet figured out is the relationship between variable names like $announcements and the actual template used like portal_anouncement - is there a lookup table somewhere or is there something in-between that connects the two together? The same applies to other areas of myBB. It's one of the mysteries I haven't worked out yet.

David
{$announcment[]} is an array containing details of the announcement.

Basically, the portal_announcement template is called each time an announcement is to be displayed. For example, if we have 3 announcements on the portal, we'd have portal_announcment called 3 times, and stored into the {$announcement} variable. After this, the portal template is called, and, as you may be able to see, the accumulated announcements are put into the template.

Hope that helps.
(2008-07-30, 01:51 AM)ZiNgA BuRgA Wrote: [ -> ]{$announcment[]} is an array containing details of the announcement.

Basically, the portal_announcement template is called each time an announcement is to be displayed. For example, if we have 3 announcements on the portal, we'd have portal_announcment called 3 times, and stored into the {$announcement} variable. After this, the portal template is called, and, as you may be able to see, the accumulated announcements are put into the template.

Hope that helps.
I had guessed that that was the case. My question was more of - where do I find out what functions/variables like {$announcement} call what templates like portal_announcement? In other words, where is the link between them in case I want to modify other behaviours and need to establish what templates are being used?
If I understand you correctly, you'll have to look at the code in portal.php

Do a search for:
$templates->get("portal_announcement")