Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By francesco_sardegna on
Good evening,
I am developing an accessible theme for Drupal 7, for an accessible front end for now.
The main problem I am facing is how to remove the line when consulting a general discussion.
It is the value of the variable $regex in comment.test (module: comment).
The line is
$regex .= 'id . '"(.*?)'; //
from the function
function commentExists($comment, $reply = FALSE)
As I don't know how to use in the navigation, how could I remove it from the template or from the template.php file?
Thanks in advance
Francesco
Comments
Comment.test is not rendered
Comment.test is not rendered (it's a simple test file), so you should not worry about it. As well as you should not modify any (core) modules directly for themeing purposes.
Most probably what you are talking about is
<?php print $permalink; ?>
in comment.tpl.php. You can just remove it.At the other hand it is there exactly for accessibility reasons so sou could save a link / access exactly *this* comment. I.e.: http://drupal.org/node/823918#comment-3073530
Cheers,
Andrey
Free and Premium Drupal Themes | Drupal Sites Showcase. Add yours! | My Blog
I have the same problem,
I have the same problem, $permalink contains a link to the comment, not anchor it.
How to rewrite the link
<a id="comment-X"></a>
and put the id on the container of the comment.Not
But
Thx
Which theme are you using? I
Which theme are you using? I don't see this anchor at all in a few I use...
Cheers,
Andrey
Free and Premium Drupal Themes | Drupal Sites Showcase. Add yours! | My Blog
Basic theme but le link <a
Basic theme but le link
<a id="comment-X"></a>
is not in the template. It's the Drupal Core that adds this line. In the comment module in the file comment.module to the line 951Oh, right :) Actually you
Oh, right :)
Actually you should not remove this anchor. It is used by many modules to get to exactly *this* comment from blocks or other pages.
Cheers,
Andrey
Free and Premium Drupal Themes | Drupal Sites Showcase. Add yours! | My Blog
Many thanks
Thanks to all for your help!
I decided to keep the anchor (said the fox to the grapes :-) ), I shall try to wrap it in an appropriate tag (<a> can't stand unwrapped according to W3c) and to create links to in order to make it useful.
I am going ahead with my accessible theme.
I already released one for Wordpress, one for Joomla and one for PhpBB (the only one on the Net I think).
I will keep you posted about the release.
Thanks again.
Forums are good, issues might be better.
See the accessible theming stuff here - http://drupal.org/node/464472
Some discussion of themes here - http://groups.drupal.org/node/82329
Lots of models to look at.
Wrapping a link in a div does
Wrapping a link in a div does not make it more accessible. The link is the focusable element here, the div does nothing but add some markup, so is pointless.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Semantic tags
I agree, the tag div never has semantic meaning.
The W3c validator suggests that a link shouldn't stay unmarked, but even a p tag doesn't add comfort, as that link is an anchor :-) .
I understood the importance of that anchor so it is better to keep it.
Thanks
How can I change this markup?
How can I change this markup?
<a id="comment-1"></a>
is not in comment.tpl.php and not in comment-wrapper.tpl.php.When I click on this empty
a
element (made visible with a CSS pseudo element) with Devel/Theme developer, it says 'comment-wrapper.tpl.php' is responsible.It`s very simple. You can
It`s very simple. You can use hook_comment_view_alter
Alternative:
Alternative:
|>)/", "", $build['#prefix']);
}
?>
http://www.DROWL.de || Professionelle Drupal Lösungen aus Ostwestfalen-Lippe (OWL)
http://www.webks.de || webks: websolutions kept simple - Webbasierte Lösungen die einfach überzeugen!
http://www.drupal-theming.com || Individuelle Responsive Themes
What about correcting the
What about correcting the formatting of your answer when it's obviously messed up?
Hey guys,
Hey guys,
i don´t see any reason for the current markup (maybe IE fallback purposes or something?).
Why the id´s are not attached directly to the comment wrappers?
However, you can simply remove it as jey7 pointed out.
Now simply override the comment.tpl.php and add:
id="comment-<?php print $comment->cid; ?>"
to your comment wrapper. Anchor links (eg. permalink) will still work.
UPDATE:
Comment indention will no longer work with this solution.
with kind regards
Thomas
Please please help to solve
Please please help to solve this more cleanly. The current solution is really dirty.
http://www.DROWL.de || Professionelle Drupal Lösungen aus Ostwestfalen-Lippe (OWL)
http://www.webks.de || webks: websolutions kept simple - Webbasierte Lösungen die einfach überzeugen!
http://www.drupal-theming.com || Individuelle Responsive Themes
Got it working this way...
I also needed to get rid of these anchor tags and have the comment IDs on the wrapper elements.
I ended up doing it this way:
If you use comments threading, the
#prefix
might also contain the indentation wrapper, that is either<div class="indented"><a id="comment-123"></a>
(when it's the first reply) or the closing tag of that same div</div><a id="comment-123"></a>
so you can't just unset the prefix.And I added the ID back on the comment wrapper in the comment.tpl.php.
<div id="comment-<?php print $comment->cid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
Might not be optimal but seems to work fine...