Add Logo to WebHelp
-
- Posts: 70
- Joined: Thu Mar 21, 2013 12:55 am
Add Logo to WebHelp
Thanks,
Paul
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Add Logo to WebHelp
Post by sorin_ristache »
I think the simplest way is adding an h1:before selector in the built-in CSS stylesheet imported in any Webhelp output file (which is an HTML file) or in your own custom CSS stylesheet which you set in the args.css parameter of the DITA Map WebHelp transformation. The built-in CSS stylesheet is either [Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\oxygen-webhelp\resources\css\toc.css (if you use the frameset version of the Webhelp output, that is the index_frames.html main file) or [Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\oxygen-webhelp\resources\css\toc.css (if you use the internal frames version of the Webhelp output, that is the index.html main file):
Code: Select all
h1:before {
display:inline;
content:url('../img/myLogoImage.gif');
}
Regards,
Sorin
-
- Posts: 70
- Joined: Thu Mar 21, 2013 12:55 am
Re: Add Logo to WebHelp
It didn't occur to me that this could be solved simply using CSS. One slight correction, the internal frames CSS is [Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\oxygen-webhelp\resources\css\tocWDiv.css
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
-
- Posts: 7
- Joined: Fri Jul 26, 2013 7:57 pm
Re: Add Logo to WebHelp
I tried to add the logo using the h1:before code on my custom css, but the logo is not displayed in the generated webhelp.
Should I be using the :before pseudo-element with another tag (for instance, productTitle)?
Thanks
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Add Logo to WebHelp
Post by sorin_ristache »
I assume you tried to add the logo image in the version of Webhelp output without frameset (the index.html main file), not the one with frameset (the index_frames.html main file).
What is the path to the logo image used in the CSS file? Does the logo image exist on disk in the location specified in the CSS, in the output directory (or a subdirectory) of the Webhelp transformation? Please can you send us your output directory of the DITA Webhelp transformation? We will have to look at the output HTML files and the included CSS to find out why the logo image is not added as the pseudo-element h1:before.
What Oxygen version do you use?
Regards,
Sorin
-
- Posts: 32
- Joined: Thu Feb 17, 2011 10:06 pm
Re: Add Logo to WebHelp
Is it possible something's missing from the sample code?
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Add Logo to WebHelp
Post by sorin_ristache »
You just have to make sure that the relative path to the image logo is correct, which means the logo image should actually exist in the output directory where the CSS selector for h1:before tries to locate and load it. This is why I recommend to store the logo image in directory com.oxygenxml.webhelp\oxygen-webhelp\resources\img, to have it copied automatically to the output directory by the Webhelp transformation. Otherwise you have to make sure you copy it there yourself.
I tested with the h1:before solution added in the CSS stylesheet com.oxygenxml.webhelp\oxygen-webhelp\resources\skins\desktop\toc.css and I confirm that it works in version 15.0 too. If it doers not work for you please send us your customization for the Webhelp transformation and your output directory of the Webhelp transformation for trying to find why it did not work for you.
Regards,
Sorin
-
- Posts: 7
- Joined: Fri Jul 26, 2013 7:57 pm
Re: Add Logo to WebHelp
Yes, it was the index.html file.sorin wrote:
I assume you tried to add the logo image in the version of Webhelp output without frameset (the index.html main file), not the one with frameset (the index_frames.html main file).
I added the logo image in .../frameworks/dita/DITA-OT/plugins/com.oxygenxml.webhelp/oxygen-webhelp/resources/img folder.sorin wrote:
What is the path to the logo image used in the CSS file? Does the logo image exist on disk in the location specified in the CSS, in the output directory (or a subdirectory) of the Webhelp transformation?
I can also see the logo in the output folder.
I have done so. For testing, the logo I used was the oxygen logo, which is used in the footer.sorin wrote:
Please can you send us your output directory of the DITA Webhelp transformation?
Oxygen 15sorin wrote: What Oxygen version do you use?
Thanks again for your help.
-
- Posts: 32
- Joined: Thu Feb 17, 2011 10:06 pm
Re: Add Logo to WebHelp
Sent a zip file of the output along with the CSS I used to build the output and the logo file (though probably didn't need to send that). I've tried using div#id:before to try to get the logo places before the title but it never seems to get there. Not quite sure what's going on here but it's as if the area the first h1 is in is not affected by the CSS.sorin wrote:I tested with the h1:before solution added in the CSS stylesheet com.oxygenxml.webhelp\oxygen-webhelp\resources\skins\desktop\toc.css and I confirm that it works in version 15.0 too. If it doers not work for you please send us your customization for the Webhelp transformation and your output directory of the Webhelp transformation for trying to find why it did not work for you.
Regards,
Sorin
-
- Posts: 7
- Joined: Fri Jul 26, 2013 7:57 pm
Re: Add Logo to WebHelp
I used the div id for productTitle and did manage to add the logo as a repeating background image, but it did not work when I set it as no-repeat.jvazquez wrote:I've tried using div#id:before to try to get the logo places before the title but it never seems to get there. Not quite sure what's going on here but it's as if the area the first h1 is in is not affected by the CSS.
-
- Posts: 32
- Joined: Thu Feb 17, 2011 10:06 pm
Re: Add Logo to WebHelp
So you were able to get multiple background-images but not a single image? Not exactly what's needed, is it. I will confess to not being very conversant in CSS so could you share the code? (Sanitized if needed.)mcverma wrote:I used the div id for productTitle and did manage to add the logo as a repeating background image, but it did not work when I set it as no-repeat.
-
- Posts: 32
- Joined: Thu Feb 17, 2011 10:06 pm
Re: Add Logo to WebHelp
Code: Select all
#productTitle
{
background-image:url(mylogo.png);
background-repeat:repeat;
}
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Add Logo to WebHelp
Post by sorin_ristache »
Thank you for the files but the output folder (or any subfolder) does not contain a file called logo2.png. I can see that you display the image correctly in the CSS stylesheet oxygen-webhelp\resources\skins\desktop\toc.css:mcverma wrote:I can also see the logo in the output folder.I have done so. For testing, the logo I used was the oxygen logo, which is used in the footer.sorin wrote:
Please can you send us your output directory of the DITA Webhelp transformation?
Code: Select all
h1:before {
display:inline;
content:url('../../img/logo2.png');
}
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Add Logo to WebHelp
Post by sorin_ristache »
Thank you for the files. The only modification that I needed to make in your files was to set the correct path to the custom CSS file, that is:jvazquez wrote:I tried this:
This didn't work at all. I did try using div#productTitle with the same result. The other problem is that this won't work for the other format of webhelp because that div doesn't exist.Code: Select all
#productTitle
{
background-image:url(mylogo.png);
background-repeat:repeat;
}
Code: Select all
HP_style_CHM.css
Code: Select all
C:\hp\Customization-hp\Customization-hp\html\common\css\HP_style_CHM.css
Code: Select all
args.css = HP_style_CHM.css
Code: Select all
#productTitle h1:before
{
display:inline;
content:url(oxygen-webhelp/resources/img/hp-logo.png);
width:80px;
margin-left:10px;
}
Regards,
Sorin
-
- Posts: 7
- Joined: Fri Jul 26, 2013 7:57 pm
Re: Add Logo to WebHelp
Hi Sorin,sorin wrote:
Thank you for the files but the output folder (or any subfolder) does not contain a file called logo2.png. I can see that you display the image correctly in the CSS stylesheet oxygen-webhelp\resources\skins\desktop\toc.css:
but there is no file logo2.png in folder oxygen-webhelp\resources\img. If I add a file logo2.png in this folder the logo image shows up correctly in the title area.Code: Select all
h1:before {
display:inline;
content:url('../../img/logo2.png');
}
First of all, thank you for all your patience.
I have recreated all the source files for Webhelp putput, added a new logo, generated the output with both #productTitle hi: before and hi: before pseudo-elements, but neither option works.
I also changed the file path to point to the Resource>Img folder of the output to no avail.
The LOGO2.png is in the Resource>Img folder, but it doesn't display in the output.
I have sent you the new set of zipped files.
Hope you can help with this.
Cheers
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Add Logo to WebHelp
Post by sorin_ristache »
I looked in your Webhelp output files but there is only one h1:before in default.css. There is no #productTitle h1:before and no h1:before in the files that you sent. Maybe you modified other toc.css file, not the one from directory [Oxygen-15.0-install-dir]\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\oxygen-webhelp\resources\skins\desktop, and that is why your #productTitle h1:before and h1:before do not show up in any output file?mcverma wrote:I have recreated all the source files for Webhelp putput, added a new logo, generated the output with both #productTitle hi: before and hi: before pseudo-elements, but neither option works.
I also changed the file path to point to the Resource>Img folder of the output to no avail.
The LOGO2.png is in the Resource>Img folder, but it doesn't display in the output.
I have sent you the new set of zipped files.
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Add Logo to WebHelp
Post by sorin_ristache »
Just add the same h1:before code in the toc.css stylesheet from directory [Oxygen-15-install-dir]\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\oxygen-webhelp\resources\skins\desktop-frames. You want to set a style in the version of Webhelp output with frames (index_frames.html) so you have to add your style to the CSS stylesheet from the resources\skins\desktop-frames directory, not the resources\skins\desktop one. If the image exists at the location set to the content property then it will be visible just before the main title in the left side frame of the browser page:jvazquez wrote:That worked, Sorin but the other version of the webhelp (index_frames) doesn't get the logo. How can that be fixed?
Code: Select all
h1:before {
display:inline;
content:url('../../img/myLogoImage.png');
}
Regards,
Sorin
-
- Posts: 32
- Joined: Thu Feb 17, 2011 10:06 pm
Re: Add Logo to WebHelp
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Add Logo to WebHelp
Post by sorin_ristache »
You don't have to modify the base Webhelp plugin, you can add the image logo in a custom CSS that you set with the parameter args.css in the DITA Map Webhelp transformation.
The title area is not generated by JavaScript code. It does not matter that the page contains JavaScript code, the CSS style will be set by the browser. Does the CSS included in your output Webhelp page contain the h1:before CSS code? Can you send us your entire output directory to see if it has the right content? Where did you added the h1:before code, in what CSS file?
Regards,
Sorin
-
- Posts: 7
- Joined: Fri Jul 26, 2013 7:57 pm
Re: Add Logo to WebHelp
Sorry about the delay in responding...I added the pseudo-element in the TOC.css file, but the logo is still not showing up. I must be doing something wrong.sorin wrote:I looked in your Webhelp output files but there is only one h1:before in default.css. There is no #productTitle h1:before and no h1:before in the files that you sent. Maybe you modified other toc.css file, not the one from directory [Oxygen-15.0-install-dir]\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\oxygen-webhelp\resources\skins\desktop, and that is why your #productTitle h1:before and h1:before do not show up in any output file?

-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Add Logo to WebHelp
Post by sorin_ristache »
I opened your Webhelp files in both the Firefox and Internet Explorer browsers and the logo image is displayed correctly next to the main title, please see this image (the internal frames version) and this image (the frameset version). In what browser did you open these Webhelp files? On what platform?mcverma wrote:Sorry about the delay in responding...I added the pseudo-element in the TOC.css file, but the logo is still not showing up. I must be doing something wrong.I have uploaded the output files again. Do help, if you can.
Regards,
Sorin
Return to “DITA (Editing and Publishing DITA Content)”
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service