Blog Navigation Question and Question on Warning Error
8 posts by 3 authors in: Forums > CMS Builder
Last Post: January 17, 2012 (RSS)
By meg - January 13, 2012 - edited: January 17, 2012
1. On the detail pages, the menu only shows that entry, not all the entries.
blogDetails.php
All entries on the main page: blog.php
(this is how I want the menu to display on the detail pages)
2. On the first detailed entry page, I have no warning errors. However, on the rest of the pages, I have warning errors where my php includes are located. Why is that the case?
Please advise. Thanks so much!!
Meghan
Re: [meg] Blog Navigation Question and Question on Warning Error
By Damon - January 13, 2012
For the List Viewer Options that you are using to publish content for "Recent News" and the Footer content, can you add this option for both:
'allowSearch' => false,
I think what is happening is the left side content and footer are getting filtered by the article record number.
If you allowSearch is false, this should make everything work correctly.
Try that out and let me know if you have any questions.
Thanks!
Damon Edis - interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Damon] Blog Navigation Question and Question on Warning Error
By meg - January 13, 2012 - edited: January 17, 2012
<?
include_once("include/session_inc.php");?>
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
$libraryPath = 'cms/lib/viewer_functions.php';
$dirsToCheck = array('/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
list($headerRecords, $headerMetaData) = getRecords(array(
'tableName' => 'header',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
'allowSearch' => false,
));
$headerRecord = @$headerRecords[0];
list($portfolio_menuRecords, $portfolio_menuMetaData) = getRecords(array(
'tableName' => 'portfolio_menu',
'allowSearch' => false,
));
list($footerRecords, $footerMetaData) = getRecords(array(
'tableName' => 'footer',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
'allowSearch' => false,
));
$footerRecord = @$footerRecords[0];
list($promoRecords, $promoMetaData) = getRecords(array(
'tableName' => 'promo',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
'allowSearch' => false,
));
$promoRecord = @$promoRecords[0];
list($blog_entriesRecords, $blog_entriesMetaData) = getRecords(array(
'tableName' => 'blog_entries',
'allowSearch' => false,
));
list($blog_entriesRecords, $blog_entriesMetaData) = getRecords(array(
'tableName' => 'blog_entries',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
'allowSearch' => false,
));
$blog_entriesRecord = @$blog_entriesRecords[0];
?>
A sample include looks like this:
<?
include_once("include/footer-2011.php");?>
The sidebar menu looks like this:
<?php foreach ($blog_entriesRecords as $record): ?><li><a href="<?php echo $record['_link'] ?>" title="<?php echo $record['title'] ?>"><?php echo $record['title'] ?></a></li><?php endforeach ?>
Let me know what I should modify. Thank you!!
Re: [meg] Blog Navigation Question and Question on Warning Error
By Jason - January 16, 2012
I think the problem you're running into is in this block of code:
list($blog_entriesRecords, $blog_entriesMetaData) = getRecords(array(
'tableName' => 'blog_entries',
'allowSearch' => false,
));
list($blog_entriesRecords, $blog_entriesMetaData) = getRecords(array(
'tableName' => 'blog_entries',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
'allowSearch' => false,
));
$blog_entriesRecord = @$blog_entriesRecords[0];
Because you use the same variable name twice ($blog_entriesRecords), you value is being overwritten by your second. This is why you are only getting one value in your list. What you can do is just re-name the variable something like this:
list($blog_entriesRecords, $blog_entriesMetaData) = getRecords(array(
'tableName' => 'blog_entries',
'allowSearch' => false,
));
list($blog_listRecords, $blog_listMetaData) = getRecords(array(
'tableName' => 'blog_entries',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
'allowSearch' => false,
));
$blog_entriesRecord = @$blog_entriesRecords[0];
You would then use $blog_listRecords in your foreach loop to output your blog list.
Hope this helps
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Blog Navigation Question and Question on Warning Error
By meg - January 16, 2012
list($blog_listRecords, $blog_listMetaData) = getRecords(array(
'tableName' => 'blog_entries',
'allowSearch' => false,
));
list($blog_entriesRecords, $blog_entriesMetaData) = getRecords(array(
'tableName' => 'blog_entries',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
'allowSearch' => false,
));
$blog_entriesRecord = @$blog_entriesRecords[0];
With the menu:
<?php foreach ($blog_listRecords as $record): ?><li><a href="<?php echo $record['_link'] ?>" title="<?php echo $record['title'] ?>"><?php echo $record['title'] ?></a></li><?php endforeach ?>
Re: [Jason] Blog Navigation Question and Question on Warning Error
By meg - January 16, 2012
Re: [meg] Blog Navigation Question and Question on Warning Error
By Jason - January 17, 2012
My guess is that you get this error when trying to output your footer record. From your code, it looks like your footer record is a single record section. In the case of single record sections, you should remove your "where" clause. Since this section will only ever have 1 record, there is no need for a search.
Try removing it here:
list($footerRecords, $footerMetaData) = getRecords(array(
'tableName' => 'footer',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
'allowSearch' => false,
));
$footerRecord = @$footerRecords[0];
Hope this helps
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Blog Navigation Question and Question on Warning Error
By meg - January 17, 2012