Jump to content
prestoav

CKEditor - Justify Preinstalled on Textarea Fields

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!

Share this post


Link to post
Share on other sites

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!

  • Like 1

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Mmm, yeah unfortunately that's not doable in AOS! There might be a hook somewhere to overwrite that just beforehand, but I'm out of answers for now. I think you'll have to install the Justify plugin, it's also not that troublesome

Share this post


Link to post
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?

Share this post


Link to post
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"

 

Share this post


Link to post
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?

Share this post


Link to post
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? 🙂

Share this post


Link to post
Share on other sites

Hm.. Maybe 😄 Could you give me a pointer how and where your feature is implemented? 🙂 

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Jennifer Stock
      Hi. Sometimes when I select text in a textarea field outfitted with CK Editor, it fails to register as a "Block Style" and therefore the custom styles I have specified for block-level elements are not displayed in the Styles drop-down menu. If I open the page in an incognito window and select the same elements, the Block Style styles appear as expected in the Styles menu.
      Is this a caching issue of some kind? I've played with turning on and off the HTML "quality assurance" options as well as putting my custom styles directly within the CKEditor folder in the /wire directory. Once the field stops registering the selection of block-level elements, it also seems to have simultaneously stripped the custom styles that had been successfully applied to these block-level elements previously.
      Not sure what to do next.
    • By AndréPortuga
      Does anyone knows if there is a way of selecting a iframe inside a textfield(using ckEditor)? 
      I mean I have a Iframe with this code:
      <iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="315" scrolling="no" src="https://www.youtube.com/embed/PMaFJjZDrYM" width="100%"></iframe></p>
       
      but it's not getting responsive in iPhones.. So anyone know how can I select it via code for making it responsive?
       
      Thank you,
    • By dragan
      On one particular site, CKEditor behaves rather weird:
      When I copy and paste "normally", i.e. CTRL + V, there is an alert popping up "do you really want to leave this page?". If you cancel, the text is pasted into the field. If not, you get redirected to the frontend of the page you just edited, and the changes are lost.
      The "paste from Word" button doesn't work. CTRL + SHIFT + V works, but all formatting is lost (apart from paragraphs).
      I'm using inline editor mode, ACF + Purifier are activated. I know that if I disable those two, CTRL + V works, but I won't do that, since CKE then saves all the garbage code from MS-Office.
      Has anyone ever come across this issue? I tried with Chrome + FF. No JS errors.
    • By AndZyk
      Hello,
      I am currently building a intranet which will be hosted on the local network of a company. This intranet has many links to files on their fileserver with the protocol file://.
      So for example the links look like this file://domain.tld/filename.ext
      When I try to insert such a link into a URL field, I get the error, that only the protocol http:// is allowed. When I try to insert such a link into a CKEeditor link, it gets stripped out. Is it possible to insert such links into the FieldType URL and CKEditor.
      I know that I could use a FieldType Text or insert a RewriteRule in the .htaccess file, but I am looking for a more elegant solution. 😉
      Regards, Andreas
    • By prestoav
      Hi folks.
      I'm building a Formbuilder form to create new advert pages in a marketplace. Formbuilder is ideal for this. I need to add a description field that allows text to be added with line breaks etc. so showing a CKEditor field would be ideal (i.e. exactly like the field I'm typing into right now)!.
      Does anyone know if it's possible to add a CKEditor field to the front end presentation fo a Formbuilder field, maybe via a module or such?
      Many thanks!
×
×
  • Create New...