Background

For those who don't know, Galaxie Blog was built on top of BlogCfc, one of the most popular ColdFusion Blog engines around. However, BlogCfc was originally built in the early 2000's.

Raymond Camden, the author of BlogCfc, used .ini files to store a lot of variable settings. It was a decent approach as the blog software in those days was much simpler. It is easier to store dynamic information in the .ini files rather than the database as BlogCfc supported SQL Server, MySql, Oracle and Access.

I also put quite a bit of information into the .ini files. In fact, I have nearly 500 different variables stuffed into the .ini files as putting it into a database was cumbersome as a lot of extra code and testing was required to support all of the databases.

However, using the .ini files to store a large amount of data is quite inefficient and slow.

After releasing version 1.15, I put a freeze on using any new settings into the .ini files. It was just too inefficient. It is my plan to wait until I get ColdFusion ORM up and running, and until then, I am either hardcoding some of the new variable information, and expanded on the existing BlogCfc XML Post Directives that I put in a Blog post.

What is a Galaxie Blog XML Post Directive?

BlogCfc used what I call a XML Post Directive to deliver certain functionality to a given blog post, such as wrapping a code block with <code> tags to present code. BlogCfc also used the <more/> tag to condense a post on the main site that aborted the page at a certain position and created a button that navigates the reader to the full post.

Since Galaxie Blog 1.15, I used a handful of additional XML Post Directives to embed optional meta tag information, such as embedding video, and to bypass ColdFusions' Global Script Protection that is used by my hosting provider. Once I integrate ORM, I'll eventually use an interface and code editor to do this without the XML Post Directives, but in the meantime I am using this approach.

Note: all of these directives are optional and only needed for certain occasions, such as including a video, to present video or code, and to bypass ColdFusions' Global Script Protection that is used by various ColdFusion hosting providers.

Original BlogCfc XML Post Directives

  • Use <code> tags to format programming code:
    1. Create the initial <code> tag.
    2. Insert the actual code
    3. Terminate your code block with </code>
  • Use a single <more/> tag to condense the blog body when you're looking at all of the blog posts:
    • Place a <more/> tag where you want the body to terminate
  • Real world example: Scoll down to Kendo Server Side Validation

SEO XML Post Directives

  • Set the meta title for the individual blog post:
    • Enter the title after titleMetaTag: string:
    • <titleMetaTag:Galaxie Blog Post Directives>
    • Terminate the tag with a closing </titleMetaTag>
  • Set the description for the individual blog post. This also sets the description when sharing the post on social media sites (i.e. the open graph and twitter meta tags):
    • Enter the description after descMetaTag: string:
    • <descMetaTag:How to use post directives in Galaxie Blog>
    • Terminate the tag with a closing </descMetaTag>

Image XML Post Directives

  • Set the image URL for Facebook (i.e. sets the value for the og:image):
    • Note: if you upload an enclosure when making a post, Facebook and Twitter images will be automatically created for you.
    • Enter the URL after facebookImageUrlMetaData: string:
    • <facebookImageUrlMetaData:/enclosures/facebook/aspectRatio.jpg>
    • Terminate the tag with a closing </facebookImageUrlMetaData>
  • Set the image URL for Twitter (i.e. sets the value for the twitter:image):
    • Note: if you upload an enclosure when making a post, Facebook and Twitter images will be automatically created for you.
    • Enter the URL after twitterImageUrlMetaData: string:
    • <twitterImageUrlMetaData:/enclosures/facebook/aspectRatio.jpg>
    • Terminate the tag with a closing </twitterImageUrlMetaData>

