Forums / Setup & design / creating content boxes

creating content boxes

Author Message

Brian LaFleur

Monday 06 March 2006 8:21:31 am

I am wondering how to create content boxes that appear on certain pages.

Something similar is at this fine site: http://www.visionwt.com/hosting/developer_hosting
Specifically the box located on the right hand side "Related information"

part one of the question is how to create them, part two is how do I assign them to specific pages?

Thanks in advance,
Brian LaFleur

Roy Bøhmer

Monday 06 March 2006 11:53:26 am

Hi Brian,

I'm not that familiar with the default ez setup, so it might be an easy way to do it there.
Maybe the factbox-tag in an xml-field can do the trick? (See comment under http://ez.no/doc/ez_publish/technical_manual/3_6/reference/xml_tags)

My approach has been to make a custom content class, containgin varous attributes depending on my needs:
- Title (textline)
- Text (xml)
- Show on all children/grandchildren etc. as well (checkbox)
- etc.

This can aslo be made by customizing an existing content class.

To make the box I create a Box-object/node under the page I want it to appear on, containing the box content.
In pagelayout.tpl I create the appropriate template code to fetch Box-nodes and display them, depending on witch page (node_id) is being shown. (Yes, I know. This is the hard part if your unfamiliar with the template language)

Has someone else an other approach? I would be glad to know, because my way has too many fetches/databasecalls to be optimal.

Roy

Brian LaFleur

Thursday 16 March 2006 9:35:52 am

I am thinking more inline of creating a new toolbar for content folders. Maybe folders for services, products, etc. then create a toolbar called toolbar_services, toolbar_products, toolbar_etc. Then you could create a template overide for each folder that includes the correct toolbar_name. Does this make sense? That way you can independently add items to toolbars that only show up for that specific folder. Does anyone know if this is possible? or even the right approach?

Roy Bøhmer

Thursday 16 March 2006 11:47:43 pm

Do you mean to make an override for each folder-node? I think it be cumbersome to make a new template-file and override for each folder? And if you want to change the appearence of folders in general you'd have to edit several templatefiles. Or do I misunderstand your point?

I agree that it would be best to put the funcionality in a toolbar of some kind. But I think that the creation and control of the boxes should be handeled 100% from within the admin-view. Then its easier to set rights and teach non-techs to use it.

My approach let you make a box just by creating a box object under the folder you want it to appear on. That way you can easily make more boxes, delete boxes, or change content in the same way you'd publish "regular" content. You can additionally make the same box appear on several folders, just by adding locations (standard ez-functionality).

Does it make sense, or am I answering a quesion you didn't ask :-)

Roy

Brian LaFleur

Tuesday 21 March 2006 8:55:59 am

I do like your Idea. It will give it a shot and see if does what I am hoping. basically in terms of page layout, I want to have a main content area with a smaller side content area to the right. This smaller content area will hold content that relates to the larger content area.

example: if the main content area shows an article about networks, then to the right I can show related PDF's about networks. obviously if I go to another article about math, then I dont want PDF's showing for networks.

Thanks for your help.