Content Block inside Javascript

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
new2thiscms
Forum Members
Forum Members
Posts: 47
Joined: Thu Nov 09, 2006 7:33 pm

Content Block inside Javascript

Post by new2thiscms »

Hey Everyone,

I am not sure if this is possible and haven't found any posts yet.

I am trying to put a content block inside a piece of Javascript. It will add the content block to the cms but will publish the code with the content block code in it. Here is an example of what I am trying to do

{literal}
function openmipage(){ //Define arbitrary function to run desired DHTML Window widget codes
ajaxwin=dhtmlwindow.open("ajaxbox", "iframe", "http://www.sitenamehere.com/index.php?p ... d={content block='Slideshow Name' oneline='true'}", "Gallery One", "width=750px,height=500px,left=200px,top=100px,resize=1,scrolling=1")
ajaxwin.onclose=function(){return window.confirm("Close Gallery?")} //Run custom code when window is about to be closed
}
{/literal}

that works with this code to use the dhtml window widget to bring up slideshow pro in a new window

{content block='Slideshow Image' oneline='true' assign='slideshowimage'}
{if $slideshowimage != '' }
 
{/if}

I would like to be able to allow them to set the id

Does anyone know if this is possible?

Thanks
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Content Block inside Javascript

Post by calguy1000 »

{literal}
// whack of javascript code
{/literal}
{content block='whatever'}
{literal}
// the rest of the javascript code
{/literal}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
new2thiscms
Forum Members
Forum Members
Posts: 47
Joined: Thu Nov 09, 2006 7:33 pm

Re: Content Block inside Javascript

Post by new2thiscms »

yup works perfectly thanks
Post Reply

Return to “CMSMS Core”