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.


How to add a block directly to a template?

Login / Search

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

Community saint

I've been searching a while and not comming up with an answer. I want to add the side_stats block to the footer section of global_html_wrap.tpl is there a way to do this?

Can I mix in comcode into templates?
Back to the top
 
Posted
Rating:
#96855
Avatar

Community saint

NVM finally remembered I had seen it before

Code

{$COMCODE,[block]side_stats[/block]}
Back to the top
 
Posted
Rating:
#96856
Avatar

Community saint

But is there a way to put it there without the surrounding BOX templates? I just want the stats no extra templates.
Back to the top
 
Posted
Rating:
#96857
Avatar

Community saint

Never tried that trick, Duck, as I've always built a fixed width and I can't see how I could 'squeeze' that into a 980px overall width.

However, I just took a look at both templates you've referenced, and I suspect you could shoehorn it into your footer in GLOBAL_HTML_WRAP.tpl after line 151, finding the best fit for your build.

You might have to strip out the <section class="box box___block_side_stats"> … </section> bit in BLOCK_SIDE_STATS.tpl first.

This is off-the-cuff as I haven't actually tried it …

 :thumbs:

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#96858
Avatar

Also…

{$BLOCK,block=side_stats} is the best way to embed a block.

{$BLOCK,block=side_stats,foo=bar,bar=foo} is equivalent to [block foo="bar" bar="foo"]side_stats[/block]


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

Community saint

Ahh you know I was looking in the wrong tpl Fletch thanks!

And Chris thanks also that does make better sense.
Back to the top
 
Posted
Rating:
#96860
Avatar

Community saint

So I gave up trying to make the stats look good in the footer. I do have a 1200 wide theme and thoguht it wouldn't be an issue but I was unhappy with the results. But I am putting the forum bottom bar there now.
Back to the top
 
Posted
Rating:
#96861
Avatar

Community saint

Duck said

So I gave up trying … I was unhappy with the results … I am putting the forum bottom bar there now.

ROTFLMAO!

There's no stopping you …!!

 :lol:

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: