This project has moved and is read-only. For the latest updates, please go here.

Insert a meta tag in output HTML

Topics: User Forum
Feb 27, 2013 at 4:44 AM
Hi, I'd like to insert a meta tag in the HTML that's output. I'm currently on 1.8 and played with a plugin as a post processing step, but it's not going well.

If I upgrade to 1.9, what's the best way to approach this?

Great tool btw!

Feb 27, 2013 at 3:59 PM
A build component would probably be the best approach. It runs in the BuildAssembler step and would let you insert them at the time the topic is being generated. See the MSHelpAttrComponent as it effectively does the same thing to insert Help 2 attributes into the XML data island.

Feb 27, 2013 at 8:26 PM
Thanks Eric, I followed your article here but with the code from MSHelpAttrComponent.

When I debug (per the article) I can see it working but the Apply override always get an empty XmlDocument (eg. document.OuterXML==""), even though I can see the topic key is correct. Any idea why?

Am still using v1.8

Feb 27, 2013 at 10:42 PM
Ah, I see - I had to put my XML after the TransformComponent section in the sandcastle.config. Works now!
Feb 27, 2013 at 10:44 PM
Make sure you've placed your component in the proper location in the build assembler configuration file. Perhaps you've currently got it at or near the top in which case it may not have loaded the skeleton document yet. Placing it just before or just after TransformComponent should be fine depending on whether you want to insert your attributes before the topic is converted to HTML or after.