Video XML Post Directives

  • Set the video type. When the proper video type is encountered, the media player will attempt to play the video:
    • The videoType can be: .mp3, .mp4, .ogg .ogv or .webm
    • Specify the video type after videoType: string:
    • <videoType:.mp4>
    • Terminate the tag with a closing </videoType>
  • Set a cover image on top of the video if is not playing (optional):
    • Specify the URL to the cover image after videoPosterImageUrl: string:
    • <videoPosterImageUrl:https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg>
    • Terminate the tag with a closing </videoPosterImageUrl>
  • Set the URL to the small source (576p) of a video (optional):
    • It's possible to have a small, medium and a large video source. The code will determine which video source to play depending upon the end users device type (i.e. desktop or mobile). The large video source should be in 576p format.
    • Specify the URL to the medium sized video after smallVideoSourceUrl: string:
    • <smallVideoSourceUrl:https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-576p.mp4>
    • Terminate the tag with a closing </smallVideoSourceUrl>
  • Set the URL to the medium source (720p) of a video (optional):
    • It's possible to have a small, medium and a large video source. The code will determine which video source to play depending upon the end users device type (i.e. desktop or mobile). The large video source should be in 720p format.
    • Specify the URL to the medium sized video after mediumVideoSourceUrl: string:
    • <mediumVideoSourceUrl:https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-720p.mp4>
    • Terminate the tag with a closing </mediumVideoSourceUrl>
  • Set the URL to the large source (1080p) of a video (optional):
    • It's possible to have a small, medium and a large video source. The code will determine which video source to play depending upon the end users device type (i.e. desktop or mobile). The large video source should be in 1080p format.
    • Specify the URL to the medium sized video after largeVideoSourceUrl: string:
    • <largeVideoSourceUrl:https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-1080p.mp4>
    • Terminate the tag with a closing </largeVideoSourceUrl>
  • Set the URL to the video captions file (optional):
    • Specify the URL to video captions VTT file after the videoCaptionsUrl: string:
    • <videoCaptionsUrl:https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.en.vtt>
    • Terminate the tag with a closing </videoCaptionsUrl>
  • Set the cross origin setting (optional):
    • This is an optional setting that only should be set when the video source is outside of your domain. Set to true only when the video is hosted from another source.
    • Specify the URL to video captions VTT file after the videoCrossOrigin: string:
    • <videoCrossOrigin:true>
    • Terminate the tag with a closing </videoCrossOrigin>
  • Set the video width meta data (optional):
    • This is an optional setting that sets the width in the meta tags. It does not impact the presentation of the video and is only used by Facebook and Twitter.
    • Specify the width in pixels after the videoWidthMetaData: string:
    • <videoWidthMetaData:1920>
    • Terminate the tag with a closing </videoWidthMetaData>
  • Set the video height meta data (optional):
    • This is an optional setting that sets the height in the meta tags. It does not impact the presentation of the video and is only used by Facebook and Twitter.
    • Specify the width in pixels after the videoHeightMetaData: string:
    • <videoHeightMetaData:1080>
    • Terminate the tag with a closing </videoHeightMetaData>

XML Post Directive for YouTube

  • Set the URL to a YouTube Video:
    • Specify the YouTube full URL after the youTubeUrl: string:
    • <youTubeUrl:https://www.youtube.com/watch?v=liJqpsjai9I&feature=youtu.be>
    • Terminate the tag with a closing </youTubeUrl>

XML Post Directive for Vimeo

  • Set the ID to play a video from Vimeo:

XML Post Directives to bypass ColdFusions' Global Script Protection

  • Use a cfinclude:
    • Enter the path to the template that you want to include after the <cfincludeTemplate: string:
    • <cfincludeTemplate:/blog/includes/postContent/parallax/parallaxScript.cfm></cfincludeTemplate>
  • Include a javascript inside of a post
    1. Use the initial attachScript, and place the optional script type, if necessary, after attachScript string within a blog post like so:
    2. <attachScript>
    3. Copy and paste the actual javascript
    4. alert("Hello World");
    5. And terminate the script with </attachScript>:
    6. </attachScript>
tag to condense a post on the main site that aborted the page at a certain position and created a button that navigates the reader to the full post.

Since Galaxie Blog 1.15, I used a handful of additional XML Post Directives to embed optional meta tag information, such as embedding video, and to bypass ColdFusions' Global Script Protection that is used by my hosting provider. Once I integrate ORM, I'll eventually use an interface and code editor to do this without the XML Post Directives, but in the meantime, I am using this approach.

Note: all of these directives are optional and only needed for certain occasions, such as including a video, presenting video or code, and bypassing ColdFusion's Global Script Protection that is used by various ColdFusion hosting providers.

Original BlogCfc XML Post Directives

  • Use <code> tags to format programming code:
    1. Create the initial <code> tag.
    2. Insert the actual code
    3. Terminate your code block with </code>
  • Use a single  tag to condense the blog body when you're looking at all of the blog posts:
    • Place a tag where you want the body to terminate
  • Real-world example: Scroll down to Kendo Server-Side Validation

SEO XML Post Directives

  • Set the meta title for the individual blog post:
    • Enter the title between the titleMetaTag tags:
    • <titleMetaTag>Galaxie Blog Post Directives</titleMetaTag>
  • Set the description for the individual blog post. This also sets the description when sharing the post on social media sites (i.e. the open graph and Twitter meta tags):
    • Enter the description between the descMetaTag tags:
    • <descMetaTag>How to use post directives in Galaxie Blog</descMetaTag>

