Articles and images
#1
Posted 09 February 2012 - 10:58 AM
Article image adds a single image to the article with no position or size control. Adding an attachments field to the articles improves this slightly, but still provides no control over image size or positioning.
Neither option provides for captions.
Some of this could be addressed globally with CSS, but can I have better control over images in the article editor, similar to what's available in WordPress, for example?
#2
Posted 09 February 2012 - 01:50 PM
By default we use a single file upload field restricted to images to represent the article image. This allows for a lot of various interconnected functionality (such as showing the article image in frontpage and archive listings - something that is difficult to do when you utilize an attachments field and there could be 10 files uploaded, none of which are images). This is a basic file upload field that does not let you specify various parameters by itself.
However, you can control both positioning and size by editing the appropriate templates. For instance, to change how articles are displayed, you would edit the Article Templates -> "Article View" template. When doing so, find the code
<if test="$data['record']['article_image']">
<img src='{$data['record']['article_image']}' {parse resize_image="$data['record']['article_image']" maxwidth="225"} alt='' style="float: right; padding: 10px" />
</if>
If you wanted the image on the left instead of the right, change the float CSS to left. Or if you wanted it above the article, get rid of the float and wrap the image in a <div> (which you could then center for instance). Or cut this code out of the template and paste below the rest of the fields to move the article image to the end. Ultimately, it is a template and you have complete control to customize it.
Similarly, here you will see a maxwidth value of 225. You could change this, or you could even embed some PHP code to proportionately resize the image if you wanted. There are many options, depending on your level of comfort with modifying the templates, coding PHP, understanding our HTML logic, etc. As I said, anything is possible.
Brandon Farber
Developer / Senior Support
If it sounds like fun, it's not allowed on the bus!

Invision Power Services, Inc.
#3
Posted 09 February 2012 - 04:11 PM
Next: what to do when I want to publish an article with multiple images, say 20...?
I guess I need to find out if the IP.Content editor will support a more flexible article creation in some future iteration and allow me to create an article with one or twenty images just as easily.
An additional concern with making template modifications is compatibility with future upgrades.
What I'd really like to see is a content publishing system closer to what Joomla or WordPress offer. Not all of their bells and whistles are necessary, but at least the added flexibility for editing articles and images.
#4
Posted 09 February 2012 - 07:43 PM
Brandon Farber
Developer / Senior Support
If it sounds like fun, it's not allowed on the bus!

Invision Power Services, Inc.
#5
Posted 09 February 2012 - 07:56 PM
What about captions?
And are there any plans to add some of these capabilities to the editor?
#6
Posted 10 February 2012 - 09:31 AM
As for captions, you could create a custom bbcode for that I imagine, or create a new field in the Manage Fields area, and then just be sure to update the template to specify where that field should show (if you don't, it will show at the bottom of the article body). There are certainly ways to implement a caption at present, it just requires a little setup first.
Brandon Farber
Developer / Senior Support
If it sounds like fun, it's not allowed on the bus!

Invision Power Services, Inc.
#7
Posted 10 February 2012 - 02:22 PM
#8
Posted 10 February 2012 - 09:02 PM
Brandon Farber
Developer / Senior Support
If it sounds like fun, it's not allowed on the bus!

Invision Power Services, Inc.
#9
Posted 11 February 2012 - 11:04 PM
#10
Posted 13 February 2012 - 09:33 AM
Brandon Farber
Developer / Senior Support
If it sounds like fun, it's not allowed on the bus!

Invision Power Services, Inc.
#11
Posted 13 February 2012 - 09:48 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












