How to generate code for single record section?

5 posts by 2 authors in: Forums > CMS Builder
Last Post: October 13, 2012   (RSS)

Hi.

I'm having problems finding the way to generate the code necessarry for a single record section.

If I'm not wrong, this was earlier to find in earlier versions of CMS Builder. I'm currently using version 2.17, and I have problems finding it?

Thanks in advance :)

- Ridder7NO

Re: [greg] How to generate code for single record section?

By Ridder7NO - October 12, 2012 - edited: October 12, 2012

Thank you so much for trying to help, greg, but what I meant was:

On my websites frontpage, I have things that repeat (multi), such as a News list etc. That's working perfectly.

But...

Also, I have content that I would like to be shown on each page, but it should not repeat (like news lists etc), like a general footer text, that should be the same on every page, but that I could change in CMS.

I'm talking about a single editor for a single place on the page, without needing ID in the URL.

The detail code wouldn't let me do that, as it required a specific ID in the URL to let the data to be shown.

Hope you understand.

Thank you in advance.

- Ridder7NO

Re: [Ridder7NO] How to generate code for single record section?

So you want to load the same content from the same single record section every time you load the page?

I think the getRecord function I put in the post above will allow you to do this. As it has allowSearch set to false and a limit of 1, it will always return the only record that is stored in that single record section. I'll give you an example of how to use it.

So lets say you have a single record section and one of the fields is footer. If you add the code I posted above to top of your page after you've called the viewer_functions.php file. Then in the place you want to display your footer text you would have something like:

<footer>
<?php echo $tableNameRecord['footer']; ?>
</footer>


Thanks!
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] How to generate code for single record section?

Thank you so much! :D

This is great! Thanks for helping me :)