[paidaccount][variable flow] Adding an image between comment links

Jan 25, 2005 14:09


Paid Accounts Only The following tutorial requires creating and editing a custom style, which in turn requires a paid, permanent, or early adopter account. Please read What are the paid account benefits? and How do I buy a paid account? to learn about the paid account benefits and how to buy a paid account.
One of the ways to make your comment links unique is to add an image in between them. This tutorial describes how you can do that in Variable Flow. It will replace the function CommentInfo::print. This new code will be placed in a theme layer. If you already have a theme layer for this style, you can simply edit it. If not, you will need to create one by following the instructions in the Theme Layer tutorial.

To make an image appear in between the comment links on your most recent entries view, you can add an
tag to the function CommentInfo::print. Your image should be a valid format (.jpg, .gif, .png, etc.) and hosted on some website that allows remote loading. An image tag is formatted like this:


where http://www.example.com/username/image.jpg would need to be replaced with an actual image URL.

Due to the way Variable Flow is styled, you will also need to surround the image tag with
  • and
  • tags.

    Now, you will need to add the following code to your theme layer:

    function CommentInfo::print { if (not $.enabled) { return; } """"; }
    If you use this method, the image will only appear if there are comments to an entry. You can make the image appear regardless of whether or not there are comments by moving the image tag this way:

    function CommentInfo::print { if (not $.enabled) { return; } """"; }
    Compile your layer, and it's ready to use. You will need to apply your theme layer via the Customize interface in order for your changes to take effect.

    Additional References What are the different S2 layer types?
    What is remote loading?
    Written by camomiletea, based on an S1 tutorial by thewildrose.

    - variable flow, image between comment links, comment links, paid accounts only

    Previous post Next post
    Up