Help creating intitial section structure
9 posts by 2 authors in: Forums > CMS Builder
Last Post: August 15, 2008 (RSS)
This site is setup with 4 top level pages, and each of those pages has several pages beneath it.
I was planning to create sections for each of those top level pages, and then put their sub pages as items within the respective section.
However if I do that, then the styling of each of the sub pages has to be identical. That's not a big deal, exceptfor a masthead photo that is unique to each page. I don't need that photo to be editable or changeable, I really just need it to be a fixed design element. Any thoughts on how to accomplish this?
If I don't go that route, I'll just need to add each page in as a separate section. It seems though that the menu bar in the CDSB admin will get rather cluttered with 20 or sections. Is there any other way to group these?
Re: [Capt'n Morgan] Help creating intitial section structure
Re: [Capt'n Morgan] Help creating intitial section structure
By Dave - August 15, 2008
Your upload field will be named something like this: $record['uploads']. If it's named differently use the name from you code and try this:
<?php if (!$record['uploads']): ?>
No masthead! <img src="..." />
<?php endif ?>
The ! means no or not, so basically that means "if no uploads - show this".
Let me know if that does the trick for you.
interactivetools.com
Re: [Capt'n Morgan] Help creating intitial section structure
By Capt'n Morgan - August 15, 2008 - edited: August 15, 2008
This is my source for that. I can't quite figure out where to put your code, can you help?
I'm sure I can take out the thumbnail and download code too, but I haven't got that far.
<!-- STEP3: Display Uploads from 'masthead_image' (Paste this where you want your uploads displayed) -->
<!-- Upload Program Fields : num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath -->
<!-- Upload Image Fields : isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight -->
<!-- Upload Info Fields : info1, info2, info3, info4, info5 -->
<?php if ($about_usRecord): ?>
<?php foreach (getUploads($about_usOptions['tableName'], 'masthead_image', $about_usRecord['num']) as $upload): ?>
<?php if ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>
<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">download<?php echo $upload['filename'] ?></a><br/>
<?php endif ?>
<?php endforeach ?>
<?php endif ?>
<!-- STEP3: /Display Uploads from 'masthead_image' -->
Re: [Capt'n Morgan] Help creating intitial section structure
By Dave - August 15, 2008
Put it just below the endforeach like this:
<?php endforeach ?>
... insert code here...
<?php endif ?>
Let me know if you have any troubles with that.
interactivetools.com
Re: [Dave] Help creating intitial section structure
<!-- Upload Program Fields : num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath -->
<!-- Upload Image Fields : isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight -->
<!-- Upload Info Fields : info1, info2, info3, info4, info5 -->
<?php if ($about_usRecord): ?>
<?php foreach (getUploads($about_usOptions['tableName'], 'masthead_image', $about_usRecord['num']) as $upload): ?>
<?php if ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>
<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">download<?php echo $upload['filename'] ?></a><br/>
<?php endif ?>
<?php endforeach ?>
<?php if (!$about_usRecord['masthead_image']): ?>
No masthead! <img src="images/header.jpg" />
<?php endif ?>
<?php endif ?>
Re: [Capt'n Morgan] Help creating intitial section structure
By Dave - August 15, 2008
We updated the code generator a few months ago to automatically load uploads. Try this (changes in red):
<?php if ($about_usRecord): ?>
<?php $uploads = getUploads($about_usOptions['tableName'], 'masthead_image', $about_usRecord['num']); ?>
<?php foreach ($uploads as $upload): ?>
...
<?php if (!$uploads): ?>
No masthead! <img src="images/header.jpg" />
<?php endif ?>
If that doesn't work feel free to send me an email with FTP and CMS login details to dave@interactivetools.com (email, don't post login details to forum) and I can take a look. I'll be able to debug it quicker for you that way.
Hope that helps!
interactivetools.com
Re: [Dave] Help creating intitial section structure
Re: [Capt'n Morgan] Help creating intitial section structure
By Dave - August 15, 2008
Your old code will continue to work after you upgrade as well, but the new code you generate might look a little different.
Let me know if you need anything else.
interactivetools.com