Problems, need help? Have a tip or advice? Post it here.
15 posts Page 2 of 2
That is the part that I am struggling with creating, the XML template.

My current XML file, which is now a .php file managed by couch is as follows...

Code: Select all
<?php require_once( '../backend/cms.php' ); ?>
<cms:content_type 'text/xml' /><cms:concat '<' '?xml version="1.0" encoding="' k_site_charset '"?' '>' />

<photos>
<cms:editable name='trailcam_xml' type='richtext'>
   <!-- Plase your photos here -->
   <photo desc="Double Click to open and close a larger image." url="_pics/pic01.jpg" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic02.JPG" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic03.JPG" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic04.jpg" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic05.jpg" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic06.jpg" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic07.jpg" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic08.jpg" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic09.jpg" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic10.jpg" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic11.jpg" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic12.jpg" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic13.jpg" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic14.jpg" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic15.jpg" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic16.jpg" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic17.jpg" />
   <photo desc="Double Click to open and close a larger image." url="_pics/pic18.jpg" />
</cms:editable>   
</photos>

<?php COUCH::invoke(); ?>


Here is the html front end code for this gallery.
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Trail Cam Photos</title>
<script type="text/javascript" src="_inc/swfobject.js"></script>
<link href="_inc/styles.css" rel="stylesheet" type="text/css" />
</head>

<body>
  <div id="fullscreendemo">
  <strong>This site requires Flash Player 8.0 or greater</strong><br />
  Please <a href="http://get.adobe.com/flashplayer/">click here</a> to download.<br />
  If you are sure you have the required version, press this link: <a href="../polaroid_20070716/readme.html?detectflash=false">bypass the detection</a>.
  </div>
<script type="text/javascript">
//<![CDATA[
var so = new SWFObject("polaroid.swf", "polaroid", "100%", "100%", "8", "#FFFFFF");
// specify the url to the xml-file, default is photos.xml
so.addVariable("xmlURL","trailcam.php");
so.write("fullscreendemo");
//]]>
</script>
</body>
</html>


Thanks for helping me with this so far KK. That speaks volumes to me from a consumer stand point. You are legendary.

I really want to get a good grasp on couch's applications because I have a lot of older HTML sites that need to be either updated, or converted, and this would help me deliver a bit more control to my clients, which they would all like.
Thanks :)

Please use this for your XML template (trailcam.php)
Code: Select all
<?php require_once( '../backend/cms.php' ); ?>
<cms:content_type 'text/xml' /><cms:concat '<' '?xml version="1.0" encoding="' k_site_charset '"?' '>' />

<cms:template>
    <cms:repeatable name='my_images' >
        <cms:editable type='image' name='my_image' label='Photo' show_preview='1' preview_width='150' input_width='200' col_width='300' />
        <cms:editable type='text' name='my_desc' label='Description'  />
    </cms:repeatable> 
</cms:template>

<photos>
    <!-- Plase your photos here -->
    <cms:show_repeatable 'my_images' >
        <photo desc="<cms:show my_desc />" url="<cms:show my_image />" />
    </cms:show_repeatable>
</photos>

<?php COUCH::invoke(); ?>

First visit the template as super-admin. Coming to the admin-panel, you'll see a repeatable region with two fields - image and text.
Add a few images and save.
Your Polaroid Flash gallery should now show the images you uploaded.

Hope it helps.
You are a legend!!

Thanks so much, also really helps me to see the code to understand what is going on. I can already tell part of my issue was tag familiarity.

I will keep forging ahead. Thanks again.

One more QQ, kind of off subject, but not worth a new thread. Do you offer bulk license pricing at this time?

Thanks again, great product you have here!
Everything worked great. I managed to implement this on all of the galleries. I have also started implementing this on other pages. I was curious though. On my index.php I have a logo. I have used the image tag and have it set properly so that it all works as intended.

I can upload the photo and add it to the page, no problems there. My issue is that it shows the UNC path of the image to the right of the image itself on the page.

I can't seem to find where to adjust that to get it out of there.

Thanks,
Every editable region also outputs its current contents which makes possible to use it as follows -
Code: Select all
<img src="<cms:editable type='image' name='my_image' />" />

I suppose you are using the region as follows -
Code: Select all
<cms:editable type='image' name='my_image' />
<img src="<cms:show my_image />" />

I think you can see above that the definition of the region also outputs its contents (here the path of the image).

To prevent that you have two ways -
1. Add 'hidden' parameter to the region -
Code: Select all
<cms:editable type='image' name='my_image' hidden='1' />

2. Define the region(s) within the cms:template block somewhere at the top of the template -
Code: Select all
<cms:template>
   <cms:editable type='image' name='my_image' />
   .. other regions defined at one place ..
</cms:template>

Hope it helps.
15 posts Page 2 of 2