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.


Block width

Login / Search

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

Fan in action

Hi,

I have been scratching my head over this :( Since I am designing multizone for subcommunity… I want to give different theme and layouts.

So here's where I'm stuck.

I want to have a calendar take up 50% of the main area. Also show upcomming 5 events as a list. Calendar and Event list either in vertical order or horizontal (next to each other 50%-50%). So the problem is if I change the width {$PANEL_WIDTH} to 50% in template of side calendar, the change is affected globally for that theme which should not happen. I might use the same theme but provide the calendar on the side for some other zone.

Example : An option would be to add width as in the code below. And If I dont provide width attribute it should take up the default 13.3em.

Code

[semihtml]
<div>
<div style="float:left; width:50%;">
[block param="listing" zone="ProjectA" days="30" width="95%"]side_calendar[/block]
[block param="month" zone="ProjectA" days="30" width="95%"]side_calendar[/block]
</div>
<div style="float:right; width:50%">
[block zone="ProjectA"]main_poll[/block]
</div>
</div>
[/semihtml]
Back to the top
 
Posted
Rating:
#54415
Avatar

Hi,

You're approaching this from the wrong angle. You need to be doing template editing really. The concept of changing the panel width for something outside a panel is meaningless really; in fact typically blocks outside a panel don't have widths at all (I don't like that panel blocks do, but it was done as IE6 is so buggy).  The BLOCK_SIDE_CALENDAR template for example will define the width and the box type used. In 4.1 that is coded in as a panel box and uses the PANEL_WIDTH. In 4.2 block's actually adapt to where they are placed automatically, so it's not an issue in 4.2.
I appreciate you may want side_calendar to be used sometimes on a panel and sometimes in the main area; you can do this kind of thing using lots of Tempcode in the templates (that's what we did in 4.2 really), but you may simply want to move to 4.2 when 4.2-final is out.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#54422
Avatar

Fan in action

"In 4.2 block's actually adapt to where they are placed automatically, so it's not an issue in 4.2."

This is how I expect it to work. Editing template is not a solution to me as the calendar would be in side panel or in main area, and the "panel box" comes with it. In this case I should have made a new template to be precise a generic one as you mentioned and boxed it later.

But I dont know how to use the new template once I create it in the admin screen. Still learning and don't have much time.. hence cant move to v4.2


Back to the top
 
Posted
Rating:
#54426
Avatar

Actually you're alluding to a nice solution I did not think of. Just edit the BLOCK_SIDE_CALENDAR template to remove the box (that's the last line and the first line). Then in your Comcode you can put a box back in by surrounding your block Comcode with a 'box' Comcode tag. That allows you to specify exactly what kind/setup of box to use.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#54434
Avatar

Fan in action

Thanks Chris, I got the solution. Making components generic allows me to have more flexibility in my design.

I hope the "add block" feature (popup) supports an option to add a block with or without a box.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: