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.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 21:43:55
Script start
Timing: Jan 30 2025 21:43:55
Module start 'layout'
Timing: Jan 30 2025 21:43:55
Module start 'content'
Timing: Jan 30 2025 21:43:55
Module end 'content'
Timing: Jan 30 2025 21:43:55
Script end

Main resources:

Total runtime0.0246 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 588.1250151.2109
Module start 'layout' 0.00670.0039 739.3359220.6875
Module start 'content' 0.01060.0121 960.02341,001.6641
Module end 'content' 0.02270.0018 1,961.687533.9922
Script end 0.0245  1,995.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002911.9879140.0002
Check MTime0.00124.7752140.0001
Mysql Total
Database connection0.00093.685910.0009
Mysqli_queries0.00259.983930.0008
Looping result0.00000.052410.0000
Template Total0.00124.910.0012
Template load0.00103.880810.0010
Template processing0.00020.964110.0002
Override
Cache load0.00072.827510.0007
General
dbfile0.00124.992480.0002
String conversion0.00000.035940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs