Jump to content

Setting default page for insert image in CKEditor


SamC
 Share

Recommended Posts

Hi,

I needed a way to insert images into the RTE so I created a template (no file) called site-images and added a field to that called siteImages which is an image field with unlimited uploads  (set to 0).

The idea is that when in my body field, a user can click on the image icon and insert an image. So the popup happens and I am given the choice of the current image on the page (from mainImage field) and a 'select from page'. This is where I can select my 'Site images' page which was created with the site-images template.

Basically, is there a way to set this page as the default option here? It's not very intuitive at the moment. Please see screenshot for example of what I'm talking about. Thanks in advance.

Capture.PNG

 

Link to comment
Share on other sites

2 hours ago, adrian said:

Thanks @adrian how do I try out your module from github? I'm only after something simple for starters. The paid module looks pretty good though too (but they'd have to spend £££), this site may have audio clips on it so managing could become tricky. It's a charity gig I'm doing for free (although building a new portfolio at the same time so I can get some self employed work again isn't altogether altruistic).

Link to comment
Share on other sites

You can manually install it, like any other module - just copy the file into your site/modules/ directory, do a modules refresh and click install. You might want to check out @mr-fan' s version in that thread I linked to as I think he extended it to also work with file fields (not just image fields), which you will want for audio clips.

  • Like 2
Link to comment
Share on other sites

21 minutes ago, adrian said:

You can manually install it, like any other module - just copy the file into your site/modules/ directory, do a modules refresh and click install. You might want to check out @mr-fan' s version in that thread I linked to as I think he extended it to also work with file fields (not just image fields), which you will want for audio clips.

Awesome thanks :)

Link to comment
Share on other sites

Hmmm, not working for me. I uploaded and installed module, set the root parent, but when I go to insert image via RTE, still defaults to the current page under 'If you would like to select images from another page, select the page below'. Not sure what I'm doing wrong here?

Screenshot 2016-11-30 18.37.17.png

Screenshot 2016-11-30 18.37.57.png

Link to comment
Share on other sites

Scratch that idea. I added a 2nd field for body images with unlimited uploads. Then when inserting via RTE the images just insert to this 2nd field. Seems more intuitive to me. I don't really need to select from other pages when I think about it.

Admin for a basic page looks like:

 

Title

Main image

Summary (RTE limited formatting options)

Additional images (for body content)

Body content (RTE full formatting options)

 

Works great, another +1 for processwire in my book.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...