Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
hi, my client got in touch today to report a problem on his website. There is a cloneable Events template events.php with a dropdown to select a venue for an event :
Code: Select all
<cms:editable name="event_venue" label="Venue" desc="Select one from these" opt_values='list_venues.html' dynamic='opt_values' type='dropdown' order='25' />


list_venues.html is
Code: Select all
<cms:pages masterpage='venue_details.php'>
   <cms:show k_page_title  />|
</cms:pages>


and venue_details.php is
Code: Select all
<?php require_once( 'admin/cms.php' ); ?>

<cms:template title='Add/Amend a venue' clonable='1' executable='0' commentable='0' order='50'>

<cms:editable name='venue_photo' label='Venue photo' desc='Upload venue photo' type='image' show_preview='1'   preview_width='50'  order='30'/>

<cms:editable name='venue_description' type='richtext' label='Venue description'  height='100' order='45'/>

<cms:editable name='venue_address' type='textarea' label='Venue address'  height='100' order='60'/>

<cms:editable name='transport_links' type='richtext' label='Transport links'  height='75' order='75'/>

<cms:editable name='venue_miscellaneous' type='richtext' label='Miscellaneous Info' height='100' order='90'/>

</cms:template>
<?php COUCH::invoke(); ?>


There is a venue titled
St John's Downshire Hill
and 2 of the events on the website were not showing the venue with <cms:show event_venue /> - just a blank on the website. Other events were showing the venue.

After a bit of investigation I worked out that it is the apostrophe in the venue title that is causing the problem. And the problem must have manifested itselft after I recently upgraded the site to Couch 1.4 and PHP 5.5.

If I re-save an event which is showing the venue correctly as
St John's Downshire Hill
it will then gain the problem and show nothing.

I set up another venue
St Johns Downshire Hill
i.e. without the quote and it works OK.

A small thing but obviously a bit bewildering for the client!
Hi,

It is always desirable to save the values as k_page_name or k_page_id (as opposed to k_page_title, as in your, case) - this preempts such problems as the two can only have safe characters.

Instead of using the following in list_venues.html
Code: Select all
<cms:pages masterpage='venue_details.php'>
   <cms:show k_page_title  />|
</cms:pages

- please use the following
Code: Select all
<cms:pages masterpage='venue_details.php'>
   <cms:show k_page_title  />=<cms:show k_page_id />|
</cms:pages>

The code above will display the titles but will save the ids.

On the front end, we can fetch the title as follows -
Code: Select all
<cms:pages masterpage='venue_details.php' id=event_venue limit='1' >
   <cms:show k_page_title  />
   .. other details also available here ..
</cms:pages>

This will have the added benefit of allowing us fetch full info about the venue, and not just the name.

Does this help?
thanks KK - I'll switch to your suggested method to avoid problems. Since we only want the venue name in the event listing (there is a separate page listing full venue details) the method that worked up til recently seemed the obvious way to do it. I'm not sure I understand why an editable dropdown region cannot save an apostrophe any more - I guess it's something behind the scenes?!
3 posts Page 1 of 1
cron