0

I have been tasked with creating a new basic page that contains displays, the content of some new content type. So far, I have created the basic page and I have also created a new view block (i.e. I went to structure->views and added a new block).

Now I need to display this view block on the Basic Page I created. From my (little) understanding of Drupal, I believe I need to add a line like so:

<div class="transparency-view assessments-view">
    <?php echo views_embed_view('my_view_block', 'block'); ?>
</div>

to my basic page's template file located in sites/all/themes/mytemplates/node--12516.tpl.php.

However, this project is hosted on Acquia and I am unsure about how to get that file down to edit it (if it exists).

How can I pull down these types of changes with Acquia? Or am I going about this all wrong? How am I supposed to add a view block to a Basic Page?

  • Lots of misunderstanding in your question. The block is in your database. And normally you would add it to a region and configure it to only be displayed on content type "page" under Structure > Blocks. Acquia is irrelevant, but when it comes to deployment you either manually recreate the block on your live page or use the Features module or a similar approach to get the relevant pieces in the local database exported as file which can be version tracked and used to import the changes in your live database without the need to recreate the block manually. – leymannx Jul 14 at 8:33
2

When you create a block using views you can add it to the page through the interface.

Go to, admin/structure/block and find the region you want to add the block to, then click place block. Now find your block in the list and configure it to only show on the specefic page.

There are some tabs where you can configure where the block is shown, then tell it to only be visible in that specific page, by typing in the page URL.

Then the block will show up on the page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.