1
freetek
Submenuing in Custom Block based on Article ID
  • 2004/2/27 0:07

  • freetek

  • Just popping in

  • Posts: 16

  • Since: 2004/2/26


Sorry if this is documented somewhere but I couldn't find it anywhere when I searched "submenu."

Here's is an example of what I would like to do:
Articles:
- About Us (id.1)
- Contact (id.2)
- Mission (id.3)

In a Custom Block I would have a hard link to Article id.1 (About Us) as well a few other bulleted main items. Only when About Us is in focus, (being read, not sure the term) do the two sub bullets Articles id.2 and 3 show up underneath it. So can logic be placed into a Custom Block to display only when certain Articles are being read? Is this a template level hack?

AND

If I understand correctly, currently the blocks can be set to specifically show when certain modules are in use. BUT can blocks be further customized to display only when reading certain articles?

Thanks. Looking forward to adding useful documentation to the Wiki once I understand this stuff more.

2
DobePhat
Re: Submenuing in Custom Block based on Article ID
  • 2004/2/27 0:15

  • DobePhat

  • Friend of XOOPS

  • Posts: 656

  • Since: 2003/4/15


That specific example you presented sounds like wf-channel module to me,

"submenuing" is perhaps not the best search term....

Tiny Content:
Wf: Channel
Wf Sections
Cjay Content, Free Content
Etc etc etc all give you this kind of capability....

3
freetek
Re: Submenuing in Custom Block based on Article ID
  • 2004/2/27 2:02

  • freetek

  • Just popping in

  • Posts: 16

  • Since: 2004/2/26


Thanks a lot DobePhat. Nice community support here. Didn't see a WF-Channel module. Same as WF-FAQ?

And here I thought I'd have to get my hands dirty and make a module of my own. :)

Other threads I came across:
iMenu & MultiMenu
https://xoops.org/modules/newbb/viewtopic.php?topic_id=17052&forum=20#forumpost71945
Cjay
https://xoops.org/search.php?query=Cjay&action=results

4
hsalazar
Re: Submenuing in Custom Block based on Article ID
  • 2004/2/27 2:55

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


freetek:

To add submenus, you might explore the logic behind the main menu. You can read this logic in the file modules/system/blocks/system_blocks.php, lines 106-135. You'll see there that it's actually not that easy, because the logic is tied to the definition of a module (that's why in the xoops_version.php file you have a specific syntax to define the module's menu and submenus. But you can certainly try, exploring also the logic behind a recent post by chapi about highlighting menu options.

As to the showing of blocks tied to the showing of specific articles, I think that you can't do precisely that, because of the fact that blocks are linked in the database to one specific module, and the rules of display are tied to user groups, not to content items.

What you can do, however, is set some logic inside those articles so you show whatever you want inside the article. Check my module Soapbox (I just uploaded a fix, there's a recent post about it) and look in the article.php file. There I include the logic to show a list of articles pertinent to the article you're reading (the list excludes the actual article).

Of course, I might be mistaken. If anyone has an idea of how to accomplish the things mentioned here, I'd be happy to learn I'm mistaken. Wouldn't be the first nor the last time.

Cheers.

5
freetek
Re: Submenuing in Custom Block based on Article ID
  • 2004/2/27 19:14

  • freetek

  • Just popping in

  • Posts: 16

  • Since: 2004/2/26


Quote:

hsalazar wrote:
To add submenus, you might explore the logic behind the main menu. ... You'll see there that it's actually not that easy


Didn't mean to suggest this stuff is easy at all. In fact I have a long way to go to working in OOP. Really glad there seems to be a lot of independent module development. How old is XOOPS now? Unfortunantly none that I have found really does exacly what I want it to.

Getting the hang of XOOPS a little more as I poke around code. Here's a slightly revised question and not sure if there is something out there already or if I need to hack the Sections module or if it would be better to make a new module.

Let's pretend inside Sections I have:
Section A
- Article A1
- Article A2
Section B
- Article B1
- Article B2
Section C
- Article B1
- Article B2

I think it would be pretty cool to have a separate Block display some form of how the Sections are structured, where as default there might be a block with Section Names hyperlinked to a specified Article. If you click on the Section A link then it will expand a list below it displaying Articles A1 and A2. Ideally I'd also like to be able to set the items in the menu as visable or not which only means whether or not it will display in this block. So if I wanted I could have it show:
Section A
Section C
and omit Section B (as well as having the same level of control for the articles beneath each Section).

What this also means is being able to tag an Article to each section so when you click on a Section Name it pulls up a default page with content (or does nothing if no Article is associated).

Does this make sense or am I thinking about XOOPS all wrong?
Thanks.

PS - I am a native English speaker and I would love to help the XOOP movement but at the moment you guys are all way above me programming-wise. However, I can offer writing and editting skills which I think XOOPS needs a lot of seeing as how documentation is pretty lacking. Who do I talk to about this?

Login

Who's Online

176 user(s) are online (97 user(s) are browsing Support Forums)


Members: 0


Guests: 176


more...

Donat-O-Meter

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

Latest GitHub Commits