Wiki Page widget that displays only body content

Former Member
Former Member

I'm wondering if there is a way to alter the "Wikis - Page" widget so that it displays only the body text of the wiki page, and not the title or the hoopla at the bottom, i.e., this stuff:

I am betting that I could create a copy of the "Wikis - Page widget", and then delete the appropriate code so that it only displays what I want. Yes? However, as a non-developer and someone whose eyes glaze over when they see code, I have no idea how to do this. So my question is really this: is this an easy thing to do that could be explained in Coding for Kindergartener terms? Or is this something that is complex enough to require real coding knowledge? 

If the former, I'd be grateful for a step-by-step. (And as a thank you, you would receive the "Taught Jocelyn How To Code" achievement, which is actually quite coveted in communities around the world...)

  • This is essentially what you would do yes.  But rather than eliminate code, I would start with a new widget.  From the existing widget  you need the code  to get the current wiki and page and publish state, It also includes a view count increment and reads the body.  Then create a new attachment style.less and copy the contents from the wiki-page widget's version of that file(note you may not even need this but I didn't deep dive, you can try and see).

    Then basically this is all it is:

    $core_v2_page.AddLink('stylesheet', $core_v2_widget.GetExecutedFileUrl('style.less'), "%{ Position = 'AfterTheme' }")
    
    #set ($wiki = false)
    #set ($wiki = $core_v2_wiki.Current)
    #if (!$wiki)
    	$core_v2_widget.Hide()
    #end
    #set ($page = false)
    #set ($page = $core_v2_wikiPage.CurrentOrDefault)
    #if (!$page)
    	$core_v2_widget.Hide()
    #end
    #set ($body = $page.Body())
    
    $core_v2_wikiPage.IncrementViewCount($page.Id)
    
    #if(!$page.IsPublished)
    	<div class="message warning">
    		$core_v2_language.GetResource('DraftPost')
    	</div>
    #end
    
    <div class="content full without-author text">
    	<div class="content">$!body</div>
    </div>



    Note you can remove the section on publish state and modify the hide logic to hide if !$page.IsPublished.  If you choose to keep it you will also need to get the DraftPost resource and add it to the resources.