1
nuance9
How can you directly insert a block?
  • 2004/9/13 18:12

  • nuance9

  • Just popping in

  • Posts: 19

  • Since: 2004/8/13


By default the only way to display a block is through the admin interface. That is nice and simple, but highly limits what you can do.

How can I directly call a specific block to display in the PHP code? It has got to be possible.


2
nuance9
Re: How can you directly insert a block?
  • 2004/9/13 18:38

  • nuance9

  • Just popping in

  • Posts: 19

  • Since: 2004/8/13


Hmmm.

Well I don't know how to specifically insert a block yet. But this is what I did as a temporary hack. I am not using the center-right or center-left block areas at all.

So I did the following to sort of accomplish what I want. I assign a block I want to custom insert to the center-right alignment. I then copy the following out of the theme.html file:

<{foreach item=block from=$xoops_crblocks}>
    <{include 
file="<YOUR THEME NAME>/theme_blockcenter_r.html"}>
<{/foreach}>

I can now place that code ANYWHERE (as far as I know) in the site.

In the main theme I erase the above code, because I don't want that block showing up as part of the entire site theme - just where ever I assign that code now.

3
DonXoop
Re: How can you directly insert a block?

That is rather clever! Since I am using all the positions for at least one block I had been hoping for a new "floating" position option so I can acomplish arbitrary placement.

This topic has been discussed sometime in the past if I remember. There are issues trying to satisfy all the needs but even one extra unused position could be a work around.

It would be an advanced option but it sounds hackable. Your idea is doable now and could work on sites with an unused position.