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.


Working with blocks

Login / Search

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

Community saint

I've finally reached the last task I need to complete to get one of my OCP sites locked and loaded. I have however, stumbled upon some issues with regards to blocks & boxes. Here is an example: I would like to display news in a main block style, but in the format of the side_news_block (bullet list of titles and publish date). No problem, simply use the side block on the main page and change the width in the template. Easier said than done. Unfortunately, OCP does not appear to have an easy way to add overriding CSS tags on a per block basis like *cough* Joomla has. (or it's there, I'm just not aware of it). My dilemma is that the standardbox* CSS tags are across the board, so changes I make to my side_news_block are reflected in my menu block and so on. So, my questions are:

  1. Is there an easy way to add a custom CSS ID and/or class so that I can affect the appearance of a side block without affecting my other side blocks?
  2. Where is the value of {$PANEL_WIDTH} derived from? (TPL file(s))

"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
 
Posted
Rating:
#48613
Avatar

Lots of answers for you…

a) 4.2 will auto select box type based on where you put it, so going forward, the problem is recognised and fixed at source
b) CSS is pretty powerful, you can do ".global_middle <anything>" to scope some CSS to only apply to stuff in the middle. You can also do ".global_side <anything>" or "#panel_left <anything>" or "#panel_right <anything>".
c) You can also edit the templates. Compare the 'BOX' line from SIDE_NEWS and MAIN_NEWS to see what I mean.
d) If you're doing something particularly advanced you can make the same block work very differently in different places (beyond what CSS can do), but that's getting into the realms of complex Tempcode programming.
e) PANEL_WIDTH is tied to the config option (in 'Theme options' under the Configuration icon).


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:
#48615
Avatar

Community saint

Here's a complete hack that I stumbled across to solve my issue for now:

1) Added a dramatic width (was just try to get a feel for the effect of doing this) to BLOCK_SIDE_NEWS.tpl:

Code

{+START,BOX,,800px{TITLE},{$PANEL_WIDTH},panel}

2) Refreshed my page and was presented with an error:
A required template was not found: STANDARDBOX_13.3em.tpl

3) Created the template from adminzone called STANDARDBOX_13.3em and cut and pasted the contents of STANDARDBOX_panel.tpl into it.

4) Added a custom prefix to every instance of standardbox_* in my newly created template.

5) Voila! Works like a charm.

"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
 
Posted
Rating:
#48616
Avatar

Community saint

*grin*, thanx Chris, you got your post in before mine.

Excellent, thanks for the starting points!!

"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
 
Posted
Rating:
#48617
Avatar

Sorry but all that is because you missed a comma ;).
But also I think your parameters are out of order.

You're actually making things hard for yourself :). The line just needs to be:

Code

{+START,BOX,{TITLE}}
or if you wanted a different box type (e.g. light):

Code

{+START,BOX,{TITLE},,light}
(I left the width blank, which makes it automatic, essentially full width).


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:
#48619
Avatar

Community saint

hahaha, damn comma's, bane of my existence! (second only to semi-colons) :) This is exactly why I never became a programmer *chuckle*.

Thanks again Chris, you've gotten me off the side rails and back on track.

"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
 
Posted
Rating:
#48623
Avatar

Honoured member

Hi:

Vis-a-vis working with blocks:  I was dinking around on a CEDI page, through the front-end as admin, experimenting with the idea broached elsewhere of putting my rateable items in the CEDI & adding a ratings block.  I put in blah-blah-blah in the CEDI entry (in a specific category), and then tried to create a block (ratings), using the block assistant WHILE doing the CEDI entry.  I used the default block parameters.  The block preview looked normal enough, but when I was finished, all I got was the code

Code

[block]main_rating[/block]

which appeared ABOVE the logo.  I banged around here and read the tutorial on blocks; but as it's not clear what actually is supposed to happen when you use the block assistant (I mean, does the block magically show up on the page, fait accompli? And if it does, how does it know where to go???? - or am I supposed to edit it, or, drag it somewhere, or…why'd I get the code instead of an errant block…?), I a) don't really know what to expect, as it was my first attempt at a block, and b) don't know enough to know if this is a bug or an operator-error.  If it's an operator-error, I'm happy to go back to banging around in my usual way, but if it's a bug… can somebody point me in the right direction?  I figure that SoccerDad is now the resident block expert….

Thanks,
Hitch

I always ask myself: WWWWD?, or, "What Would Wonder Woman Do?"
How come we have Yahoo IM, AIM, ICQ, you name it, but no field for Skype contact info?
Back to the top
 
