This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

clone458396
clone458396

Hello,

My site's homepage is not currently a "static page". It's just a normal page listed under the CMS tab. At the top of the homepage is a large background image. What's the best way to allow my clients to change that background image? (We can pretend that it's not a background image, if that simplifies the question.)

Some thoughts that come to mind:

  1. Convert the homepage to a "static page", then use a "placeholder" for the image. The problem with this technique is that my homepage is technically pretty complex. The static page WYSIWYG editor would probably choke on the markup.

  2. Use a "content block". However, content blocks only support HTML, Text, and Markdown -- not images. Certainly an image could be within a content block (as an tag), but there's no connection to the media library ( - right?).

  3. Using the Editable Plugin - but it also doesn't support image using the media library: http://octobercms.com/plugin/rainlab-editable/editable-images

Thanks, Bret

alxy
alxy

Actually I found a pretty good method to do this:

You can find documantation about the feature here: http://octobercms.com/docs/themes/development#customization

Your theme.yaml could look like this:

form:
    fields:
        image:
            label: Header image
            type: mediafinder

In your layout, you can display the image like this:

<img src="{{ this.theme.image|media }}" />
clone458396
clone458396

Alxy,

Thanks a ton for that suggestion! It'll hold me over until a better solution comes around. It'll be a little strange when I tell my clients to edit the homepage content using the [content] section, but edit the homepage image in the themes settings, but they'll survive. I have about 10 pages with header backgrounds, so my theme settings are going to get a little bit long!

Cheers and thanks again! Bret

craw
craw

I have similar problems. It would be nice to have an Image snippet for the static page plugin. So the client click on the snippet and the Media Manager / File Upload forms open and the client can select / upload another image.

Does somebody have an idea how to make that?

alxy
alxy

This is also possible with a recent update in the StaticPages plugin: https://github.com/rainlab/pages-plugin#custom-page-fields

For an example implementation, have a look on the Relax Theme in the Themes registry.

craw
craw

I checked the Relax Theme and the new custom-page-fields feature of the Static Pages Plugin but it doesn't fit.

My Website looks like this: Website

If I use the Static Page Plugin with the new custom-page-fields feature StaicPages a bit confusing for my client.. it would be better to have all the "Band stuff" in a Band tab and all the "History stuff" in a History Tab an so on..

Last updated

Krilo_89
Krilo_89

Hi Craw,

Your last foto doesn't show up. Did you get the static pages plugin to work with your theme?

craw
craw

No, the Static Page Plugin alway has the Tab "Content", and there is no possibility to rename / remove that Tab.

For my client it would be better to have all the staff like "Band" in one Tab with a Textfield, image upload, ... and for example all the "History" staff in another Tab with Textfield, Image Upload,...

For now I use the Inline Edit plugin and made my own plugin "Website Images", wich is a collection with all the images used in the Theme, so my client can update all images.

1-8 of 8

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.