Image XML Post Directives

  • Set the image URL for Facebook (i.e. sets the value for the og:image):
    • Note: if you upload an enclosure when making a post, Facebook and Twitter images will be automatically created for you.
    • Enter the URL between facebookImageUrlMetaData tags:
    • <facebookImageUrlMetaData>/enclosures/facebook/aspectRatio.jpg</facebookImageUrlMetaData>
  • Set the image URL for Twitter (i.e. sets the value for the twitter:image):
    • Note: if you upload an enclosure when making a post, Facebook and Twitter images will be automatically created for you.
    • Enter the URL between the twitterImageUrlMetaData tags:
    • <twitterImageUrlMetaData>/enclosures/facebook/aspectRatio.jpg</twitterImageUrlMetaData>

Video XML Post Directives

  • Set the video type. When the proper video type is encountered, the media player will attempt to play the video:
    • The videoType can be: .mp3, .mp4, .ogg .ogv or .webm
    • Specify the video type between the videoType tags:
    • <videoType>.mp4 </videoType>
  • Set a cover image on top of the video if is not playing (optional):
    • Specify the URL to the cover image between the videoPosterImageUrl tags:
    • <videoPosterImageUrl>https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg</videoPosterImageUrl>
  • Set the URL to the small source (576p) of a video (optional):
    • It's possible to have a small, medium, and large video source. The code will determine which video source to play depending upon the end-users device type (i.e. desktop or mobile). The large video source should be in 576p format.
    • Specify the URL to the medium sized video between the smallVideoSourceUrl tags:
    • <smallVideoSourceUrl>https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-576p.mp4</smallVideoSourceUrl>
  • Set the URL to the medium source (720p) of a video (optional):
    • It's possible to have a small, medium, and large video source. The code will determine which video source to play depending upon the end-users device type (i.e. desktop or mobile). The large video source should be in 720p format.
    • Specify the URL to the medium sized video between the mediumVideoSourceUrl tags:
    • <mediumVideoSourceUrl>https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-720p.mp4</mediumVideoSourceUrl>
  • Set the URL to the large source (1080p) of a video (optional):
    • It's possible to have a small, medium, and large video source. The code will determine which video source to play depending upon the end-users device type (i.e. desktop or mobile). The large video source should be in 1080p format.
    • Specify the URL to the medium sized video between the largeVideoSourceUrl tags:
    • <largeVideoSourceUrl>https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-1080p.mp4</largeVideoSourceUrl>
  • Set the URL to the video captions file (optional):
    • Specify the URL to video captions VTT file between the videoCaptionsUrl tags:
    • <videoCaptionsUrl>https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.en.vtt</videoCaptionsUrl>
  • Set the cross-origin setting (optional):
    • This is an optional setting that only should be set when the video source is outside of your domain. Set to true only when the video is hosted from another source.
    • Specify the URL to video captions VTT file between the videoCrossOrigin tags:
    • <videoCrossOrigin>true</videoCrossOrigin>
  • Set the video width metadata (optional):
    • This is an optional setting that sets the width in the meta tags. It does not impact the presentation of the video and is only used by Facebook and Twitter.
    • Specify the width in pixels between the videoWidthMetaData tags:
    • <videoWidthMetaData>1920</videoWidthMetaData>
  • Set the video height meta data (optional):
    • This is an optional setting that sets the height in the meta tags. It does not impact the presentation of the video and is only used by Facebook and Twitter.
    • Specify the width in pixels between the videoHeightMetaData tags:
    • <videoHeightMetaData>1080</videoHeightMetaData>

XML Post Directive for YouTube

  • Set the URL to a YouTube Video:

XML Post Directive for Vimeo

XML Post Directives to bypass ColdFusions' Global Script Protection

  • Use a cfinclude:
    • Enter the path to the template that you want to include after the cfincludeTemplate tags:
    • <cfincludeTemplate>/blog/includes/postContent/parallax/parallaxScript.cfm</cfincludeTemplate>
    • Include a javascript inside of a post
      1. Use the initial attachScript, and place the optional script type, if necessary, after attachScript string within a blog post like so:
      2. <attachScript>
      3. Copy and paste the actual javascript
      4. alert("Hello World");
      5. And terminate the script with </attachScript>:
      6. </attachScript>

Note: this article was rewritten for Galaxie Blog 3