wonmew
(Eric)
27 ديسمبر 2019، 5:37م
1
أرغب في إضافة لافتة (بانر) إلى صفحتي الرئيسية، دون استخدام موضوع اللافتة، لأنني أريد إضافة صورة خلفية، ونص، أو زر.
A very common situation you’ll find yourself in as a theme developer is the need to create content that only shows on the homepage of your community.
You might add some HTML to the “After Header” section of your theme, which will then appear on every page. You can jump through some hoops in CSS to hide this everywhere except the homepage… but instead let’s use a Discourse theme to create a component with content that is only visible on your homepage.
If you’re unfamiliar with Discourse themes …
لقد اتبعت هذا الموضوع وحاولت وضع الجزء الأول من الكود في وسم <head> الخاص بي، ثم أضفت الجزء المتبقي إلى تبويب “بعد الرأس”، لكن لم يظهر أي تأثير. هل أقوم بشيء خاطئ؟ هل يمكنني إضافة لافتة مخصصة واحدة أو اثنتين فقط على صفحتي الرئيسية؟
hawm
(Hawm)
27 ديسمبر 2019، 6:10م
2
نعم، قد تكون قد ارتكبت خطأً، لكننا لا نستطيع معرفة ذلك لأنك لم تُظهر أي معلومات إضافية.
wonmew
(Eric)
27 ديسمبر 2019، 6:22م
3
هذا هو الكود الذي أضفته في منطقة “ما بعد الرأس” (After Header)
<script type="text/x-handlebars" data-template-name="/connectors/below-site-header/custom-
homepage">
{{#if displayCustomHomepage}}
<div class="custom-homepage-wrapper wrap">
<h1>أنا جون دو</h1>
<p>وأنا مصور</p>
</div>
</div>
</div>
{{/if}}
</script>
إذا قمت فقط بإضافة <h1>أنا جون دو</h1> <p>وأنا مصور</p>
فإنه يظهر في الأعلى، لكنه لا يظهر فقط في الصفحة الرئيسية، بل يظهر في كل صفحة.
dax
(Daniela)
27 ديسمبر 2019، 7:20م
4
يرجى استخدام وظيفة البحث قبل النشر.
وعلى سبيل المثال، يحتوي الرابط Versatile Banner أيضًا على الوظيفة التي تحتاجها.
JimPas
27 ديسمبر 2019، 8:57م
5
يمكنك أيضًا الاطلاع على هذه الروابط (والتي توجد في موضوع رابط دانييلا أعلاه).
Hello,
I have an issue : I want a specific banner on the homepage only.
I saw that it was possible but I don’t find any subject resolving my problem. Maybe, the fact that I’m still in trial is a factor.
Can you help me please ?
يُوضع كل الكود في قسم وليس بعد الرأس