Page 1 of 1

Add php to global content block?

Posted: Wed Jan 02, 2008 10:02 pm
by cyberpaws
Hello,

I was hoping to use the Image Block from Gallery2 in my sidebar.  I have this code:

Code: Select all


<?php @readfile('http://mywebsitehere.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title'); ?>


 
and was hoping to pop it into a Global Content Block and just drop it in my template, but that doesn't seem to be working. 

I searched the forums pretty completely but am unable to find an answer.  I'd appreciate any guidance.

I'm running CMS Made Simple 1.2.2 "Holetown"

thank you!

Re: Add php to global content block?

Posted: Wed Jan 02, 2008 10:22 pm
by Dr.CSS
I believe GCBs don't need <?php in them...


EDIT: whoooops...

Re: Add php to global content block?

Posted: Wed Jan 02, 2008 10:28 pm
by calguy1000
GCB's are for html code,  use UDT's for php code.  You can call a udt from a gcb I believe.

Re: Add php to global content block?

Posted: Wed Jan 02, 2008 11:06 pm
by 10010110
Yes, create a user defined tag and drop the PHP in there (without ), and then you can put that tag wherever you want: In regular content (page), into templates, into global content blocks… whatever you want.

Re: Add php to global content block?

Posted: Thu Jan 03, 2008 12:58 am
by cyberpaws
Thank you! 

Now I get to go create my very first UDT.. hopefully I'll figure it out!