By krymp on
I get this error below when trying to remove all the fields from the "page display" in views.
Display "Page" uses fields but there are none defined for it or all are excluded.
I am using regions to display my views, but for some reason it puts in all the content on those pages. I removed the fields from the page display and it worked until I got to the last one and it gave me that error.
Blow is code that in page.tpl.php
<div id="leftContent">
<?php print $tabs ?>
<h1><?php print $title ?></h1>
<?php print $content ?>
<?php if ( !empty($feat_item_top) ) : ?>
<h1>Money Saving Tools</h1>
<?php print $feat_item_top ?>
<?php endif; ?>
<?php if ( !empty($feat_video_top) ) : ?>
<h1>Money Saving Videos <span id="btn_addVideo"><a href="http://localhost/fedcuts/node/add/videos"><img src="<?php print $directory; ?>/images/btn_addVideo.png" width="165" height="25" alt="Add a Video" /></a></span></h1>
<?php print $feat_video_top ?>
<?php endif; ?>
<?php if ( !empty($teaser_results_block) ) : ?>
<h2 class="border">Top Favorites</h2>
<?php print $teaser_results_block ?>
<?php endif; ?>
<?php if ( !empty($gallery_results_block) ) : ?>
<h2 class="border">Top Video Tips</h2>
<div class="gallery_block">
<?php print $gallery_results_block ?>
</div>
<?php endif; ?>
</div>
Comments
I don't think this is correct
I don't think this is correct (drupal standards wise) but it seemed to fix the issue. I removed all the fields and added a new one called "Global: Custom text ". In the options for it I kept everything blank.
This seems like a band aid fix but it works. I would like to keep with in drupal standards so let me know if anyone know a better way.
If your page display setting
If your page display setting for "Row style" is configured to use fields, then views expects some fields to be available to display the results and it warns you when that requirement is not met. IOW, you will need at least one field in the display.
You will need to be a little more succinct in your explanation of "it puts in all the content on those pages". Are you getting the results from the views within the views UI that you would expect?
Mlle.Yotnottin
Yes I realize I need 1 field
Yes I realize I need 1 field that is why is added a new global text field and made it blank. Because I am powering my videos page thru Views so I can get the path /videos to display.
Because of Print $content on my page.tpl page it wanted to show all the content for that view. This was good for pages that didnt use views, such as, the about us page. But when trying to display only videos it would show all of them up at the top in addition to my views set to display via regions.
Hmm.. that's curious. Have
Hmm.. that's curious. Have you looked at using the "Show block on specific pages" settings in your block configuration? Maybe you can limit the views blocks in question to NOT display on your video pages.
I'm ok
You must create Fields that you use, because Style you choose need Fields!!!
My sites: Medicare