Willy
(Willy)
13 يونيو 2025، 5:29م
1
إذا تم تثبيت المكون الخاص بي على ثلاث منتديات مختلفة:
https://forum.someone.com/
https://other.com/forum
https://player.com/
كيف يمكنني استخراج عنوان URI الأساسي إذا كنت في دليل فرعي مثل https://forum.someone.com/mytopic/blablaba؟
Lilly
(Lillian Louis)
13 يونيو 2025، 5:33م
2
أعتقد أنك ربما تبحث عن هذه الميزة، والتي لم يتم دمجها بعد
Once this PR is merged, you’ll be able to use %{base_path} in theme setting descriptions:
إعجابَين (2)
Moin
13 يونيو 2025، 8:59م
3
أين تريد استخدامه؟
على سبيل المثال، يستخدم سمة “شبيهة بريديت” discourse/helpers/base-path في القالب لإنشاء رابط “قائمة الفئات” في رسالة الترحيب على اليمين.
tags: this.args.tag?.id,
});
}
<template>
{{#if this.isTopRoute}}
<div class="custom-right-sidebar_welcome">
<h2>{{i18n (themePrefix "top_route_welcome")}}</h2>
<p>
{{htmlSafe
(i18n (themePrefix "top_route_description") basePath=(basePath))
}}
</p>
{{#if (and this.currentUser this.currentUser.can_create_topic)}}
<DButton
class="btn-primary"
@id="custom-create-topic"
@action={{action "customCreateTopic"}}
@label="topic.create"
/>
{{/if}}
هناك أيضًا أمثلة حيث يتم استخدام discourse/lib/get-url للحصول على عنوان URL في دالة JavaScript.
5 إعجابات