-2

I have created page--front.html in drupal 8 custom theme then how to make dynamic this page section ? where I write custom code. i.e. how to showing slider images to which is added in admin side.

Please suggest me which controller I use ?

1 Answer 1

1

Your question is somewhat general but here is an attempt to make it a little more clear and answer it.

You can probably copy core/themes/classy/templates/page.html.twig to your theme's template directory and name it page--front.html.twig and you can modify it as you like.

Perhaps a better approach would be to do it in a modular way.

Find appropriate modules that give you desired functionality (slideshows etc) and most of them will allow you to create BLOCK(s) out of them and then you can add those blocks to any page you want but in your case it would be <front>.

Your front page could be made out of blocks from slideshow module and or views block(s) or even custom blocks (/block/add) or any other block.

Here is an example of how to set a block to display on front page enter image description here

You can also create a basic page (or any content type) and then set it as front page by going to Configuration > system > basic site settings > FRONT PAGE > Default front page (admin/config/system/site-information). Blocks can still be placed on front page with this approach.

1
  • Hey hi thanks for reply, I have added html in page--front.html for front page and it's working. I just want to know how to make dynamic page--front.html page ? Content will reflect from CONTENTS. Commented Aug 11, 2018 at 12:23

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