<span class="SomeName"> doesn't work with Blocked elements
daneesia - March 22, 2008 - 19:55
| Project: | Glossary |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | mwrochna |
| Status: | closed |
Description
Example:
In .css file
.noStyle {
}In "Blocked elements" (filtered and full)
acronym h1 h2 h3 h4 h5 h6 a noStyle li
#1
I'm not sure what you're getting at here. "noStyle" is not an HTML element, therefore it shouldn't be in that list. What is it that you are trying to accomplish?
#2
Correct.
I am simply trying to use a style defined in a CSS file as a "blocked element" so I can exclude common words that are in the glossary when they do not apply.
For example, if my glossary term is "Foo" and I have a sentence "Foo is to Bar as Bar is to Foo", I may not want one or either of these to appear as a glossary entry, so I would like to do something to exclude them like:
<p>Foo is to Bar as Bar is to <span class="noStyle">Foo</span></p>In the above example, the idea is to show the glossary entry for the first occurrence of "Foo" but omit it for the second occurrence.
Now that I think of it, this might need to be re-filed as a feature request because that does not appear to be the intent.
#3
Why not try doing it this way: http://drupal.org/node/201763#skipping
#4
Yes this will work as work around, but I am still changing this to a feature request as it is still desirable to be able to use CSS styles as blocked elements as described above.
#5
http://drupal.org/node/208217
#6
I do not agree that this is a duplicate.
Marking something with
[no-glossary]mismatches[/no-glossary]is an inflexible solution.And I still feel the
<span>...</span>is both more flexible and is more ideal to address legacy HTML code where said span tags may already be in place.Also note that adding
[no-glossary]mismatches[/no-glossary]shows up in WYSIWYG plugins, which can be confusing to a person dealing with future edits.#7
I do not agree that this is a duplicate.
Marking something with
[no-glossary]mismatches[/no-glossary]is an inflexible solution.And I still feel the
<span>...</span>is both more flexible and is more ideal to address legacy HTML code where said span tags may already be in place.Also note that adding
[no-glossary]mismatches[/no-glossary]shows up in WYSIWYG plugins, which can be confusing to a person dealing with future edits.#8
Did you read "Possible approaches" and further down where the idea of spanning was dismissed in favor of what was implemented?
Right now, we have serious performance problems in that area of code and there is no way I'm going to further complicate that issue by trying to add new code.
#9
The attached patch searches for
<span class="tagand</span>when.tagis added to the 'Blocked elements'. It's certainly not making the filter any slower (except for any additional tag to search for, of course). Tested on multibyte classnames, some help/documentation should be added. Remember to allow span tags in the html filter.That's kind of a workaround - if you want to be able to have indented spans (you probably do, any
</span>inside the blocking span will immediatly end it), I can add proper support - it shouldn't make the filter slower too.But if you want a more flexible approach (i.e.
<span style="" class="anothertag tag,<anytag class="tag) an xhtml parser should probably be used, someone would have to show me a module that's using one. And that would be slower, I think.#10
Thank you again, Marcin. You're fabulous!
#11
@mwrochna: I'm marking this as PCNW because there really needs to be additional information added to the settings page. I will do that, so don't worry, Marcin. This is just to remind me to do it.
@daneesia: Since Marcin was nice enough to do this, there are certain restrictions you will need to follow:
#12
I am committing this on both -dev branches.
In addition to the above patch, I updated the description on the settings form and added a check for this in the filter tips.
#13
#14
Nancy, Marcin, thank you for implementing this. I am just now getting around to testing this out and, as far as I can tell I have followed the instructions to the letter (and cleared all the caches etc.) and still no dice on this.
Here is the HTML snippet exactly as it appears within the node:
<span class="noGlossary">Email</span>Here is my blocked elements list exactly as it appears on the filtered and full tabs:
acronym h1 h2 h3 h4 h5 h6 a .noGlossaryI copied and pasted from the blocked element list (less the period) to the node, so there is no chance of a mismatch and I cut and pasted directly from my site to here.
Oh and I grabbed the May 26th snapshot.
If there is any other information needed, please let me know.
Thanks,
Dan
#15
Please try without the capital letter. The filter translates everything to lower case before searching. Oh, and also, XHTML rules say it should be lowercase too.
#16
#17
No luck just changing the case.
#18
Hmm. Can you let me see an example, or paste some code and output here? This works fine in my site.
#19
Okay, here is the example exactly as it appears:
Blocked elements:
acronym h1 h2 h3 h4 h5 h6 a .noglossaryHTML:
<p>It is typically desirable to subscribe to a given content, such as a forum topic, so that when new information is posted, you will receive an email notification.</p><p>For content that was created by someone else, when you open the content, there will typically be a <b>Subscribe</b> link. When this link is selected, a list of methods to subscribe to the given content or similar content is provided.</p><p>Also, if you submit a comment on a given post, check the <b> <span class="noglossary">Email</span> me about replies to this comment</b> checkbox to receive emails whenever the page has been updated.</p><p>To see a list of your subscriptions and to set up general subscription preferences, select the <b>My Account</b> menu followed by the <b>Subscriptions</b> tab.</p><p>For more information, see the <a href="/Help/Subscriptions"><i>Subscriptions Help</i></a> page.</p>Output:
<p>It is typically desirable to subscribe to a given content, such as a forum topic, so that when new information is posted, you will receive an email notification.</p><p>For content that was created by someone else, when you open the content, there will typically be a <b>Subscribe</b> link. When this link is selected, a list of methods to subscribe to the given content or similar content is provided.</p><p>Also, if you submit a comment on a given post, check the <b> <a class="glossary-term" href="/glossary/term/155"><acronym title="A user's email address. It is important that this is correct as all alerts are sent to this address.">Email</acronym></a> me about replies to this comment</b> checkbox to receive emails whenever the page has been updated.</p><p>To see a list of your subscriptions and to set up general subscription preferences, select the <b>My Account</b> menu followed by the <b>Subscriptions</b> tab.</p><p>For more information, see the <a href="/Help/Subscriptions"><i>Subscriptions Help</i></a> page.</p>If there is any other information you would like me to provide, I'd be happy.
#20
I just pasted your settings and content into my test site and it worked perfectly. The "email" in
you will receive an email notification.got flagged while the "email" incheck the <b> <span class="noglossary">Email</span> medid not.What other filter modules do you use that might be interfering? Does your input format allow
<span>?#21
I just was about to submit a long response and I started playing around trying to get you more information and I finally wound up deleting the post and re-entering it and it worked like magic.
(I did have the filter set to "Full HTML" in case you are still curious.)
Must have been another glitch somewhere outside of this module.
Anyway, I marked this as fixed.
BTW: I would be happy to document this feature for you in the documentation, but I am not sure how to do that (other than just writing it up and sending it to you). If you let me know how, I'll do it. (I have to write it up anyway since I must tell the site admins how to use this feature.)
Thanks for your support.
Dan
#22
Thanks, Dan. I'm not sure why it didn't work. I tried it with "Filtered HTML" when I did it. I'm glad it's fixed for now. Feel free to reopen this if it happens again.
You can either send it to me or join the Docs team and you can edit any handbook page. I definitely appreciate help with documentation.
#23
Automatically closed -- issue fixed for two weeks with no activity.