The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

More instances ->> Widget: Recent topics of a specific sub-forum

3 posters

Go down

Solved More instances ->> Widget: Recent topics of a specific sub-forum

Post by HrvojeP December 30th 2013, 5:58 pm

Hello!  Hello



I found very useful this tutorial: Widget: Recent topics of a specific sub-forum. (Widget)

To have more than one subforum exposed to forum members I must create more widgets which are nearly the same. The difference between these widgets is just the link to the subforum. Also, it was neccesary to write separate CSS code for each widget.

 Question What to do to pass the argument with a link to the same widget?
 Question Is it possible to think about widget as about an object receiving parameter value?


Thank you for the help.


Last edited by HrvojeP on December 31st 2013, 2:31 pm; edited 1 time in total
HrvojeP
HrvojeP
Forumember

Male Posts : 161
Reputation : 2
Language : Croatian, English
Location : Croatia

http://drvenibrodovi.forumcroatian.com/

Back to top Go down

Solved Re: More instances ->> Widget: Recent topics of a specific sub-forum

Post by Ange Tuteur December 31st 2013, 2:00 am

Hello HrvojeP ,

This is possible and after reflection I have updated the tuto with a class name. The reason as you mentioned, you should not have to add more CSS to style each newsareal, so you should now be able to apply this to all by using a single class name. ( updated here : https://help.forumotion.com/t129060-widget-recent-topics-of-a-specific-sub-forum#864372 )

The ID will be instead used to load the topics into the element.

I have set an example for multiple newsareals in one widget, please see below. ( I use phpbb3 )

First our CSS to style our link :
AP > Display > Pictured and colors > Colors > CSS stylesheet
Code:
   .newsareal div.topic-title-container {
    display: block !important;
    margin: 2px 1px 0;
    padding: 2px 5px 5px 30px;
    border: 1px solid #B1BFC0;
    border-radius: 5px;
    background: #F3F9F9 url('http://i44.servimg.com/u/f44/16/54/26/99/old-ve10.png') no-repeat 5px center;
    }
    .newsareal div.topic-title-container:hover {
    background-color: #D8DEDE;
    }
    .newsareal div.topic-title-container a {
    color: #708090 !important;
    text-decoration: none !important;
    text-shadow: #fff 1px 1px 0px
    }

Now we create widget : (you do not have to do exactly like this  )
AP > Modules > Portal and widgets > Forum widgets management > create a new widget
Code:
<h3>newsareal 1</h3>
<div id="newsareal1" class="newsareal"> </div>
<h3>newsareal 2</h3>
<div id="newsareal2" class="newsareal"> </div>
<h3>newsareal 3</h3>
<div id="newsareal3" class="newsareal"> </div>
<h3>newsareal 4</h3>
<div id="newsareal4" class="newsareal"> </div>

I title each section, and below my title I place the div element which loads my topics. I label each one with a different ID to be used in the javascript. We use the same class for each div to be able to style every link.

Now we create our javascript :
AP > HTML & JAVASCRIPT > Javascript codes management > create a new script
Code:
jQuery(document).ready(function(){
jQuery("#newsareal1").load("/f1- div.topic-title-container:lt(3)");
jQuery("#newsareal2").load("/f2- div.topic-title-container:lt(3)");
jQuery("#newsareal3").load("/f3- div.topic-title-container:lt(3)");
jQuery("#newsareal4").load("/f4- div.topic-title-container:lt(3)");
});

I load a different forums topics for each ID. Each div will load three topics, but can be changed.

The result :
More instances ->> Widget: Recent topics of a specific sub-forum Captu273
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: More instances ->> Widget: Recent topics of a specific sub-forum

Post by HrvojeP December 31st 2013, 11:12 am

Hello Ange Tuteur!  Hello 

Thank you so much for your engagement. I will try this solution and let you know how it works at my forum. If I catch the time I will try this this evening and if not today, than I will be diligent next year.  Very Happy 

Have a nice evening today. I wish you all the best in the next year.  santa
HrvojeP
HrvojeP
Forumember

Male Posts : 161
Reputation : 2
Language : Croatian, English
Location : Croatia

http://drvenibrodovi.forumcroatian.com/

Back to top Go down

Solved Re: More instances ->> Widget: Recent topics of a specific sub-forum

Post by Ange Tuteur December 31st 2013, 11:21 am

You're welcome, if you encounter any problems do not hesitate.

Have a good new year I love you
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: More instances ->> Widget: Recent topics of a specific sub-forum

Post by TheCrow December 31st 2013, 11:57 am

Το me its not working. Why?
Ok Working! My mistake! Very Happy

Edit: How can i change the position of the boxes?
More instances ->> Widget: Recent topics of a specific sub-forum Hpxk
TheCrow
TheCrow
Manager
Manager

Male Posts : 6897
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: More instances ->> Widget: Recent topics of a specific sub-forum

Post by HrvojeP December 31st 2013, 2:19 pm

Marios94 wrote:...
Edit: How can i change the position of the boxes?
More instances ->> Widget: Recent topics of a specific sub-forum Hpxk
Change the position (order) of lines in widget definition and keep the same order in the javascript.


Last edited by HrvojeP on December 31st 2013, 2:22 pm; edited 1 time in total
HrvojeP
HrvojeP
Forumember

Male Posts : 161
Reputation : 2
Language : Croatian, English
Location : Croatia

http://drvenibrodovi.forumcroatian.com/

Back to top Go down

Solved Re: More instances ->> Widget: Recent topics of a specific sub-forum

Post by TheCrow December 31st 2013, 2:22 pm

haha i said it wrong! Sorry. I meant that i wanted to move the boxes to the left so its not viewed like this. not change the boxes.. hehe just move them all a bit to the left.  Smile Very Happy 

Thanks anyway for your help! Wink
TheCrow
TheCrow
Manager
Manager

Male Posts : 6897
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: More instances ->> Widget: Recent topics of a specific sub-forum

Post by HrvojeP December 31st 2013, 2:30 pm

It is OK Marios!  Smile 
I visited your forum, it looks fine. How did you make statistics with the national flags?
HrvojeP
HrvojeP
Forumember

Male Posts : 161
Reputation : 2
Language : Croatian, English
Location : Croatia

http://drvenibrodovi.forumcroatian.com/

Back to top Go down

Solved Re: More instances ->> Widget: Recent topics of a specific sub-forum

Post by TheCrow December 31st 2013, 2:46 pm

add this in widgets.
Code:
<center>
   <center>
      <script src="http://widget.supercounters.com/flag.js" type="text/javascript"></script><script type="text/javascript">sc_flag(712091,"fafafa","000000","cccccc",1,10,0,0)</script><br />
   </center>
</center>
TheCrow
TheCrow
Manager
Manager

Male Posts : 6897
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: More instances ->> Widget: Recent topics of a specific sub-forum

Post by Ange Tuteur December 31st 2013, 9:22 pm

Hello ,

Please open a new topic for your questions / new questions.

Is this solved ?
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: More instances ->> Widget: Recent topics of a specific sub-forum

Post by HrvojeP December 31st 2013, 9:33 pm

I am sorry for mixing the problems. It will not happen again.
Yes, thank you, everything is solved.

Regards,
Hrvoje
HrvojeP
HrvojeP
Forumember

Male Posts : 161
Reputation : 2
Language : Croatian, English
Location : Croatia

http://drvenibrodovi.forumcroatian.com/

Back to top Go down

Solved Re: More instances ->> Widget: Recent topics of a specific sub-forum

Post by Ange Tuteur December 31st 2013, 9:42 pm

Okay thank you, you're welcome. Smile

Topic solved and archived
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum