SPFE Documentation | Collections > EPPO-simple Demos > Fragments Demo

Fragments Demo

This is a demo of fragments. It also includes a demo of the related feature stings. Fragments and strings are both reuse features of SPFE and EPPO-simple. Both allow you to insert a piece of content defined elsewhere into the current topic. Fragments insert content at the general text level. Strings insert text at the paragraph level. You can also define local strings for use within the body of a fragment. This allows you to substitute different strings into a fragment each time it is used.

This is a test of the string feature

What follows is a string defined inline with <string id="a-string">This is a string</string>: This is a string

This is a reference to that inline string with <string-ref id-ref="a-string"/> This is a string

This is a test of the fragment feature

There are two fragment references to an externally define fragment. The first pulls in the fragment without redefining any strings. The second pulls it in but redefines the string "my-local-string".

This is a fragment that contains the local string from the fragments file. It also references a global string, SPFE Open Toolkit

This is a fragment that contains a local string from the topic file. It also references a global string, SPFE Open Toolkit

Next we have a locally defined fragment:

My favorite holiday is Christmas.

And a reference to the locally defined fragment:

My favorite holiday is Easter.