drupal8主题开发学习小结(思路总结)

      面对drupal8最初的感觉如获至宝,但也同样感觉到学习的难度,而恰恰只有这样才能激励去学习,去研究,才能真正提升自我。

      直接进入主题学习的思路,首先我是带着疑问去学的。就是想知道 drupal8是如果利用区块、twig、views 灵活的组织页面结构和效果。我先从基础概念学起,例如beginning drupal8 theming,看基础的教程视频等。慢慢的了解了drupal8实现页面构建的方法。接下来总结如下:

       1、如果页面的某一部分区块为纯静态html效果,则推荐直接使用自定义区块,直接将html内容做成区块。提示:需要添加编辑器的完整格式,使其可以正常显示输入的Html内容。

       2、页面部分为列表、文章内容等调取数据的内容,那就使用drupal8自带的 views 模块,可以很方便的组织出来大部分数据需求。其中,views可以建立独立的页面,也可以建立区块。

        在使用views建立区块获取数据的时候,有两种主要的方法。第一种是使用field字段类型,这种方法有一定的局限性,尤其是在 获取链接地址上,没有绝对的灵活度。(这里说的就是从自定义Html内容上)。第二种是使用content内容类型,这种方法好处是相当的灵活,但需要设置好对应的显示模式。利用显示模式,可以调整出理想的数据结果。两种方法都需要用到覆写模板的方法(关于这方面推荐国内的tvdrupal的视频),但字段类型的方法在使用twig field插件的时候可以利用其function很容易的调用区块,这方面内容类型就只能通过添加内容字段进行调用区块来实现。

         3、drupal8覆写模板比较复杂,因为都是层层嵌套。需要根据模板命名做好规划,保证其覆写的灵活性。

          后面我将继续研究利用custom module的方法实现render array的方法到template,然后输出到页面。自定义区块肯定拥有更多的灵活性,但drupal本身有着比框架还多的调用接口和规则,所以需要掌握起来必然会很困难,但是这些如果都要自己去开发和实现必然会浪费很多的时间,毕竟我需要的就是他的方便可靠以及整体的解决方案。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Drupal 8 for Absolute Beginners is your definitive guide to starting from scratch with Drupal even if you have little web knowledge. This book teaches you the basics of HTML, CSS, JavaScript, and PHP in relation to Drupal, so that you can begin to use this popular CMS with all of its features. You will first learn how to set up and customize a basic blog using Drupal, one of the most powerful and popular content management systems available today. From there you will learn the basics of HTML, CSS, JavaScript and PHP, and apply this knowledge to create your own custom Drupal module. You will learn how to build, style, and add functionality to your own Drupal module from scratch. You will then use Drush to apply a theme to Drupal, customizing everything to your liking, before publishing your work to the world. The book also covers some more advanced topics that beginners often ask about, such as getting set up with Git and using source control, using MySQL to interact with a database, and a guide to getting up and running with Linux. Rarely has all the knowledge required to start with Drupal been collated in one place as it is in Drupal 8 for Absolute Beginners. You need no prior knowledge of the web, only a desire to learn. The book is fully supported by video material on the author's website. Start your Drupal journey with this book today! What you’ll learn Written for beginners to Drupal and web programming Learn what Drupal can do and how you can master it Use all of the common web technologies in conjunction with Drupal Create and apply a theme to your Drupal site Start your journey into more advanced topics, such as Git, MySql, and Linux Who this book is for The book targets anyone wishing to learn either basic web technology, Drupal, or both, and in particular it shows how basic web technologies fit into working with Drupal. Even if you know basic CSS, HTML, and JavaScript many fall short on learning how to tailor Drupal and extend Drupal with these basic skills. The book can elevate the reader to be able to land a great first job in the Drupal community after learning HTML, CSS, JavaScript, JQuery, PHP, MySql, and Linux. The book also is great for the business community trying to understand the power of open source. It’s important as a business person to know what tools are available to solve problems. The Drupal community has many unfilled job openings, as programmers, support persons, UX experts, sales people ... after reading this book the reader will be able to wow those interviewing them with their in depth knowledge of how much Drupal can do. Table of Contents Chapter 1: Installing Drupal Chapter 2: Site Building: Building Drupal Sites Without Programming Chapter 3: Getting Started with HTML Chapter 4: Creating a Basic Drupal Module with HTML Output Chapter 5: A CSS Primer for Drupal Chapter 6: Adding CSS to Your Drupal Module Chapter 7: A JavaScript Primer for Drupal Chapter 8: Adding JavaScript to Your Drupal Module Chapter 9: A PHP Primer for Drupal Chapter 10: Adding PHP-Generated Output to Your Drupal Module Chapter 11: Creating a Drupal Block Programmatically and Basic MySQL Usage Chapter 12: Theming Your Site Part 1: Theme Functions and a Twig Primer Chapter 13: Theming Your Site Part 2: Creating a Custom Theme and Subtheme Chapter 14: Working with Forms and Creating Custom Forms Chapter 15: Using Git to Manage Your Source Code Chapter 16: Advanced MySQL Primer Chapter 17: Linux Chapter 18: Publishing Your Site to a Production Linux Box Appendix A: Other Ways to Install Drupal Appendix B: Basic Linux Commands
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值