History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BLOJSOM-54
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: David Czarnecki
Reporter: David Czarnecki
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
blojsom

Allow for modifications of moblog image attributes

Created: 09/Mar/05 08:40 PM   Updated: 05/Apr/05 09:04 PM
Component/s: blojsom plugins
Affects Version/s: blojsom 2.23
Fix Version/s: blojsom 2.25

Browser: Firefox
Application Server: Tomcat 5.0.28
JDK Version: Mac OS JDK 1.4.2_05
O/S Version: OS X 10.3.8


 Description  « Hide
From Tim Colinshaw:

I was wondering if there was any way of editing the code used by the
moblog plugin to insert images into a blog entry?
the images my camera generates are too big for the containing element
in the blojsom template, and spill out underneath all the links at the
side of my blog. could i produce a velocity template with something
like

<img src="$MOBLOG_IMAGE" alt="$MOBLOG_ALT" width="75%" height="75%" />

to counteract this, or someway alter the properties of the img tag
generated?


 All   Comments   Change History      Sort Order:
Tim Cowlishaw - [10/Mar/05 03:54 AM ]
Cheers for picking up on this, David!

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

Tim Cowlishaw - [10/Mar/05 04:00 AM ]
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

David Czarnecki - [05/Apr/05 09:04 PM ]
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.