Single-Sourcing Micro Content

Using the methods already discussed in this tutorial, you can often accomplish much of what you want for micro content in search results. However, you might find that you want to make certain changes to control where micro content appears and how it looks. For example, you might want some micro content phrases to be included in some outputs but not others. Also, you might want the content to look one way in the topic but another way in the micro content, but you don't want to create two sets of content. So a good solution is to use conditions, styles, or both to single-source the content for these different purposes.

How to Exclude Micro Content Phrases From Outputs

  1. On the left side of the interface, open the Project Organizer.
  2. Expand the Conditional Text folder, and double-click Default. The Condition Tag Set Editor opens.
  3. Let's create two new conditions for our purposes. In the local toolbar, click New Item button. A new row is added and selected.
  4. Press F2 on your keyboard, select the text, type HTML5Output1, and press ENTER. We could change the default color associated with the new condition, but we'll leave it.

  5. Repeat the previous couple of steps to create another condition called HTML5Output2.

  6. Click Save the active file. to save your work.

  7. From the Project Organizer, open the All-About-Austin-HTML5 target.
  8. In the Target Editor, select the Conditional Text tab.
  9. Set Default.HTML5Output1 to Include, and set Default.HTML5Output2 to Exclude.

  10. Click Save the active file. to save your work.

  11. Open the micro content file.
  12. On the left side of the editor, right-click the Music row and select Properties.
  13. In the dialog, select the Conditional Text tab, and click the check box next to HTML5Output1.

  14. Click OK.
  15. Repeat the previous three steps for the zilker park row, but this time select the check box next to HTML5Output2.

    In the Micro Content Editor, you should see the corresponding colors next to each of the phrases.

  16. Click Save the active file. to save your work.

  17. Build the All-About-Austin-HTML5 target, and view the output.
  18. Search for Music. Notice that the micro displays in the search results. That's because we included that condition in the target.
  19. Search for Zilker Park. Notice that the micro does not display in the search results. That's because we excluded that condition in the target

How to Exclude Content From the Micro Content

The following steps show how you can link to the same content, showing all of it when the full topic is viewed, but hiding some content when seen as micro content. We're going to do this using a condition, but you can also accomplish this using styles.

  1. From the Project Organizer, open the Default condition tag set. The Condition Tag Set Editor opens.
  2. Let's create a new condition for our purposes. In the local toolbar, click New Item button. A new row is added and selected.
  3. Press F2 on your keyboard, select the text, type TopicsOnly, and press ENTER. We could change the default color associated with the new condition, but we'll leave it.

  4. Click Save the active file. to save your work.

  5. Open the Music.htm topic.
  6. Apply the new TopicsOnly condition to the heading, as well as to the last sentence in the paragraph containing the cross-references (see Applying Conditions to Content). When finished, it should look like this.

  7. Click Save the active file. to save your work.

  8. Open the micro content file. Then in the editor select either the main Music phrase or one of the alternate phrases, so that the linked response is shown to the right.

  9. On the left side of the editor, right-click the Music phrase, and from the context menu select Properties.
  10. In the Properties dialog, select the Micro Content Conditions tab.
  11. Select the Default.TopicsOnly condition row, and to the right click Exclude.

  12. Click OK. Notice that the conditioned content no longer displays on the right side of the editor.

  13. Click Save the active file. to save your work.

  14. Build and view the output.
  15. Search for music. Notice that the heading and sentence with the cross-references are not shown in the micro content response.

  16. Click the Music link at the bottom of the micro content response to open the full topic. Notice that the heading and sentence with the cross-references are shown.

How to Make the Content Look Different

Sometimes you might want the content to look one way in the micro content search results, but a different way in the full topic. We will do this using styles.

  1. From the Content Explorer, expand Resources. Then right-click the Stylesheets folder and select New > Stylesheet. The Add File dialog opens.
  2. In the File Name field, enter Micro-Content, and click Add. The new stylesheet is created and opens in the Stylesheet Editor.
  3. In the local toolbar, make sure the first button displays Advanced View button. If the button displays Simplified View button instead, then click it.
  4. On the left side of the Stylesheet Editor, select the ul style (which affects unordered, or bulleted, lists).

  5. On the right side of the editor, set the color property to #ff0000 (or red).

  6. Click Save the active file. to save your work.

  7. In the Content Explorer, expand Resources > MicroContent.
  8. Right-click My-Micro-Content.flmco, and select Properties.
  9. In the dialog, select the Stylesheet Links tab.
  10. On the left side of the dialog, double-click Micro-Content.css to move it to the right side, then click OK. This associates the micro content file with that stylesheet. The micro content file will still use the main stylesheet that is set at the project level, but when there are conflicts, the new stylesheet associated with the micro content file will have precedence.
  11. From the Content Explorer, double-click Famous-Austin-Folks.htm.
  12. Let's make some micro content out of the bulleted list. Right-click the ul structure bar to the left of the list, and from the context menu select Create Micro Content.

  13. In the Phrase field of the dialog, enter famous.
  14. Click OK. The Micro Content Editor opens, with the new phrase selected and the linked response (the bulleted list) to the right.

  15. Click Save all files. to save all files.
  16. Build the All-About-Austin-HTML5 target, and view the output.
  17. Search for famous. Notice that the list is red.

  18. Click the link at the bottom of the micro content to open the full topic. Notice that the list is black (the default color, which we did not change in the main stylesheet).

Ta-Da!

Congratulations! You've reached the end of this tutorial. Be sure to check out others. See Tutorials.

We especially recommend that you walk through the Micro Content Tutorial—Advanced to discover even more micro content features and learn how they work.