Some questions
-
Hey all, this is mainly aimed at @psychobunny, but if anyone else knows the answer to this question I'd be glad to hear from you, pointing at @trevor and @a_5mith
How does one go about placing custom widgets with custom widget areas, specifically on the forums page? I have tried numerous attempts to do so but have not yet figured it out. I set the widget-area and altered the theme.js file but when I place widgets there in the ACP I get nothing. Could it have something to do with the custom-homepage plugin overriding the home.tpl template?
-
Could it have something to do with the custom-homepage plugin overriding the home.tpl template?
Perhaps, but I'm not totally sure.
The way I place widgets is I just take whatever is a widget template and copy and paste it into one of the main theme templates such as
topic.tpl
orcategory.tpl
.So for example, the popular tags widget (which I have not used yet but will soon), looks like this.
<!-- BEGIN tags -->
<a href="{relative_path}/tags/{tags.value}" class="pull-left">
<h4>
<span class="label label-info">{tags.value}</span>
<small>x</small><span class="tag-topic-count">{tags.score}</span>
</h4>
</a>
<!-- END tags -->
I take that and place it somewhere (anywhere) I want it to render in a template.
-_-
Another example is using the
widget-area
as shown here using the "active users" widget (this is forcategory.tpl
);And the HTML is as simple as this;
<div class="category-active-users">
<div widget-area="sidebar"></div>
</div>Whatever is placed in widget area named "Sidebar" in the ACP, is what will render here. For this I have simply used the "Active Users" widget block as shown below.
All in all, its a matter of preference of how you want to do things.