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

boetti
boetti

Hey everyone!

I am a newbie with octobercms and have some little issues with the builder-plugin. Maybe one of you can help me or give me a tip on how to implement this:

  1. I created with RainLab.Builder a backend form where my customers editors simply add news to the site. Unfortunately there's no opinion to prevent leaving the form without saving. is it possible to show a simple modal?

  2. I have two datetime fields. The date of publication is entered in the first, the end date of publication in the second. Now i want that the "min-date value" of the second field gets the date of the first field.

  3. Finally i have a textarea where i want to get the "exact" data via the preset-function from a richeditor field. That work perfect with textarea to textarea. I think the problem are the HTML-tags in the richeditor. Is it possible to filter them out?

With a few tips you would help me a lot. Gladly only on individual issues.

Greetings from rainy and freezing cold Germany

Tobias

daftspunky
daftspunky

Hi, welcome to October CMS, these are good questions that will require some exploration on your part. I will do my best to offer some high level guidance.

For the first point, you can use the input monitor plugin, by attaching this to the form

<form
    data-change-monitor
    data-window-close-confirm="There is unsaved data"
>
    ...
</form>

For the second point, research the filterFields method and dependsOn definition in documentation to manipulate the field datetime field values. Ideally you want the second field to depend on the first field, so when the first field changes, it manipulates the minimum date of the second, it can even pre-fill the value this way.

The third point, it's not entirely clear what you're trying to do, although this may require custom JavaScript since the RichEditor has a JS API that you would need to interface with to get the exact data, but also strip the HTML from it to preset the other textarea.

Finally, I would suggest looking at other plugins to achieve the desired result, this is a great way to learn. The Test plugin offers a wide array of use cases and would even be useful in describing your requirements more clearly.

boetti
boetti

Hey Daftspunk!

Thanks a lot for the great tips on my two first points and the tip with the Test plugin. Didn't know that before. :-)

daftspunk said:

The third point, it's not entirely clear what you're trying to do, although this may require custom JavaScript since the RichEditor has a JS API that you would need to interface with to get the exact data, but also strip the HTML from it to preset the other textarea.

The text area should contain the og-description based on maybe the first 100 characters of the rich editor. It should be automatically get the text, but the user should still be able to edit the og-description. But of course it´s necessary to remove all HTML...

Maybe a screenshot describes it better: https://snipboard.io/zGicZQ.jpg

Thanks again for the great guidance!

1-3 of 3

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