כיצד להסתיר שדות (כותרת, קטגוריה, הזנת תג) בעת יצירת נושא חדש עם openNewTopic

סיכום מבוסס בינה מלאכותית

The discussion revolves around hiding the title, category, and tag input fields when creating a new topic using the openNewTopic function in a Discourse plugin. kuaza wants to display only the message input area upon clicking the “Create New Topic” button, suggesting the use of a plugin to set a default title while hiding other fields. They inquire whether this can be achieved via this.composer.openNewTopic parameters or if an alternative approach, such as CSS, is needed. pfaffman suggests hiding the fields with CSS, but kuaza notes that CSS hiding causes the fields to be invisible even during editing, making it impractical. They seek a solution that allows control over which fields appear when opening the composer, acknowledging that a straightforward method may not exist.

When the “Create New Topic” button is clicked, I wish to display solely the message input fields. The other sections can be adjusted after the topic is initiated with AI.

https://github.com/discourse/discourse-new-topic-button-theme-component

My goal is that clicking the button added a top the website triggers the creation of a new topic, revealing only the message input area. Technically, I can specify the title within the plugin, thus avoiding missing title errors; however, I prefer to conceal these fields altogether.

Within the plugin, my daughter has implemented the following code to open the new topic editor:

  @action
  createTopic() {
    this.composer.openNewTopic({
      preferDraft: true,
      category: this.currentCategory,
      tags: this.currentTag,
      title: "Example title hide.",
    });
  }

I want to enhance this code to hide the title, category, and tag fields. Is it possible to do so using “this.composer.openNewTopic” and its available parameters? Or should I consider an alternative approach, such as using JavaScript triggered by the button click to hide these fields?

In the response editor, there is only a writing area; I would like to use it similarly to create a new topic.

פשוט תסתיר את זה עם CSS.

ניסיתי זאת, אך לצערי, זה נשאר מוסתר בכל היבט. כתוצאה מכך, כשאני רוצה לערוך את הנושא, הקטגוריות והתגיות אינן גלויות. באופן אידיאלי, הייתי רוצה לדעת את הפונקציות שמאפשרות לי להגדיר את האלמנטים האלה בעת פתיחת ה-“composer”. כך אוכל לבחור מה יופיע בתוך החלק שמשיק את ה-“composer”. אני מאמין שאין פתרון פשוט לכך; אני אשקול זאת עוד.