Comments

amateescu’s picture

Status: Active » Needs review
StatusFileSize
new7.23 KB

Here's the first try at implementing a configuration page.

Things I'd like to discuss further:

  • Is admin/config/system/html5_tools an acceptable path for this page?
  • Should we provide checkboxes for the html5 widgets?
  • Everything else I might have missed..

But, most important of all, I would really like some help with texts and descriptions :)

johnalbin’s picture

Instead of admin/config/system/html5_tools (always replace underscores with dashes in paths, btw), how about admin/structure/markup?

jensimmons’s picture

I don't think it goes under admin/structure. This isn't like the other things that are there:

Only local images are allowed. make a new panel
make a new view
a new content type
taxonomy vocab or term
a new forum
a new trigger....
etc

or configure/edit/change the existing ones

we aren't having people "make
new markup", they are configuring
what already exists.
It's Configuration, not Structure.
"/>

I think it's even more clear when you click on any of these things listed under structure — basically they all have pages that look like this, with a list of existing Things, and an 'add' button to make more.

Only local images are allowed.

(Triggers is an exception to this rule, but you could argue that Triggers config screen is designed wrong, and should be redone to match the D7 UX.)

jensimmons’s picture

Debating this with amateescu, we are putting the configuration of HTML5 Tools under Config. Here:

Only local images are allowed.

amateescu’s picture

New patch that changes the path to admin/config/markup/html5-tools and the module description text.

amateescu’s picture

Sorry, forgot to include html5_tools.admin.inc

amateescu’s picture

And, finally, here is the final patch!

amateescu’s picture

I think git is playing tricks on me. Another try :)

jensimmons’s picture

Status: Needs review » Reviewed & tested by the community

So this patch applies nicely.

It creates a new box on the Admin Config page:
Only local images are allowed.
With this text:

HTML5 Tools
Implement HTML5 forms. Simplify Drupal's default markup for HTML  and author information, converting it to the HTML5 standard. Works with any theme.

Then when you click on the title, you go to admin/config/markup/html5-tools and see a configuration screen for this module.
Only local images are allowed.

There's an extra period in "check out these resources.:" — I removed it.

"Alter publication date and author markup" — doesn't alter anything regarding the author. I'll remove that and make it "Alter publication date markup".

"…join the movement of using Drupal to create HTML5" should be "of people" or just "movement using".

Ok, I'm going to push this code. We can keep talking about it / reopen to fix it up more. I'd really love a doc team review! But meanwhile, I don't think it hurts to push what we have so far.

jensimmons’s picture

I would like to add links to a resource explaining each item. Perhaps something at Dive into HTML5.

jensimmons’s picture

Status: Reviewed & tested by the community » Fixed
jensimmons’s picture

Status: Fixed » Needs work

Ok, so let's add links to resources. And more importantly, let's add something here about the Forms!

Bojhan’s picture

The IA placement is correct, hurray! :)

On admin/config, the text is a bit cryptic as it goes into detail on what the module does - how about "Configure how HTML5 markup is applied to your site."

ericduran’s picture

+++ html5_tools.installundefined
@@ -10,6 +10,12 @@
+  variable_set('html5_tools_override_style_tags', 1);
+  variable_set('html5_tools_override_script_tags', 1);
+  variable_set('html5_tools_override_meta_tags', 1);

+++ html5_tools.moduleundefined
@@ -70,13 +110,13 @@ function html5_tools_field_widget_error($element, $error, $form, &$form_state) {
   // Cleanup markup by removing obsolete attributes.
-  if ($variables['element']['#tag'] == 'style') {
+  if (($variables['element']['#tag'] == 'style' || $variables['element']['#tag'] == 'link') && variable_get('html5_tools_override_style_tags', '')) {
     unset($variables['element']['#attributes']['type']);
   }
-  if ($variables['element']['#tag'] == 'script') {
+  if ($variables['element']['#tag'] == 'script' && variable_get('html5_tools_override_script_tags', '')) {
     unset($variables['element']['#attributes']['type']);
   }
-  if ($variables['element']['#tag'] == 'meta' && isset($variables['element']['#attributes']['http-equiv']) && $variables['element']['#attributes']['http-equiv'] == 'Content-Type') {
+  if ($variables['element']['#tag'] == 'meta' && isset($variables['element']['#attributes']['http-equiv']) && $variables['element']['#attributes']['http-equiv'] == 'Content-Type' && variable_get('html5_tools_override_meta_tags', '')) {
    $variables['element']['#attributes'] = array(
      'charset' => 'utf-8',

Most of the variable_gets should be before type/tags checks because they will short-circuit the evaluation :)

+++ html5_tools.admin.incundefined
@@ -0,0 +1,72 @@
+    '#default_value' => variable_get('html5_tools_override_script_tags', ''),

The default section for all the variable gets should be 0 instead of ''.

+++ html5_tools.admin.incundefined
@@ -0,0 +1,72 @@
+  $form['html5_tools_references'] = array(
+    '#markup' => t('<p>To learn more about HTML5, and to join the movement of using Drupal to create HTML5 websites, check out these resources.:</p>
+      <ul>
+        <li><a href="http://diveintohtml5.org/">Dive Into HTML5</li>
+        <li><a href="http://html5doctor.com/">HTML5 Doctor</li>
+        <li><a href="http://drupalradar.com/video-jeremy-keith-keynote-session">Jeremy Keith Keynote Session at Drupalcon Copenhagen</li>
+        <li><a href="http://groups.drupal.org/html5">Drupal HTML5 Group</li>
+      </ul>'),

Idk about these links. Maybe they're great resources but I don't think they belong in the module.

Powered by Dreditor.

amateescu’s picture

Status: Needs work » Needs review
StatusFileSize
new3.21 KB

Quick patch for eric's suggestions in #14.

amateescu’s picture

And Bojhan's in #13 :)

ericduran’s picture

The last patch looks good to me.

The links I mention as a question. Maybe Jen can chip in on her thought about the links. I'm ok with leaving them or removing them I just felt weird with them in the module.

amateescu’s picture

Well, she wanted those links in the first place :) I'll leave them alone until something else is decided. Also, I forgot to change variable_get's from the configuration form.

amateescu’s picture

I'm posting here a new patch for #1076512: HTML tools options screen error because we are already fixing some things from the config screen in this issue.

amateescu’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.