• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[bd] Widget Framework

Status
Not open for further replies.
It depends on where you run your code. If you are in the View, you can always get the template's params (getParams) to see which node is being rendered. XenForo (at application level) doesn't care which node is being rendered at all. XenForo also doesn't save any states as global variables. Btw, it's quite off topic here. You can post your question at the dev area ;)
Thank you for the hints. It seems off topic but not really off topic. I want to modify the threads addon to dynamically render nodes according to the current category in the view. May be I can get help in dev area.
Thank you.
 
Hello. I have made ​​these changes to the file TemplateHook.php in LNBlog/Listener and I added the file WidgetRenderer.php to LNBlog directory. Renders well but does not pass the proper parameters to display the widget when blog have posts, implying that nothing is published.

leave both files in attachments to see if I can get some help.

Salud2
 

Attachments

Hello. I have made ​​these changes to the file TemplateHook.php in LNBlog/Listener and I added the file WidgetRenderer.php to LNBlog directory. Renders well but does not pass the proper parameters to display the widget when blog have posts, implying that nothing is published.

leave both files in attachments to see if I can get some help.

Salud2

Hi,

First, I don't think it's a good idea to put the listener in TemplateHook.php. It's just unrelated ;) But anyway, thank you for spending time making this. I have checked the scripts. Seems to be good. The problem why it doesn't work is: [LN] Blog doesn't use the same method to render sidebar like other addons so this approach won't work. I haven't have my dev machine here so I can't test but you should do something like this in WidgetRenderer.php

PHP:
class LNBlog_WidgetRenderer extends WidgetFramework_WidgetRenderer_ForumListOnly_Abstract {
    protected function _getConfiguration() {
        return array('name' => '[Solo Lista de Foros] [LN] Blog', 'useWrapper' => false);
    }
    public function parseOptionsInput(XenForo_Input $input, array $widget) {
        $options = XenForo_Application::get('options');
        $found = $options->lnblogGeneral_On_Off;
        if (empty($found)) {
            throw new XenForo_Exception(new XenForo_Phrase('wf_x_not_installed', array('target' => '[LN] Blog')), true);
        }
        return parent::parseOptionsInput($input, $widget);
    }
    protected function _getRenderTemplate($templateName, array $params) {
        return 'lnblog_sidebar_recent_entries';
    }
    protected function _render(array $widget, $templateName, array $params, XenForo_Template_Abstract $renderTemplateObject) {
		$entryModel = XenForo_Model::create('LNBlog_Model_Entry');
		$viewParams = array(
			'recentEntries'	=> $entryModel->getRecentEntries()
		);
		$renderTemplateObject->setParams($viewParams);

        return $renderTemplateObject->render();
    }
}

And actually, this widget can run everywhere. Not just forum_list ;) Hope it works

PS: You can see the original code in TemplateHook.php, line 55
 
Both the widget that I have published as the widget which include parameters, work on site when PORTAL is the forum home page. The behaviorboth is similar. Retouched the routes on my board and the forum list is /foro/ not /forum/.

This can cause of it still does not see it in forum list?

Salud2
 
Both the widget that I have published as the widget which include parameters, work on site when PORTAL is the forum home page. The behaviorboth is similar. Retouched the routes on my board and the forum list is /foro/ not /forum/.

This can cause of it still does not see it in forum list?

Salud2
Sorry, I didn't get your point. Please start a conversation with me and explain it a little bit further. Thanks
 
Tabbed widgets are not being showed properly. If anyone has a fix for flexile users, that would be great!

1070105768.jpg
 
GREAT Add-on!!

Easy setup - currently running on my site- ironrangers.net

The HTML widget was very handy- I just dropped in the code from gametracker, and I had instant ventrillo status module on my site! Very, very easy

The only issue that I had was when i went to create a tabbed module for recent threads / posts/ etc, the background of the tabs was off. No big deal, I went back to just one option. probably style/css issue

Overall a 10/10 add-on!
 
one quick question- maybe i missed it reading through the thread

in recent posts, is there a way to only show the posts that a user has permission to see?

For example- currently an unregistered user can see the post title of threads that are in the members only area.
We also have a few private forums that I would not want the thread titles to show to regular members, only to those with permission to view that forum

again- apologize if I missed it somewhere.
 
You will need to fix this with your own CSS

I have a terrible css knowledge, actually none :D Flexile has this problems with add-ons using a sidebar. If anyone could show how and where to fix that would be awesome. I'm not the only one using flexile and the widget framework together It would help others too.
 
I have a terrible css knowledge, actually none :D Flexile has this problems with add-ons using a sidebar. If anyone could show how and where to fix that would be awesome. I'm not the only one using flexile and the widget framework together It would help others too.
First thing I did with Flexile was change the sidebar to 260 px this fixed ton's of issues for me (default is 250px)

PHP:
.sidebar {
    float: right;
    font-size: 11px;
    width: 260px;
}
 
First thing I did with Flexile was change the sidebar to 260 px this fixed ton's of issues for me (default is 250px)

PHP:
.sidebar {
    float: right;
    font-size: 11px;
    width: 260px;
}

And add this to extra.css I presume ?

Edit: Added but didn't change anything.
 
You need to investigate why that change isn't being applied then.
Check the sidebar.css template.
 
ok here is some more findings. If i go to tools and rebuild the cache it will fix it. However if i log into my username which is admin and then log out, it goes back to showing everything. On my cellphone as just being a unregistered guest, when i rebuild the cache it will correct the issue and only show the guest section. but once i log into my admin account on my computer, if i refresh from my cell phone (as still a guest) it will then show everything again on the list. Its almost like its tied into the admin account and whatever the admin does, it will show. For example again, if i restrict the admin group from viewing a section, it will remove that from the list as well as the list that unregistered guest see. Wierd?

I think you caught a bug. I'm looking into it now

Hey, love this add-on. Any update on this issue, I'd like to make sure it's resolved before it makes it off my dev server. ;)
 
You need to investigate why that change isn't being applied then.
Check the sidebar.css template.

It's hard expecially when you don't know what you are investigating :)

I saw this part:

HTML:
.sidebar
{
    @property "sidebar";
    font-size: 11px;
    float: right;
    width: 260px;
    @property "/sidebar";
}

in sidebar.css and changed the width but that didn't do any good.
 
The sidebar width can be set in Style Properties.
Aye if you use them :) changing the css will auto update that ^_^
Yeah, I just did that too. But that didn't help either.
If you looks at your members "avatars" they will fit alot better in Flexile Skin, As for the block tabs I am unsure on your css set up so can't really help with that
 
Status
Not open for further replies.
Top Bottom