Reply New Topic
19/9/2023 3:11:58
#1
Offline
Webmaster

Blocks that are URL aware

Hi,

I want to add a image block to every page on a new site, along the likes of https://www.oudervereniging.be/. I would need the same layout for content, event and blog pages

  • with different images for each page
  • without tens of duplicated blocks
  • Without needing to update the individual modules

My idea would be to re-write the existing billboard plugin and make the block page-aware. Is there a way to retrieve information in a block concerning the module and the page the block is shown?

In that case I would handle the images ona page-by-page basis.


_________________

Me on Ohloh


19/9/2023 19:23:40
#2
Offline
Home away from home

Re: Blocks that are URL aware

What you describe is something SimplyWiki does using 'SideContent'.

The concept is to create content related to the main content and assign it as the SideContent for the main page. Then, enable the SideContent block and place it where you will. Based on the page being viewed, the SideContent block displays the content of the page specified as SideContent for the page.

You can see this in effect at www.design-n-bloom.com - visit most of the pages in the menu bar and the block labeled "More Information" is the side content block. 'Send Fresh Flowers' and 'Plan Your Wedding' are the 2 main examples.


_________________
Christian Web Resources
Facebook

19/9/2023 19:32:14
#3
Offline
Home away from home

Re: Blocks that are URL aware

Just brainstorming other alternatives - use a custom block with type PHP. It might be a bit of a chore to figure out all the parameters for each module, but it could be done. Use icms::$module to determine which module it is, then specific branches to process the individual pages of that module. How you would assign content to the block based on the module + page and easily be able to change it... challenging. Custom tags could be used, too.

All in all, I'd default to SimplyWiki for everything.


_________________
Christian Web Resources
Facebook

19/9/2023 19:37:10
#4
Offline
Home away from home

Re: Blocks that are URL aware

Still more - SymLinks allows you to define 'visible in' pages for any URL. For your situation, though, you'd still need a block for every page. You're going to have to deal with this for almost any option to have different content based on the URL. Once built, it should be fairly easy to maintain. Sign in, go to the page, click on Edit for the block, edit and save.


_________________
Christian Web Resources
Facebook

Reply New Topic extras
 Previous Topic   Next Topic
You can view topic.
You can start a new topic.
You can reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You can post without approval.