|
|
|
Managed to delete a few lines from the template above!
here's what i meant: $MOBLOG-SUBJECT-LINE <p>from $MOBLOG-SENDER:</p> <p> $MOBLOG-BODY-TEXT #FOREACH($MOBLOG-IMAGE) { <img src="$MOBLOG-IMAGE" alt="$MOBLOG-IMAGE-FILENAME" width="75%" height="75%"/> } #FOREACH($MOBLOG-ATTACHMENT) { <a href="$MOBLOG-ATTACHMENT">$MOBLOG-ATTACHMENT-FILENAME</a> } </p> also, it might just be easier and simpler to add a maximum image size property to moblog.properties, which would limit the size of images posted tim Moblog plugin now loads a template org/blojsom/plugin/moblog/moblog-plugin-template.vm. You can override this by creating the proper directories in the edit templates screen from the admin interface. The default template looks like:
$!MOBLOG_BODY_TEXT #foreach ($moblogImage in $!MOBLOG_IMAGES) <p><img src="$moblogImage.get('MOBLOG_IMAGE_URL')" border="0" alt="$moblogImage.get('MOBLOG_IMAGE')"/></p> #end #foreach ($moblogAttachment in $!MOBLOG_ATTACHMENTS) <p><a href="$moblogAttachment.get('MOBLOG_ATTACHMENT_URL')" title="$moblogAttachment.get('MOBLOG_ATTACHMENT')">Download file: $moblogAttachment.get('MOBLOG_ATTACHMENT')</a></p> #end Those are the variables available now. For the images and attachments, there are 2 properties available, the URL and the name. |
|||||||||||||||||||||||||||||||||||||||||||||
had a look at the moblog plugin wiki docs, and the best way i can think of doing this is to make all the elements of a moblog post available in velocity, and add a moblog-template property to moblog.properties which would link to a .vm file with a template for moblog posts.
the VTL references most likely needed would be something like:
$MOBLOG-SUBJECT-LINE
$MOBLOG-BODY-TEXT
$MOBLOG-IMAGE
$MOBLOG-IMAGE-FILENAME
$MOBLOG-IMAGE-HEIGHT
$MOBLOG-IMAGE-WIDTH
$MOBLOG-ATTACHMENT
$MOBLOG-ATTACHMENT-FILENAME
$MOBLOG-SENDER
this could produce a moblog entry template such as: (PSEUDOCODE)
$MOBLOG-SUBJECT-LINE
<p>from $MOBLOG-SENDER:</p>
<p>
$MOBLOG-BODY-TEXT
}
#FOREACH($MOBLOG-ATTACHMENT) {
<a href="$MOBLOG-ATTACHMENT">$MOBLOG-ATTACHMENT-FILENAME</a>
}
</p>
Ok.... I've just written all of this out and then remembered that velocityis used to present the blog data files on the server, not to generate them as would be needed here, but i hope you get the general idea! essentially, control over how moblog posts are structured, in whatever form would be cool. I really should havve another crack at learning java and help out :)
cheers,
tim