I pushed some changes to WebHelpers 0.6-dev that may affect those
using the new helpers.
*** NO MORE MAGIC URLS ***
webhelpers.html.tags:
image()
javascript_link()
stylesheet_link()
auto_discovery_link()
webhelpers.html.tools:
button_to()
These functions no longer do magic on their URL arguments; they output
the exact URL given. Previously they called Routes to get the site
prefix, and implicitly added prefixes like "/images/" and suffixes
like ".css".
This eliminates a fragile Routes dependency in WebHelpers, and a
compatibility issue with the upcoming Routes 2. So you should call
url_for on all your URL arguments, same as you already do with
link_to() and everywhere else you have a URL. Example:
h.stylesheet_link(h.url_for("/stylesheets/default.css"))
This may look a bit verbose but it's only temporary. Routes 2 will
replace ``h.url_for`` with a ``url`` object that's automatically
exported to the templates. (WebHelpers 0.6 will be in the imminent
Pylons 0.9.7 release. Routes 2 is scheduled for Pylons 0.9.8.)
The Rails helpers have not been changed. So the only Routes
dependencies remaining in WebHelpers are in Paginate, Pagination
(deprecated), and Rails (deprecated).
*** IMAGE ALT ATTRIBUTE ***
Perhaps more controversially, I made the 'alt' argument to image() a
mandatory positional arg. In this age of accessibility, there's no
reason to leave these out or let them default to "GreenIcon".
Previously it invented a default alt value based on the filename stem
capitalized.
You can pass "" or None to get a blank alt attribute (alt=""), but at
least you're making a conscious choice to do this, and also
documenting in the template that this image has no semantic value and
is pure decoration.
*** SELECT() WITH INT VALUES ***
select() now handles int values and implicitly converts them to
strings for HTML. This allows you to link a select pulldown to an int
database value, and to use ints in your options lists. Thanks to
Christoph Haas for this patch, which helps my applications too.
--
Mike Orr <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---