HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Creating Info Boxes in Forums

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#48487 (In Topic #10600)
Avatar

Community saint

Remarking on my success doing so..

Greetings,

I am not certain if this is the right place to post things like this, so if not please remove the post. It is my hope that this post will not only showcase the immense power and flexibility you have with ocPortal, but also help others who wanted to do something similar.

Now you may or may not remember but a while ago when I first started coming here I asked a silly question on how to make info boxes appear on top the forum's thread listing. Well thanks to the help of Chris I learned how to do so but could never do one important thing, make the info boxes be able to collapse and expand. So I gave up on it for a while to focus on other things.

Well now I can report that I have been able to make the info boxes how I wanted to! They collapse and expand. Here's some screenies to show what I mean…

Collapsed


Expanded


And here is how I did it so others can benefit from this knowledge.

1.) I made the comcode page with the information needed.

2.) I used the code Chris supplied…

Code

{+START,IF,{$EQ,{ID},3}}
{$LOAD_PAGE,Capere,zone_name_here}
{+END}

Of course making sure that the page, zone name, and forum id were set to the right values.

3.) I added the following code around Chris's code to make a box around the info…

Code

{+START,BOX,,,med}
{+END}

So that the entire code looked like…

Code

{+START,BOX,,,med}
{+START,IF,{$EQ,{ID},13}}
{$LOAD_PAGE,ImperialSector,forum}
{+END}
{+END}

Now that was all added to OCF_FORUM.tpl which is a template, between BUTTONS and TOPIC_WRAPPER

Now that provided everything in a nice pretty box. But how to make it collapse and expand on the push of a button? Well for the longest time I kept experimenting with different xhtml codes in the template, but none worked.  I was getting frustrated all over again until something clicked. Why not use the comcode for hide and wrap the entire comcode page in it? So that is what I did…

Code

[hide="stuff"]the entire comcode page[/hide]

And that is that. It works like a charm!

Well I hope this info helps someone else and shows that there isn't anything you can't do with ocPortal!

Legends of Nor'Ova: A site powered by ocPortal; home of the Legends of Nor'Ova tabletop RPG wiki and community.

Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!

"Those who want help should first be willing to give help."
Back to the top
 
Posted
Rating:
#48491
Avatar

Community saint

Hi mythus! Thanx very kindly for sharing that information. Great job!

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: