From: Justin F. <je...@ey...> - 2001-07-07 11:33:46
|
Alex: As you maknow, at the moment I am writing a bunch of small modules/sites to discover issues that I am not used to when using these "components" of BC, since when writing a "normal site" you know where things are, and where data is coming from. With BC, the idiom is different. I wish to discover these surprises and attempt to set conventions for our business to use. One small, but not unimportant, issue is the business of the <title> ultimately displayed for the "page" you are looking at. With the present platform, the source of the <title> is, of course, the template used out of the $bc_page['templates'] selection. The result of this machinery is that the reusability of the template is diminished, and you _must_ have a unique template for each page if you wish the title to be different, even though such a template may be simple and is able to be generalized and used over and over for a large percentage of, or all, pages. Now, I have a "workaround" that, upon reflection, seems that the facility _may_ be a candidate for inclusion in the platform. In the template that is going to be reused over and over I put this piece: <head> <title><?= $Title?></title> in order to get the <title> from global scope. Now, a generality issue comes up, namely, "Where should I put $Title in global scope?" It seems natural that the <title> is associated with the ripped $bc_page, or index.php, so I put $Title in global scope thus: -- fragment -- include_once('./prepend.php'); import('binarycloud.init.Init'); #import('user.mod.lib.EyeLibrary'); // ripped from /path/to/binarycloud/user/htdocs/index.xml $Title = "Passed in Title"; $bc_page = array( ----------------------------- There may be some more appropriate place to put the <title> in global scope, maybe via options to a module or something. Still, that would require presence of such a module just to get this correct title. I guess the upshot of all this is that I am asking you to consider a way to map a title name to a page outside of having to code it in a module, and my "way" implies that the *.xml original should have that anticipated, and be a part of the BC platform. I am not yet familiar with (still a-building) .xml "front end" to know if this can be accommodated. Now, you may be of the mindset that you don't mind having one unique template file per page. So far, in my twiddling, I find a need to have a "dynamic title" because I am experiencing now that I have applications with multiple pages and the same template, and just to get a different <title>, I have to create a different template. I want BC to eliminate this kind of waste... I don't think this is subjective, and suggest you think about it for a while for consideration of making it a standard feature. It seems to me that this is just an accommodation to a one-to-one thingy. Right now, if you use one template per site, about the only thing you can "do" is have "Foobar Site" in the template, which is giving up a lot of opportunity to provide information, as well as making bookmarks of all pages in the site read the same. I want "Foobar Site: Our Company History", "Foobar Site: Pictures of Secretaries at Wet Tee-shirt Contest" and so on, while using the same template. _jef -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 |