تعديل / تغيير CSR لمشاهدة الصفحة للحصول على وظيفة في موقع بلوق

sharepoint.stackexchange https://sharepoint.stackexchange.com//questions/98322

سؤال

أنا أعمل على المسؤولية الاجتماعية للشركات لإضافة زر وتغيير مظهر وشعور مثل زر التعليق لموقع بلوق.حاليا أنا قادر على تحقيق ذلك، وهو وظيفي (زر).

CSR معاينة ل Custom UI

أنا أستخدم رمز أدناه (JSLink) لتحقيق ذلك. giveacodicetagpre.

الآن يجب أن أجعلها تبدو مثل هذا.

الرأي المطلوب

هل هناك طريقة يمكنني إلحاق زر بعد زر التعليق من الصورة 1، بعد أن يكون التلاعب CSS سيكون أسهل.

حاولت تجاوز مثل أدناه، giveacodicetagpre.

ولكن لحظتي لم تنجح على الإطلاق. ما الحقل الذي يجب أن أتجاوزه في حالتي.يخضع CSR موثق ل SharePoint، يرجى توحي لي أي مجال / علامة / عرض / كل ما تحتاج إلى تجاوز.

هل كانت مفيدة؟

المحلول

The command bar/links such as Like, Comment etc are outside the Body section of the blog. You can see the rendered HTML in firebug/IE developer tools.

Instead of overring the Body field, create a PostRenderHandler for your view and then it's all about injecting your extra HTML mark up at the correct element.

overrideContext.OnPostRender = your_function_here();

Within your postRender function, add something like this:

var ulDD = $("ul.ms-comm-forumCmdList li:last-child");
ulDD.before("<li id='liButton1' class='ms-comm-cmdSpaceListItem'><span><a class='myBtn' href='#'>Share</a></span></li><li id='liButton2' class='ms-comm-cmdSpaceListItem'><span><a class='myBtn' href='#'>Report</a></span></li>");

that would result as: enter image description here

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top