Form Designer

alt=
Marla
@sweet
3 weeks ago
53 posts
Hi,

I've added a new field in the profile form, "profile_bg", which uploads an image to be set within a div. How do I call that image in a div style?

Example attached.

Thanks!

Marla
div.png
div.png  •  22KB

michael
@michael
3 weeks ago
7,772 posts
There's lots of tweaks to it you can do but a pretty standard way would be:

<div>{jrCore_module_function function="jrImage_display" module="jrProfile" type="profile_bg" item_id=$item._item_id size="large" crop="auto" class="my_profile_bg_image_class other_class_i_want_to_use img_scale" alt="profile background image" width=false height=false}      </div>

the item_id= part needs to use whatever variable the item id is on for the page where you're using it.
alt=
Marla
@sweet
3 weeks ago
53 posts
How do I set the img size to auto so that the bg image size is the width and height of the actual image upload?
michael
@michael
one week ago
7,772 posts
the .img_scale class will be in most skins and will do the auto scaling for you. If your skin doesn't have it then its this:
.img_scale {
  width: 100%;
  border-radius: 5px;
}


--edit--
or maybe you're wanting
size="original"

updated by @michael: 01/05/25 02:38:23AM
alt=
Marla
@sweet
one week ago
53 posts
Ah! Ok, I just want to be able to edit the size.

Thank you, Michael.



michael:
the .img_scale class will be in most skins and will do the auto scaling for you. If your skin doesn't have it then its this:
.img_scale {
  width: 100%;
  border-radius: 5px;
}


--edit--
or maybe you're wanting
size="original"
michael
@michael
one week ago
7,772 posts
You have to have a base size then you can adjust from there.

Valid base sizes are:
xxsmall,xsmall,56,small,icon96,icon,medium,large,larger,xlarge,xxlarge,xxxlarge,1280,1600,original

if from there you want to specify more you can by adding
 width="20" height="20"
to the jrImage_display function.

So the SIZE is to get the cached version out to the screen then those extra parameters are to fine tune it. You wouldn't use a size of 1280 then a width of 20 because the load time would be high and the image tiny.

Tags