يجب أن أشير أيضًا إلى أنني أعتقد أن إضافة لافتة - للمستخدمين المجهولين - أسفل كل منشور مع أزرار إنشاء الحساب / تسجيل الدخول يعتبر أمرًا غير ودود للمستخدم، وأوصي بعدم القيام بذلك. ومع ذلك، لا أعرف الكثير عن حالة الاستخدام الخاصة بك هنا. هل فكرت في إضافة اللافتة / الصورة في أعلى موقعك بدلاً من إضافتها إلى كل منشور؟
أود الآن تحسين تجربة المستخدمين الجدد، لذا أحتاج إلى إجراء عملي.
حاليًا، يعمل النظام فقط على أجهزة الكمبيوتر الشخصية.
أقوم بالاطلاع على مقالات حول ملفات تعريف الارتباط (cookies) لأتمكن من إخفاءها أو إظهارها عندما ينقر المستخدمون على زر الإخفاء.
لقد اتبعت الخطوات ولكن عندما وصلت إلى صفحة تسجيل الدخول، لم يتم فتح النموذج تلقائيًا
<script type="text/discourse-plugin" version="0.8.25">
// Function to check if the current page is the login page
function isLoginPage() {
return window.location.pathname === "/login";
}
// Trigger login action when the page loads
document.addEventListener("DOMContentLoaded", function() {
console.log("DOMContentLoaded event fired.");
// Check if the current page is the login page
if (isLoginPage()) {
console.log("Current page is the login page.");
// Trigger login action
if (typeof api !== "undefined" && typeof api.showLogin === "function") {
console.log("API and showLogin function are available.");
api.showLogin();
} else {
console.error("API or showLogin function are not available.");
}
} else {
console.log("Current page is not the login page.");
}
// Get the login button element
const loginButton = document.getElementById("loginButton");
// Trigger a click event on the login button to open the login modal
if (loginButton) {
loginButton.click();
}
});
</script>
أتلقى console.error("API or showLogin function are not available.