[bbDev] AJAX and markup in bbPress
Michael D Adams
mikea at turbonet.com
Sun Aug 21 19:15:43 GMT 2005
bbPress is now using some AJAX code for changing certain topic
properties on the fly. Using this method means the page does not
have to refresh every time a new tag is added (for example). That
reduces bandwidth consumption and, more importantly, generates fewer
SQL queries.
Everything (up until that last couple changesets) has been tested in
FF, Safari, Opera/Mac, IE6 and it all seems to work. I'll double
check the most recent code sometime over the next few days.
What does this mean for the end user? Just one thing: the inner
workings of bbPress are now tied to the markup in your templates.
The javascript knows what to do only because of certain id attributes
on various markup tags. My hope is that any template customization
can be done *solely* through CSS; if people need better markup, let
us know and we can work on giving you what you need as the default
(also, let us know what kind of action hooks would be useful in the
templates).
If you ARE using custom templates, the AJAX *will not* work unless
your markup includes the following ("*" means "whatever element you
like should work here"):
<* id="resolutionflipper">This topic is <?php topic_resolved(); ?></*>
for the topic resolution notice/dropdown.
<* id="favoritestoggle"><?php user_favorites_link() ?></*>
for the add to/remove from favorites link.
and all the IDs and hierarchy intact from bb-templates/topic-tags.php
and bb-tempaltes/tag-form.php.
Michael
More information about the bbDev
mailing list