Missing option to disable title
See original GitHub issueHello,
I was wondering how I could disable the title of an generated icon ? I can’t find an option to disable the auto generating of a title.
My icons are constructed like below. The title “toevoegen” is only active when you over over a part of the icon that has no content. Else the title “add_circle” is displayed.
<a href="/customer-service/patients/new/" title="Toevoegen">
<svg class="icon " }}="">
<use xlink:href="/dist/sprites.svg#add_circle"></use>
</svg>
</a>
I have changed this in my npm folder. This seems to be working well. Mind you this is my first time I changed a npm package.
function SVGSpritemapPlugin(options) {
// Merge specified options with default options
this.options = merge({
src: '**/*.svg',
svgo: {},
glob: {},
prefix: 'sprite-',
gutter: 2,
filename: 'spritemap.svg',
chunk: 'spritemap',
deleteChunk: true,
svg4everybody: false,
generateTitle: true <--- Added
}, options, {
svgo: {
plugins: [{
cleanupIDs: false
}]
}
});
}
// Generate a title or not ?
if( options.generateTitle == true ) { <--- Added
// Make sure we don't overwrite the existing title
var hasTitle = false;
for ( var i = 0; i < svg.childNodes.length; i++ ) {
if ( svg.childNodes[i].tagName && svg.childNodes[i].tagName.toLowerCase() === 'title' ) {
var hasTitle = true;
}
}
// Add title for improved accessibility
if ( !hasTitle ) {
var title = XMLDoc.createElement('title');
title.appendChild(XMLDoc.createTextNode(id.replace(options.prefix, '')));
symbol.appendChild(title);
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Hide Title option missing - WordPress.org
I need the title of every page hidden. But the problem is not with the site but with the plugin. The plugin used...
Read more >How to Disable Title on Posts, Pages, or Other Post Types?
This can be a great solution if you want to disable titles on all posts, pages, or other post types. You can add...
Read more >How to Hide Page and Post Titles in WordPress - Kinsta
Follow these few easy steps to hide titles in single posts, pages, ... There may be no easy “hide title” option built into...
Read more >How to Hide Page Title in WordPress: Manual Method + Plugins
Hover over the page of your choice, then over Edit. Don't click it.
Read more >Where has the option to disable "title bar window shake" gone to
61 votes, 18 comments. 420K subscribers in the Windows10 community. Welcome to the largest community for Microsoft Windows 10, the world's ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Correct, I’m forced to use 1.x for now. To many things need to change in this project to be able to use 2.x. And seeing I have only 2 weeks left in this project I’m not going to touch that 😉
Alright, I’ll do that.
Version
1.2.0
and2.5.0
containing this feature have just been released and published to npm.Thanks for your contribution, @Hoet! 🚀