collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 423
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

Author Topic: Quick Question About Blocks  (Read 5334 times)

0 Members and 1 Guest are viewing this topic.

Offline JulieVA

  • Newbie
  • Posts: 4
  • SMF Version: 2.0.6
  • SP Version: 2.3.5
Quick Question About Blocks
« on: December 22, 2013, 06:48:34 PM »
Is there anything that I can do in the Custom Display Options or the Style Options (shown below) to cause blocks to be displayed in the closed position by default so that a user would have to click the plus sign to open it if they wanted to read it?





The "What is a Discussion Forum" Block is open by default. I would like it to display as closed so the plus sign must be clicked to open it.



Preferred



SMF 2.0.6 | SMF © 2013, Simple Machines
SimplePortal 2.3.5 © 2008-2012, SimplePortal

Thanks for your help!

Offline hcfwesker

  • Semi Newbie
  • *
  • Posts: 43
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Quick Question About Blocks
« Reply #1 on: December 22, 2013, 08:28:50 PM »
[[ this is posted in the wrong section ]]

I might have something for you.  But this isn't something you can simply code in or make happen from the display Options box.  Are you ONLY wanting to do this for that one block?  "What is a Discussion Forum?"

If you can, please let me know what id the block is for that one.  Yo find the block id, goto Block List on your admin back, and hover the wrench icon in the same row as the clock name, and tell me what is says in the url for SITEURL ?action=admin;area=portalblocks;sa=edit;block_id=??   <--- the number after that is your block id

« Last Edit: December 22, 2013, 08:53:21 PM by hcfwesker »

Offline JulieVA

  • Newbie
  • Posts: 4
  • SMF Version: 2.0.6
  • SP Version: 2.3.5
Re: Quick Question About Blocks
« Reply #2 on: December 22, 2013, 09:00:35 PM »
It will be several blocks, but this one is Block ID 271 :)

I tried posting in the correct section; however, I had no "new topic" button available to me.

Offline hcfwesker

  • Semi Newbie
  • *
  • Posts: 43
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Quick Question About Blocks
« Reply #3 on: December 22, 2013, 09:25:01 PM »
I've found a way to do this, and can show you how to do it for more blocks you wish to add later in the future.  But requires edits to 2 php files.  I want to try and test it out for myself, then i'll supply them here.  gimme about an hour or so.

Offline hcfwesker

  • Semi Newbie
  • *
  • Posts: 43
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Quick Question About Blocks
« Reply #4 on: December 22, 2013, 11:23:29 PM »
File edits and instructions are listed below ....

Both files can be found under ..../Themes/default/


Profile.template.php

Find
Code: [Select]
</li>
</ul>
<dl>
<dd></dd>';
}

function template_notification()

Replace with
Code: [Select]
</li>';

       // Simple portal admin Options
if ($context['user']['is_admin'])
{
echo '
<li><br><b>Simple Portal Block Options</b><br>
<input type="hidden" name="default_options[sp_block_271]" value="0" />
<label for="sp_block_271"><input type="checkbox" name="default_options[sp_block_271]" id="sp_block_271" value="1"', !empty($context['member']['options']['sp_block_271']) ? ' checked="checked"' : '', ' class="input_check" /> Collapse Block 271 </label>
</li>';
}
          // End SP admin options

echo '
</ul>
<dl>
<dd></dd>';
}

function template_notification()


Settings.template.php

Find
Code: [Select]
array(
'id' => 'display_quick_mod',
'label' => $txt['display_quick_mod'],
'options' => array(
0 => $txt['display_quick_mod_none'],
1 => $txt['display_quick_mod_check'],
2 => $txt['display_quick_mod_image'],
),
'default' => true,
),

Add AFTER
Code: [Select]
array(
'id' => 'sp_block_271',
'label' => 'Shrink Block 271',
'default' => true,
),


Now, just goto Admin > Configuration > Themes & Layout > Member Options .....

Configure guest and new user options for this theme
Change current options for all members using this theme

You need to click both those links, and select "Change" for the option "Shrink Block 271", put a check mark in the box, then click save at the bottom. 

 
« Last Edit: December 22, 2013, 11:25:47 PM by hcfwesker »

Offline oNLy1

  • Jr. Member
  • **
  • Posts: 53
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Quick Question About Blocks
« Reply #5 on: December 23, 2013, 12:12:20 AM »
could use the spoiler tag mod and use BBCode block
(just thought I'd toss out another option)

Offline hcfwesker

  • Semi Newbie
  • *
  • Posts: 43
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Quick Question About Blocks
« Reply #6 on: December 23, 2013, 12:19:20 AM »
That is a good idea, actually.  But, if used, then the topic itself would also be in a spoiler tag on the forum and they may want to avoid that; unless you make a clone topic in a spoiler just to be shown on the the portal.

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: Quick Question About Blocks
« Reply #7 on: December 23, 2013, 12:26:47 AM »
Another option is as follows:

Create a custom PHP Header Block, set it to display everywhere and check mark no title + no body.
Put the following code in the PHP block:

Code: [Select]
// enter block id's to be collapsed by default
$collapseArray = array(12,16);

echo '
<script type="text/javascript">
window.onload = function() {';

foreach ($collapseArray as $collapse)
{
if (empty($_SESSION['spcollapse' . $collapse]))
{
echo '
sp_collapseBlock("', $collapse, '");';

$_SESSION['spcollapse' . $collapse] = true;
}
}

echo '
}
</script>';

.. edit the array at the top of the block to contain the block id's you wish to have collapsed by default (12 & 16 are just examples).

Regards.

Offline hcfwesker

  • Semi Newbie
  • *
  • Posts: 43
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Quick Question About Blocks
« Reply #8 on: December 23, 2013, 12:58:06 AM »
^ Like a Boss!

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Quick Question About Blocks
« Reply #9 on: April 30, 2014, 08:50:31 AM »
Since we have not heard back from JulieVA, I am going to mark this solved.
JulieVA, if this is not correct, please mark this "not solved" and continue asking.

Thanks!
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?