Resource icon

Page as portal homepage

Question. Right now this allows me to show the latest threads perfectly fine, but I want to do this for a user who does a web comic. Right now when it flashes to the front page it shows the first post - the comic itself. I can't get this to do this as a widget.

In the Portal addon this is done by having a block called "Recent News" that posts the wording of the post not just a list/link of the posts.

Thoughts?
 
Oh ^%$^!! I had made two separate ones to test and see what they each did. I WAS CHANGING THE OPTIONS ON THE WRONG ONE!!

For the love of...


Thanks for making me go back and look again. The problem is User Error.:cry:
 
See my forum here https://www.idgames.de.
I've previously used XenPorta but this works almost as good as the addon. There's no pagination, of course, but still works quite well.
Thanks. What I like about @Brogan Featured Posts add-on is that I can get user generated liked content right to the front page. So all the best forum content gets featured on the home page automatically (see my site www.ducatiforum.co.uk).
 
For featured threads... you guys might want to check out https://xenforo.com/xf2-docs/dev/lets-build-an-add-on/ -- the guys as part of the Dev Docs go into detail on how to create a "Featured Threads" demo add-on, including a portal page, and it does pagination.

EDIT: Slight addendum, for the "TLDR" crowd, scroll to very bottom of that link, download the example zip file, and install it on your test site. It's a pretty much finished "Featured Threads" type add-on; my quick 'wish list' items would be able to specify the length of content that is shown and a few widgets to show a random/newest featured thread at top of the forum and other places like Brogan's did.
 
Last edited:
@RobParker

Any widgets that i put in

<xf:widget key="forum_overview_new_profile_posts" />

is not fetching the widget... but yes.. if i put them in sidebar it fetches.. like this

<xf:widget key="forum_overview_new_profile_posts" position="sidebar"/>

What am i doing wrong? I want to place the widgets the main area.
 
This is my example page and showing step-by-step how I made that.

Demo: https://www.beke.co.nz/pages/page-test/

All widget in use are Xenforo default and XFMG widgets.

1.
Create HTML widget
Widget key - bob_YouTube_channel
Title - My YouTube channel
Advanced mode - checked

Template (use yout own youtube channel data):
Code:
<div class="block" {{ widget_data($widget) }}>
        <div class="block-container">
            <h3 class="block-minorHeader">
                <a href="https://www.youtube.com/channel/UCHPTqKjgCkX0P2thd57ouuA?view_as=subscriber">YouTube channel</a>
            </h3>
            <div class="block-body block-row">
                <iframe width="330" height="190" src="https://www.youtube.com/embed/0e59SrCR18g" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
        </div>
    </div>
</div>

2.
Create HTML widget

Widget key: bob_google_search
Title: Google Custom Search
Advanced mode - checked
Template (use yout own google code https://cse.google.com/cse/ ):

Code:
<div class="block" {{ widget_data($widget) }}>
        <div class="block-container">
            <h3 class="block-minorHeader">
                Search Site
            </h3>
            <div class="block-body block-row">
                <script>
  (function() {
    var cx = '005304239377301464960:xr3-wv-mb18';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
  })();
</script>
<gcse:search></gcse:search>
        </div>
    </div>
</div>

3.
Add widget "New threads"
Widget key: xp_nove_teme
Title: New threads
Display style: Expanded
Save

4. Create page
URL portion: page-test
Advanced mode - checked
Override user style choice - checked

Template (Add the widget you want):

Code:
<xf:css>

<xf:comment>Hide Title</xf:comment>

<xf:h1 hidden="true" />

<xf:comment>Hide published info</xf:comment>

.listInline {

            display: none;
    }

<xf:comment>Hide sharde icons - bottom page</xf:comment>

.blockMessage--none {

                    display: none;
                 
    }

<xf:comment>Hide breadcrumbs</xf:comment>

.p-breadcrumbs {

               display:none;

    }

<xf:comment>Sidebar width </xf:comment>

.p-body-sidebar {
                 width: 350px;
    }
 
.message-body{
 
                 max-height: 350px;
                 overflow: hidden;
    }
 
<xf:comment>Gradient fill to text</xf:comment>
 
.bbWrapper:after {
                  content: "";
                  position: absolute;
                  z-index: 1;
                  bottom: 0;
                  left: 0;
                  pointer-events: none;
                  background-image: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255, 1) 90%);
                  width: 100%;
                  height: 8em;
    }
 
