Forum

Thread tagged as: Question

sizing an image in a blog

Hi

I understand how to size the 'default' image in a blog post. I understand how to size an inline image in a page in e.g. a text_block template but how/where do I set an image size that is added inline in a blog post? When I add an image in this manner, I'm just getting the raw uploaded size (which inevitably overflows its container) so clearly I'm missing setting something somewhere.

Thanks for any help.

mark buckley

mark buckley 0 points

  • 3 years ago
Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Mark,

The default blog post template includes a textarea for the main post content:

<perch:blog id="postDescHTML" type="textarea" label="Post" order="2" editor="markitup" markdown="true" size="xxl autowidth" required="true" />

It sounds like you want to control the size of the uploaded images through this field. You should be able to do so by adding the imagewidth and imageheight attributes to the tag:

<perch:blog id="postDescHTML" type="textarea" label="Post" order="2" editor="markitup" markdown="true" size="xxl autowidth" required="true" imagewidth="500" imageheight="300" />

There are a few more optional image upload attributes you can use here.

That's the fella! Thanks very much Hussein, very helpful.

Cheers - Mark