Posted
Rating:
#48633
Avatar

Community saint

Heyya Hitch! Expert, no, hacker (read: mess maker), definately! lol

When using the block assistant, it *should* place the block close to where your cursor was situated in the editor window prior to launching the assistant. I would suggest turning off the WYSIWYG editor so you can see the full picture. Once the assistant has completed and you have your block code, you can then move it around in the editor as you see fit.

"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
 
Posted
Rating:
#48651
Avatar

Honoured member

SoccerDad said

Heyya Hitch! Expert, no, hacker (read: mess maker), definately! lol

When using the block assistant, it *should* place the block close to where your cursor was situated in the editor window prior to launching the assistant. I would suggest turning off the WYSIWYG editor so you can see the full picture. Once the assistant has completed and you have your block code, you can then move it around in the editor as you see fit.

Howdy, SoccerDad (how's that great theme of yours coming along?):

Hmmmm…well, I was trying to create an entry into a CEDI category, and "give it" a concomitant ratings block.  I will toodle back over to my subsite and see what I can wrangle..I'll let everyone know how that goes, as I am sure you're all waiting with bated breath.  :-)

Hitch


I always ask myself: WWWWD?, or, "What Would Wonder Woman Do?"
How come we have Yahoo IM, AIM, ICQ, you name it, but no field for Skype contact info?
Back to the top
 
Posted
Rating:
#48657
Avatar

Community saint

Please do keep us posted and I still owe you a tutorial on setting OCP as a classified site!!

"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
 
Posted
Rating:
#48663
Avatar

Community saint

Soccerdad I think you are better then me at making themes.
Keep up the good work.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#48664
Avatar

Community saint

Thanx for the kind words Ami, however, since I can't really create one from scratch (I'm artistically and graphically challenged! ;) ), all I can do is embrace and extend (read: hack!).

"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
 
Posted
Rating:
#48665
Avatar

Honoured member

SoccerDad said

Please do keep us posted and I still owe you a tutorial on setting OCP as a classified site!!

You certainly DO!!!  However, with regard to keeping you all posted, you're speaking with a woman who is banging her head against the screen currently trying to pass a php call through a CSS-styled HTML button that just IS NOT WORKING.  If a girl can't make a button, I mean, REALLY…..what hope is there I'll ever get those accursed blocks to work?  <sigh>.  Works when there IS no button…doesn't work when there IS a button.  button, button, who's got the button….(clearly, I am sinking into depravity).  

 :'(

Hitch


I always ask myself: WWWWD?, or, "What Would Wonder Woman Do?"
How come we have Yahoo IM, AIM, ICQ, you name it, but no field for Skype contact info?
Back to the top
 
Posted
Rating:
#48667
Avatar

Community saint

Hitch I didn't know you were a girl.
I can try and make you a button if you want, it will still be made by a girl then ;).

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#48668
Avatar

Honoured member

amichan said

Hitch I didn't know you were a girl.
I can try and make you a button if you want, it will still be made by a girl then ;).

LOL, Hi, Amichan:

Well…."girl" is probably a misnomer, I haven't been that young in quite a while, but indubitably female, yes.  Thanks for the offer for the button, but I am generally better off slogging through it myself, because then I remember how I did it.  If I get desperate, though, I may take you up on your offer, thank you kindly.

Hitch


I always ask myself: WWWWD?, or, "What Would Wonder Woman Do?"
How come we have Yahoo IM, AIM, ICQ, you name it, but no field for Skype contact info?
Back to the top
 
Posted
Rating:
#48744
Avatar

Honoured member

SoccerDad said

Please do keep us posted and I still owe you a tutorial on setting OCP as a classified site!!

Y'know, I'm hanged, the accursed thing worked when I went back to my test-site and decided to screencapture it for Chris.  Did I do anything different?  Nope.  Cannot explain it, the block appeared pretty much exactly where it was supposed to, instead of having the code appear at the top of the page like unrendered html.  <shrug>  So, that's my brilliant update, which translates into "Idunno."  Nonetheless, for the moment, it's working, so this is more-or-less "solved."  

Hitch


I always ask myself: WWWWD?, or, "What Would Wonder Woman Do?"
How come we have Yahoo IM, AIM, ICQ, you name it, but no field for Skype contact info?
Back to the top
 
Posted
Rating:
#48746
Avatar

Community saint

Maybe it was a caching issue.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: