Calling External Javascript Menu

4 posts by 2 authors in: Forums > CMS Builder
Last Post: April 21, 2010   (RSS)

By dccreatives - April 20, 2010

I have an external javascript menu that I want to display on each page. Based on the item, the filename will change. I want to include this field on my itemDetail.php page to reflect this file.

So I will create a section field called menutree as a text field. How do I call it on the detail pages? What would be the shortcut?

Re: [dccreatives] Calling External Javascript Menu

By gkornbluth - April 20, 2010

Hi dccreatives,

I'm not totally sure that I understand what you're looking for, but would this work?

Assuming all of your scripts are in a directory called "scripts" and the "menutreee" field contained the file name without the .js ...

<?php if ($your_tableRecord['menutree']): ?>
<script type="text/javascript" src="http://www.yourdomain.com/scripts/<?php echo $your_tableRecord['menutree'] ?>.js">
<?php endif ?>


Give it a try and see how far you get.

Best,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [dccreatives] Calling External Javascript Menu

By gkornbluth - April 21, 2010

Nice to hear

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php