Advanced Users Code Generator

12 posts by 7 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 16, 2010   (RSS)

By Kenny - April 17, 2010

I think it might be useful to be able to turn off all the extra markup in the code generator. This way it will only display exactly what is necessary to display the data. Once you have generated thousands of pages, you don't even really need the code generator, but it is nice as a reference anyways and would make it a bit easier on the longer records to cut and paste quicker.

What you would wind up with is something like this:

<?php require_once "/home/website/public_html/cmsAdmin/lib/viewer_functions.php";

list($home_pageRecords, $home_pageMetaData) = getRecords(array(
'tableName' => 'home_page',
));

?>

<?php foreach ($home_pageRecords as $record): ?>

Record Number: <?php echo $record['num'] ?>
Title: <?php echo $record['title'] ?>
Content: <?php echo $record['content'] ?>
_link : <a href="<?php echo $record['_link'] ?>"><?php echo $record['_link'] ?></a>

<?php endforeach ?>


Kenny

Re: [sagentic] Advanced Users Code Generator

By Dave - April 17, 2010

Hi Kenny,

Sure, what would you like that option to be called? And should it be a hard coded options or one that you can set each time? (Meaning would you ever want the extra code back again?).

Let me know, thanks!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Advanced Users Code Generator

By Kenny - April 17, 2010

I think "Advanced Users Code Generator" might do the trick or something along those lines. I can see where being able to flip it on and off might be useful to some.

I don't know if it would be easier on you to make a plugin that could be activated and deactivated or placing a check in the box under general settings. I pretty sure it would not need to be "per section" as if you are advanced enough to do it for one you should be able to o it for all.

Thanks Dave!


Kenny

Re: [sagentic] Advanced Users Code Generator

By Toledoh - April 17, 2010

Great idea Kenny...
Cheers,

Tim (toledoh.com.au)

Re: [Dave] Advanced Users Code Generator

By aev - April 19, 2010

Agree, this would be nice!

-aev-

Re: [sagentic] Advanced Users Code Generator

By Dave - April 19, 2010

Ok, done. This will be in the next beta.

If you're already running a beta it might not get added automatically in which case you can add the setting manually to your settings.dat.php like this:

[advanced]
imageResizeQuality = 80
showExpandedMenu = 0
disableFlashUploader = 0
codeGeneratorExpertMode = 1
hideLanguageSettings = 0


Otherwise, just check this option under: Admin > General
Code Generator [_] Expert mode - don't show instructions or extra html in Code Generator output

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Advanced Users Code Generator

By sublmnl - April 28, 2010

I like that option as well.
Two more suggestions, remove the comment markup around the images and also remove any text before the <php> tags.
So it is just code - you should be able to see the field names and be good.

Re: [sublmnl] Advanced Users Code Generator

By Dave - April 28, 2010

Hi sublmnl,

Can you give an example of: "also remove any text before the <php> tags. "

Thanks!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Advanced Users Code Generator

By sublmnl - April 28, 2010 - edited: April 28, 2010

I don't need this (see bolded):


Record Number: <?php echo $record['num'] ?>
Title: <?php echo $record['title'] ?>
Content: <?php echo $record['content'] ?>
_link : <a href="<?php echo $record['_link'] ?>"><?php echo $record['_link'] ?></a>

I will give credit where its due however - the comment for the PHP time thing is helpful. So yeah having the ability to perhaps have a checkbox to turn on/off the coding options is nice.... sometimes I forget stuff too.