55 Posts
Olek T.
8 years ago
Topic

Hello sebloders, here's the thing I try to accomplish:

In my case every article must have an intro image, also seen by 3rd party extensions. That's why I created field 'Upload image' (with storage: JSON/Article/images[image_intro]) - everybody can easily browse for a local image and easily place it in article. So far so good. 

But often there is no dedicated intro image, so I wanted to place a standard image whenever there is no image pointed by user in 'Upload image'. In this case this standard image is shown instead. To achieve this, I set 'Default value' of the field to 'images/standard_image.jpg' (of course the image is uploaded to 'images' directory). The thing is: thist standard image is shown in both intro and content view of the article, but 3rd party extensions (like 'News Show Pro GK5') don't see this image, because in content table in image column there is only: {"image_intro":""} instead of {"image_intro":"images/standard_image.jpg"}.

So here's my question: what should I do to have this standard image's location placed in my database whenever there is no other intro image placed?

Thank you in advance

Get a Book for SEBLOD
4229 Posts
Kadministrator
8 years ago
1
Level 1

Try setting live value, live value fills in the "real" value and should be saved as normal value, while default value is used as fallback value, that is used if there is no saved value (but is saved separately itself). In normal operation there should be no difference, but under the hood they are stored in a different way.

55 Posts
Olek T.
8 years ago
0
Level 2

Holy cow! This really works! Thank you Klas :-)

Get a Book for SEBLOD