Blocks in the middle box

block in middle box

When you want to put a block in the middle box (i.e. the central area of the screen, not in the left box, not in the right box), you need to use the console. That's because Noosfero won't allow to put blocks in the middle via the user interface.

Method 1 — Moveing to the center box

First you add the block normally in one of the two sides (left or right), then you use the console to move the block. First, get the id of the block by inspecting the block in the generated HTML page. Look for something like:

<div id="block-1237" class="block article-block" ... >

You can grasp the type of block by the CSS class it has, and the id by looking at the id attribute. Then you go to the console:

>> block = Block.find(1237)
=> [...]
>> = block.owner.boxes.first # This is valid for any profile or environment front page
=> [...]
=> true

block.owner.boxes.first is the middle box of the block's owner, and you are attaching that block to that box instead of its current box.

Method 2 — Direct creation on the center box

>> block =
=> [...]
>> = Environment.default.boxes.first # This will to attach the block to the front page of the default environment
=> [...]
=> true

Moving it up

To put the block on the top, you only need to change its position:

>> block.position = 1


Aurium, Alan and I rethough the concept of homepage for noosfero. The idea is to bring inline editing (with a toggle edit/view so the user can see the end result) to the homepage and remove ambiguity of two homepage (the default profile or a choosen content). So more things will be implemented as a block.

Probably a InitialBlock? block would replace the MainBlock? on the homepage.

Some code would need to be ported to a block: Scrapbook (network and info) and the content.

Blocks would be resizeable and may ocupy full mainblock size, covering the case of a content as a homepage.

More discuss about yet to be done.

-- BraulioBhavamitraBO - 03 Dec 2011

Add comment
You need to login to be able to comment.
Topic revision: r5 - 24 May 2012 - 16:19:30 - AurelioAHeckert

irc Talk with Devs Now!

Translations: English
Search on Docs:
ActionItem Search:

Copyright © 2007-2015 by the Noosfero contributors
Colivre - Cooperativa de Tecnologias Livres