Saturday, February 05, 2005
Since I cross-post my journal entries into Livejournal using this plugin, I wrote a plugin for ExpressionEngine that will convert LiveJournal tags into HTML. This way, I can use the LJ specific tags in my posts and have them displayed properly both on my Livejournal and on this site. It’s now available for download. If you use it and spot any problems or have any suggestions, please let me know.
GENERAL
This plugin replaces the LiveJournal-specific tags with their HTML equivalents. It supports the <lj user>, <lj comm>, and <lj-cut> tags.
Learn more about how to use these tags at this page: http://www.livejournal.com/support/faqbrowse.bml?faqid=75
Note that for the <lj-cut> tags to work, there MUST be a closing </lj-cut> tag, e.g. <lj-cut> ... </lj-cut>.
You can enable or disable the use of the <lj-cut> tag by using the parameters, described below.
PARAMETERS
cut=”” - by default, the plugin will NOT replace anything between <lj-cut> tags with a link. It will simply strip away the <lj-cut> tags, as they are not valid HTML. In order to replace anything between the <lj-cut> tags with a link, you have to specify this parameter and set it to “true”.
path=”” - this parameter is needed only when you have set the “cut” parameter to “true”. With this parameter, you can specify the path to your comments page - where the <lj-cut> tag will link to. If this parameter is not set, the link will default to the site home page.
usericon=”” - with this parameter, you can specify the URL of the image that is used for the user info. It defaults to the image at http://stat.livejournal.com/img/userinfo.gif.
commicon=”” - with this parameter, you can specify the URL of the image that is used for the community info. It defaults to the image at http://stat.livejournal.com/img/community.gif.
USAGE
Surround the text that contains the LJ-specific tags with the tag pair {exp:ljformat}{/exp:ljformat}, e.g.
{exp:ljformat}
Hello, my name is Mr. X and my LiveJournal is at <lj user=“mrx”>.
{/exp:ljformat}
EXAMPLE
When used with the weblog entries tag on your main page:
{exp:weblog:entries weblog=“weblog1” limit=“15”}
<h3>{title}</h3>
{exp:ljformat cut=“true” path=“weblog/comments/{url_title}”}
{body}
{/exp:ljformat}
<div>Last updated on {edit_date format=’%M %d, %Y’} at {edit_date format=’%h:%i %A’}<br />
</div>
{/exp:weblog:entries}
When used on your comments page:
{exp:weblog:entries weblog=“weblog1” limit=“1”}
<h3>{title}</h3>
{exp:ljformat cut=“false”}
{body}
{/exp:ljformat}
<div>Last updated on {edit_date format=’%M %d, %Y’} at {edit_date format=’%h:%i %A’}<br />
</div>
{/exp:weblog:entries}
Sep 03 2010 @ 02:31 AM
Comments & Trackbacks
Post a comment.
The trackback URL for this entry is:
1. Mariann
said:
on Jun 07 2005 @ 07:16 PM
Very cool plugin… I will have to experiment!