[pmwiki-users] adding a class to a form
Petko Yotov
5ko at 5ko.fr
Mon Nov 11 05:54:48 CST 2013
No, not simply for any attribute and any tag. The (:div:) and (:table:)
markups allow inserting any attributes except onclick and similar.
Other tags are processed differently. While there may be a way to define
and set additional attributes, this in no way would be simple and/or
maintainable.
OTOH some of these frameworks don't have hard-coded reqirements for
attributes. It should be possible to configure them to select tags with a
certain class instead of tags with a certain data-* attribute (easier than
introducing more complexity in pmwiki markup).
Even if it is hardcoded, as you use jQuery, you can write a simple function
that would find these tags based on their class or parent class, and insert
the required attributes in them: $('h4.page').data('role', 'page'); will
insert the data-role="page" attribute in all H4 headings with the class
"page". In wiki markup this is done by
!!!! Heading %block page%
This may be a fun learning exercice to which some time could be devoted. :-)
Petko
Brian Tibbels writes:
> Haha! Yes I already use that for the really tricky layouts such as adding an
> <h4> embedded in a link <a> :| but I was just thinking for pmWiki to
> integrate with common (and popular) frameworks there are plenty of attributes
> that need to be added. If it is as simple as the example you previously sent
> then they could be encapsulated in a Bootstrap or jqueryui cookbook can it
> not?. Can it be done simply? - I have some time I could devote to it.
>
> On 11 November 2013 09:05, Petko Yotov <<URL:mailto:5ko at 5ko.fr>5ko at 5ko.fr>
> wrote:
>
> Brian Tibbels writes:
> « HTML content follows »
>
> Many thanks Petko - how feasible is it to allow any attribute
> regardless, in the way that html tags work so that any attribute can be
> added to any tag?
>
> You probably want
> <URL:http://www.pmwiki.org/wiki/Cookbook/EnableHTML>http://www.pmwiki.org/
> wiki/Cookbook/EnableHTML .
>
> Petko
More information about the pmwiki-users
mailing list