Home | Products | Consulting | Hosting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Updating CMS Builder Code

 

 


Perchpole
User

Jun 25, 2008, 4:22 PM

Post #1 of 2 (146 views)
Shortcut
Updating CMS Builder Code Can't Post

Hi, Dave -

I'm now working on my 4th CMS builder site. Unfortunately, I'm so happy with the way the system is playing that I've gone back to my second site and started to convert it (to take advantage of the new features found in v1.17). I'm afraid this was easier said than done! By updating all of the templates I have inadvertently broken some of the PHP code snippets I had put to good effect. For example, when I wanted to print the name of the SQL table on my page you suggested I should use...


Code
 <?php   $schema = loadSchema($options['tableName']);   print $schema['menuName']; ?>



This no-longer works!

In fact, after much trial and error, it now seems impossible to print any $record outside of the boundaries of the <?php foreach...> code block.

If I have a field called "category", for example, I would expect to be able to print this record anywhere on my page by inserting...


Code
   

<?php echo $record['category'] ?>

or

<?php echo $tablenameRecord['category'] ?>

It doesn't seem to be that simple any more. The latest version of CMSB is much better than previous incarnations but also seems far stricter.

Any pointers?


Unsure

Perch


Dave
Staff / Moderator


Jun 25, 2008, 8:22 PM

Post #2 of 2 (135 views)
Shortcut
Re: [Perchpole] Updating CMS Builder Code [In reply to] Can't Post

Hi Perch,

You don't need to update the old code unless needed. We don't. :) That's why we leave support for the old code in there still. We'll remove support for it eventually, but probably not for a long long time.

That said, you can get it working again pretty quick too. Just replace $options['tableName'] with the name of your table like this: loadSchema('news');

And for the record name, usually you only have a foreach loop if there are multiple records. And you need it in that case because you wouldn't know which record to display otherwise. But for single record pages you should still be able to display the placeholder wherever you like. You might just need to switch the name back.

If you want to attach a file you're working with I can take a look and let you know exactly what to change. Once I help you with one it will probably make sense for the others as well.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Hosting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4