</xf:css>

<div class="p-body-main p-body-main--withSidebar ">
         
            <div class="p-body-content">
         
                <div class="p-body-pageContent">
             
                      <xf:comment>----Random media----</xf:comment>
                 
                                 <xf:widget key="xfmg_random_slide" />
                 
                     <xf:comment>----New Thread Expanded----</xf:comment>
                             
                                 <xf:widget key="xp_nove_teme" />
                 
                     <xf:comment>----Latest video----</xf:comment>
                 
                                 <xf:widget key="xfmg_page_random_slide" />
                 
                     

                </div>
             
            </div>

            <xf:comment>----Sidebar----</xf:comment>
         
            <div class="p-body-sidebar">  
         
                 <xf:comment>----YouTube hannel----</xf:comment>        
                           
                 <xf:widget key="bob_YouTube_channel" />
             
                 <xf:comment>----Google custom search----</xf:comment>
             
                 <xf:widget key="bob_google_search" />
             
                 <xf:comment>----New Profile Posts----</xf:comment>
             
                 <xf:widget key="forum_overview_new_profile_posts" />
             
                 <xf:comment>----New Post----</xf:comment>
             
                 <xf:widget key="bob_new_post" />
             
             
            </div>
         
</div>
 
Last edited:
@DL6 Most liked posts, XFMG, HTML and Latest profile posts widgets.

Demo: https://www.beke.co.nz/pages/dl6/

Template:
Code:
<xf:css>
<xf:h1 hidden="true" />

.listInline {
            display: none;
  }
   
.message-footer{
            display: none;
}

.shareButtons {
           display: none;
}

.p-breadcrumbs {
               display:none;
}
   
   
    .blocks[data-widget-id="49"]{      
          display: flex;
          flex-wrap: wrap;
          align-items: stretch;
          width: auto;
            }
    .block[data-widget-id="49"]{
          max-width: 410px;
          max-height: 380px;
          overflow: hidden;
    }
    .block[data-widget-id="29"]{
             min-width:1180px;
   
    }
.p-body-sidebar {
                 width: 350px;
    }
.bbWrapper:after {
       content: "";
       position: absolute;
       z-index: 1;
       bottom: 0;
       left: 0;
       pointer-events: none;
       background-image: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255, 1) 90%);
       width: 100%;
       height: 8em;
    }  
</xf:css>

<div class="p-body-pageContent">
           
                     <xf:widget key="xfmg_random_slide" />
                                 
    <div class="p-body-main p-body-main--withSidebar ">          
               
                    <xf:widget key="most_liked_posts" />
                    <xf:widget key="xfmg_page_random_slide" />
                         
                 <div class="p-body-sidebar">
           
                 <xf:widget key="bob_YouTube_channel" />              
                 <xf:widget key="bob_google_search" />
                 <xf:widget key="forum_overview_new_profile_posts" />
               
                </div>
           
    </div>
   
</div>
 
Last edited:
@DL6
I'm using your Newest Threads widget with this (without the position set), but the problem is I can't use it in expanded view without it knocking the sidebar off to the bottom of the page. I tried using boban's template as a blueprint, but no matter what I've tried the sidebar widgets end up at the bottom. Any idea what I need to do to get everything to right? TIA
 
Last edited:
Right now I'm pretty much just using RobertParker's default setup, so:

<xf:h1 hidden="true" />

<xf:widget key="siropu_chat" />
<xf:widget key="new_threads_homepage" />
<xf:widget key="new_threads_with_prefix_limit" position="sidebar" />
<xf:widget key="members_recently_online" position="sidebar" />
<xf:widget key="most_likes" position="sidebar" />
<xf:widget key="most_liked_threads" position="sidebar" />
<xf:widget key="forum_overview_new_posts" position="sidebar" />
<xf:widget key="forum_overview_forum_statistics" position="sidebar" />
<xf:widget key="member_wrapper_newest_members" position="sidebar" />

<xf:css>
.p-breadcrumbs {
display:none
}</xf:css>

It looks fine when New Threads is in simple view, the problem is just with full view. I've tried messing with page width, sidebar width and spacing, etc.. I checked out the templates for it, but it wasn't obvious to me how to go about decreasing the dimensions of the widget in full view, if that's what it requires.
 
Top Bottom