1
rsalomone
Right Block Content based on the Middle Content
  • 2007/6/4 0:15

  • rsalomone

  • Just popping in

  • Posts: 21

  • Since: 2005/6/21


I would like to optionally place content on the right side based on content from a file in the middle.

Therefore, I would like to place a block (custom block) on the right as follows:

abc.php in the middle ----> Custom Block A on the right
def.php in the middle ----> Custom Block B on the right

etc...

Is that possible?
RS

2
BroHam
Re: Right Block Content based on the Middle Content
  • 2007/6/4 7:09

  • BroHam

  • Just popping in

  • Posts: 100

  • Since: 2007/3/31


Yes, that is possible. See my reply to you HERE.
By making "abc.php" an actual module, you can then decide what blocks are displayed and what groups have permission to see the content and the blocks, just like the other modules you have installed on your site.

So, lets say you wrapped abc.php using something like Pagewrap (again, see my other post about Pagewrap). Lets say you name it "abc." Then, you can see it on your site at a url likehttp://www.yourXoopsSite.com/modules/abc
So you see now how you can obviously display whatever blocks you want with the "module" you create.

Your php or html can be wrapped into the content area of your site and displayed nicely like all of the other XOOPS content.
I don't know.

3
rsalomone
Re: Right Block Content based on the Middle Content
  • 2007/6/4 7:43

  • rsalomone

  • Just popping in

  • Posts: 21

  • Since: 2005/6/21


What if I created content using "TinyContent" (and it is not an external file). Now the content is as follows:

1. Topic: Auto
2. Topic: Zoo

If the user selects (using IMenu or multiMenu) item 1, I wish for the first topic to show in the center block (which it does). But I also want to add some content about "Auto" in the right block. That is, a related block. If the user selects the second topic, it should show the zoo in the center block and related topics on the right.

I need for it to be variable based on the selected content. I hope I don't have to clone tiny content for every topic?

Could we not hack the tinycontent code to display a Topic named "Right Auto" and "Right Zoo" respectively from its own internal list of items?


Regards,
RS

4
nachenko
Re: Right Block Content based on the Middle Content
  • 2007/6/4 8:27

  • nachenko

  • Quite a regular

  • Posts: 356

  • Since: 2005/1/18


Look for right block theme file and put a Smarty condition. This theme file executes for every block, so you have to make a condition that works fine in every "step" of the loop:


If:

this is not the block we want to show sometimes
$block.id != number

or

this is the time we want to show this special block
$whatever smarty variable only exists for this module == whatever value is the right one for this item at this moment.


A real example here:

http://www.marruecosdigital.net/xoops/modules/wfsection/

http://www.marruecosdigital.net/xoops/modules/wfsection/viewarticles.php?category=27

When we go into some categories in "WF-Sections" module, we are in Espacio Empresa ("Business area") and theme and blocks are different.

5
rsalomone
Re: Right Block Content based on the Middle Content
  • 2007/6/4 12:29

  • rsalomone

  • Just popping in

  • Posts: 21

  • Since: 2005/6/21


From multiMenu I use the following syntax:

Topic: Cars
Link : /modules/tinycontent/index.php?id=1 (item 1)

Topic: Zoo
Link : /modules/tinycontent/index.php?id=7 (item 2)


if I go into my template right block html file and modify it, how can i reference the middle block?

That is, Cars was clicked on the left block (multiMenu item). It was displayed in the middle block with Id=1. I wish to put some content in the right block that relates to id=1 (Cars). That could be another block or tiny content.

Similarly, if Zoo was clicked on the left block (multiMenu item), I would like to place right block content that relates to Zoo. For example, a picture of an animal in a tinycontent or block.

I am not sure what to change.

Regards
RS

6
rsalomone
Re: Right Block Content based on the Middle Content
  • 2007/6/4 12:42

  • rsalomone

  • Just popping in

  • Posts: 21

  • Since: 2005/6/21


I try to display the $block.id and it is blank in the right template.

7
skenow
Re: Right Block Content based on the Middle Content
  • 2007/6/4 13:03

  • skenow

  • Home away from home

  • Posts: 993

  • Since: 2004/11/17


Try wiwimod - every page can have a related page (side content) and there is a side content block.

Login

Who's Online

239 user(s) are online (158 user(s) are browsing Support Forums)


Members: 0


Guests: 239


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits