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

Adding Images to Content Files

Topics: User Forum
Aug 10, 2012 at 4:41 PM

I cannot seem to get an image to show up in a content file. 

I've added a new conceptual content file with build set to both content and none.  After dragging image, with build set to both image and content, onto the content file from entity, and compiling, I still don't see the image.

Do I need to compile or should I see the image by prefiewing the content by pressing F5?

Please help, I've wasted a day trying to figure this out.

Aug 10, 2012 at 8:23 PM

The MAML topics should have a build action of None.  They are included or not based on their presence in a content layout file.  If you do not have a content layout file in the project yet, add one to it, open it for editing, and add the topic file to it.  The content layout file defines which topics are included and their order and layout in the table of contents.

For images that you use in MAML topics, the build action must be set to Image and the ImageId property should contain an ID or name that you want to use as the target in the MAML image element.  If in doubt, open the Entity References Window, select Images as the type and drag and drop or copy the image entry from there and drop/paste it into the topic.  It will format the mediaLink element accordingly with the proper ID.

See the Conceptual Content topics in the SHFB help file as they cover this information.