Stopping certain fields from displaying in all records

6 posts by 3 authors in: Forums > CMS Builder
Last Post: December 24, 2012   (RSS)

By gregThomas - December 21, 2012

Hi Mel,

Are you passing any data to the detail page to tell it which town/city/region the user is from? 

If your planning on displaying all of the locations for every user, you could reduce the number of check boxes by having a wysiwyg editor and manually entering all of the data.

Another option is to replace grouped checkboxes with a list field. I've attached a screenshot of how you could set up the list field.

Then you could display what has been selected using the fields label:

 <?php echo @$biosRecord['amberside_time:label']; ?> 

This will reduce having 3 checkbox fields down to one 1 list field, and should make the detail page code look cleaner. 

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com
Attachments:

example_003.png 15K

By Mel - December 21, 2012

Hi Greg,

Not a 100% sure I know what you are asking but I will have a stab at it

If I am looking for company to visit me in Ambleside I go along to the Ambleside listing page

On that listing page will be displayed lets say 5 thumbnail pics which link to the individual record page, on the individual record page all the persons bio is displayed

Some will visit Ambleside for 1 hr and others will require a longer appointment  time, hence the 1hr 90 mins 2hrs text

But the same people that visit Ambleside also visit other places lets say for example Manchester plus many other areas, so if you go to the Manchester page it will show lets say again 5 thumbnails and you click on the thumbnail and it takes you to the same master individual record page which at the present time still has the text on about Ambleside appointments

But I would not be interested in what their minimum appointment time was for Ambleside, obviously if it were the case that they had minimum appointment times for Manchester, then I would want them to show but NOT the comments about Ambleside

When you click on a thumbnail in any town/city/region section it does not as far as I am aware pass any information through to the detail page showing what town/city/region page you have clicked through from - which judging by your question might be what is adding to the problem - below is the code that display the thumbnail and link to the detail page

------------------------------------

 <div align="center" class="img_border"><?php foreach ($biosRecord['newimage'] as $upload): ?>
  <?php if ($upload['isImage']): ?>
          <a href="<?php echo $biosRecord['_link'] ?>" target="_self"><img src="<?php echo get_custom_watermark_url($upload['urlPath'], '110watermarkSmall.png') ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="<?php echo $biosRecord['name'] ?>"></a>
          <?php else: ?>     
          <?php endif ?>
    </div>
    <?php endforeach ?>
              
     <div align="right"style="padding-top:3px;">
     <a href="<?php echo $biosRecord['_link'] ?>" target="_self">View My Details</a>
     </div>

------------------------------------

Thanks

Mel

By gkornbluth - December 22, 2012

Hi Mel,

I'm assuming that there are a finite list of tons to be visited?

If that's true, then why not use Greg's suggestion of pull down menus and some sort of multi field search for information only where fields contain the keyword (ambleside, manchester, etc.)

Also,

Don't know if there's a tree to bark up here, but take a look at these two free plugins:

http://www.interactivetools.com/add-ons/detail.php?Show-Hide-Dependent-Fields-Plus-1060

and

http://www.interactivetools.com/add-ons/detail.php?Show-Hide-Fields-For-Users-1036

There may be a concept or two that will work for you.

Hope that helps

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

By gkornbluth - December 23, 2012

Mel,

I''ve attached a viewer that I use to cull records for particular exhibition submissions from a large database of submission records

maybe an idea will appear.

look around line 45 and 165.

I basically set the where from a pull down llist and use it to determine which records will show.

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
Attachments:

submissions_emaillist.php 11K

By Mel - December 24, 2012

Hi Jerry,

Will take a look at the attachement and the plugins you mentioned

In the meantime I have come up with a work around for a particular Area and locations within the area by doing the following

1. Set up a seperate detail page for the area and its locations

2. Manually coded the location pages with an ID that is passed to the new detail page

<a href="details1.php?id=cu6&num=<?php echo $biosRecord['num'];?>">View Details</a>

3. Then on the new detail page put the code below which works and shows the minimum appointment times for an individual record

<?php if ($id=='cu1'): ?>
            <?php echo $biosRecord['name'] ?>'s
            <?php echo @$biosRecord['ambleside_times:label']; ?>
            <?php elseif ($id=='cu2'): ?>
            <?php echo $biosRecord['name'] ?>'s
            <?php echo @$biosRecord['barrow_times:label']; ?>
            <?php elseif ($id=='cu3'): ?>
            <?php echo $biosRecord['name'] ?>'s
            <?php echo @$biosRecord['carlisle_times:label']; ?>
            <?php elseif ($id=='cu4'): ?>
            <?php echo $biosRecord['name'] ?>'s
            <?php echo @$biosRecord['cockermouth_times:label']; ?>
            <?php elseif ($id=='cu5'): ?>
            <?php echo $biosRecord['name'] ?>'s
            <?php echo @$biosRecord['dalton_times:label']; ?>
            <?php elseif ($id=='cu6'): ?>
            <?php echo $biosRecord['name'] ?>'s
            <?php echo @$biosRecord['kendal_times:label']; ?>
            <?php elseif ($id=='cu7'): ?>
            <?php echo $biosRecord['name'] ?>'s
            <?php echo @$biosRecord['ulverston_times:label']; ?>
            <?php elseif ($id=='cu8'): ?>
            <?php echo $biosRecord['name'] ?>'s
            <?php echo @$biosRecord['windermere_times:label']; ?>
            <?php else: ?>
              <?php endif ?>      

But this is a quick fix just for a particular area and set of locations within that area where minimum appointment times are required

In the medium term hopefully there is another way of doing this, otherwise it will mean that I have to manually re-code in excess of 450 pages and growing! in order to pass values through and also end up with a massive list of if statements on the detail page that covers every town and sub category for that town/location

The 450 pages come about as all the main and sub categories are static pages and NOT dynamically produced - this has been done from a search engine point of view as each page has the title, description and keywords crafted for particular search terms - a ton of work but it has resulted in a lot of top 10 positions

If anybody would like to contribute to possible solutions to this, I would be most grateful

In the meantime a happy festive season to everyone

Mel