Jump to content

CKEditor - Justify Preinstalled on Textarea Fields


prestoav
 Share

Recommended Posts

Hi all and thanks for the great work on PW!

One thing I find I have to do on any new site is add the Justify plugin to textarea fields as it is such a widely required feature for text headings in content.

ANy chance this could be added to the core an automatically be installed on new textarea fields using CKEditor?

Thank you!

Link to comment
Share on other sites

  • 4 weeks later...
On 4/3/2020 at 5:56 PM, elabx said:

You can use AdminOnSteroids to enable this on the text fields you need them, it's super handy, no need to install justify plugin or configure each field!

Sorry for the late reply, that works a treat!!!

Do you know if there is a similar way to set the tools as default as I couldn't see that in AOS?

For example I'd like these tools as default in the editor bar:

Format, Styles, -, Bold, Italic, -, Superscript, Subscript, RemoveFormat
JustifyLeft, JustifyCenter, JustifyRight, JustifyBlock

  • Like 1
Link to comment
Share on other sites

On 4/29/2020 at 5:01 PM, tpr said:

I think it's doable with AOS, check the FieldOverrides feature:

https://github.com/rolandtoth/AdminOnSteroids/wiki/FieldOverrides

Hi @tpr the FieldOverrides look neat 👍 I've never used them but I have a similar module that can override field settings based on template etc.

There's one problem though: Setting options for ajax fields does not work with my approach that hooks in buildForm 😞 So for example I can't set Image field settings like maxSize or allowed extensions because they have no effect when someone uploads a file.

Do you have the same limitation in your approach?

Link to comment
Share on other sites

On 5/1/2020 at 12:00 AM, bernhard said:

Do you have the same limitation in your approach?

Sorry for the delay - apparently no, I set the allowed extensions to "svg" and a "png" file wasn't accepted (even when setting field "Closed + Load only when opened (AJAX) †"):

[Allow SVG only for field 'images']
?field = "images"
extensions = "svg"

 

Link to comment
Share on other sites

1 minute ago, tpr said:

Sorry for the delay - apparently no, I set the allowed extensions to "svg" and a "png" file wasn't accepted:

The client side check does also work for me, but someone could trick that check by posting custom data and on the backend the field uses its original settings (from the database).

Did you check on the backend or only client-side?

Link to comment
Share on other sites

Only tried by dragging an invalid filetype to the fields. I now tried a trickyPNG.svg file and the backend responded with 500, perhaps it's a success? 🙂

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.
  • Similar Content

    • By Shohan Arafat
      I was looking for code sample where I can attach a textarea for setting up a content in my page. And I wanted to do it programatically. But I can't find a way to do that. Is it possible to add a content textarea with program?
    • By nabo
      Hello
      it would be nice if it could be possible to force a unique (or relative) imagefield for CKEditor.
      Example
      Using a repeater matrix (or repeater) with CKEditor field, the primary sources for images are imagefields in the page-repeater fieldset. Obviously I can change the page source, but I need to start from the root and this is not comfortable. In this specific situation the better solution is to have an imagefield in the parent page and force CKEditor to automatically go there... or if you want to have a "media library" go there first.
      Don't know which could be the best "setting system" but in my opinion this is an annoying problem.
    • By fruid
      inserting links i.e. <a>-elements, and only links, inside a CKEditor-summary field outputs the link-text and a weird " /> above the content-div (I'm using markup regions).
      I have no idea where this is coming from, all the other tags work perfectly, and the CKEditor-markup is fine too when adding links. It puts the <a>-element inside a <p> element but should be alright?
      Any hints?
    • By fruid
      I doubt nobody has seen this issue before…
      when I have an <h2> or <h3> or the likes in a CKEditor-body-field and I delete that header, the h-tag is applied to whatever comes next in line. I'm obviously talking about the WYSIWYG-view. Similar bugs occur when applying an h-tag, that tag sometimes encloses the next line as well. Could be that this happens when the next line is in the same "block"-element and not technically a new line but separated with a <br> but not always…
      When will a new version of CKEditor for PW be released or what's a competitive alternative at this point?
×
×
  • Create New...