Page 1 of 1
Select an image depending on the publication
Posted: Mon Jan 27, 2014 11:47 am
by Le Basque
Hi,
I want to Select an image depending on the publication.
For example :
For the web, I am displaying an image and PDF publishing another image.
How can I do?
Thank you for help
Re: Select an image depending on the publication
Posted: Mon Jan 27, 2014 5:12 pm
by Radu
Hi,
Probably either:
Probably you could insert for each image two <image> references something like:
Code: Select all
<image href="../../images/LilacPDF.jpg" audience="pdf"/>
<image href="../../images/LilacWEB.jpg" audience="html"/>
and apply the DITA OT processing with DITAVAL custom filtering which based on the profiling attribute value will remove one image reference or the other from the output depending on the publishing format.
Or to avoid duplicate image references in the DITA topic you could refer to the image with a keyref like:
and in the DITA Map have references like this:
Code: Select all
<topicref href="images/LilacPDF.jpg" format="jpg" keys="Lilac" audience="pdf"/>
<topicref href="images/LilacWEB.jpg" format="jpg" keys="Lilac" audience="html"/>
and again publish by filtering based on profiling conditions.
Regards,
Radu
Re: Select an image depending on the publication
Posted: Mon Jan 27, 2014 6:00 pm
by Le Basque
thank you for response,
For the first solution, you must change the file ditaval each publication?
In second solution i don't understand solution ? if image in topic i indcate the reference <image keyref="Lilac"/>
I can define link in ditamap ?
<topicref href="images/LilacPDF.jpg" format="jpg" keys="Lilac" audience="pdf"/>
if user selected xhtml DITA OT selects the correct link?
thank you
Re: Select an image depending on the publication
Posted: Mon Jan 27, 2014 6:12 pm
by Radu
Hi,
For the first solution, you must change the file ditaval each publication?
The transformation scenario for PDF would use a DITAVAL. The transformation scenario for XHTML would use another one.
In second solution i don't understand solution ? if image in topic i indcate the reference
I can define link in ditamap ?
Code: Select all
<topicref href="images/LilacPDF.jpg" format="jpg" keys="Lilac" audience="pdf"/>
if user selected xhtml DITA OT selects the correct link?
The same in the first case, the transformation scenario for PDF would use a DITAVAL and the transformation scenario for XHTML would use another one. But in this case the DITA topic would not contain two image references, the DITA Map would contain two topic references to the images.
Regards,
Radu
Re: Select an image depending on the publication
Posted: Mon Jan 27, 2014 6:24 pm
by Le Basque
hi,
that contains the ditaval?
Best regards
Re: Select an image depending on the publication
Posted: Tue Jan 28, 2014 11:46 am
by Radu
Hi,
that contains the ditaval?
When you edit a transformation scenario, in the
Filters tab you can specify the path to a DITAVAL filter file.
Regards,
Radu
Re: Select an image depending on the publication
Posted: Tue Jan 28, 2014 3:03 pm
by Le Basque
Hi,
I created the file ditaval the ditamap with reference images, the DITA file calling an image by reference. I specified the location of ditaval in parameters.
Treatment works, but I get errors in the console
E[DITA-OT][DOTX021E]
Missing navtitle attribute or element for non-DITA resource "images/PDF.jpg". References must provide a local navigation title when the target is not a local DITA resource.................
Definition in ditamap :
Code: Select all
<topicref href="images/PDF.jpg" format="jpg" audience="pdf" keys="XXXX"/>
E[DITA-OT][DOTX025E]
Missing linktext and navtitle for non-DITA resource "images/PDF.jpg". References must provide a local navigation title when the target is not a local DITA resource.
An other question : Each treatment must be changed ditaval depending on the desired publication?
Thank you
Best regards
Re: Select an image depending on the publication
Posted: Tue Jan 28, 2014 3:32 pm
by Radu
Hi,
Missing linktext and navtitle for non-DITA resource "images/PDF.jpg". References must provide a local navigation title when the target is not a local DITA resource.
This warning is probably benign, it should have probably not been issued at all by the DITA Open Toolkit. To inhibit it you can add a navtitle attribute on the topicref:
Code: Select all
<topicref href="images/PDF.jpg" format="jpg" audience="pdf" keys="XXXX" navtitle="Image"/>
Each treatment must be changed ditaval depending on the desired publication?
Each transformation scenario must specify a DITAVAL which filters the references in the map accordingly based on the @audience attribute.
Ideally you would not need one image for PDF and another for the XHTML output, if your images appeared stretched-out in the PDF maybe you should read this:
http://www.oxygenxml.com/doc/ug-oxygen/ ... utput.html
Regards,
Radu
Re: Select an image depending on the publication
Posted: Tue Jan 28, 2014 4:00 pm
by Le Basque
thank you Radu