如何在Drupal上进行模板
我是Drupal的新手,我有点困扰着我的项目。所以我来这里寻求帮助。
我想通过模板概念开发我的网站。我的网页具有类似的“块”,但在不同的内容中(例如图片或措辞)。
我从页面上的每个部分开始使用独特的内容类型的自定义块,然后将它们组装到带有页面管理器的页面中。 3页后,内容类型和内容变得太混乱了,我认为我对复杂性失去了控制。此外,尝试为每个部分创建一个自定义块是有点愚蠢的。
因此,现在我尝试开发 /配置一个具有自己的样式和JS的自定义块,该块可以过滤内容类型并选择特定内容以呈现。
我尝试创建一个带有内容参考的自定义块类型。但是它没有显示完整的帖子,而是指向内容的链接。我尝试编码一个自定义块,但我不确定如何将内容动态传递到其中。您能为我提供任何想法还是发光?
多谢
I'm new in drupal and I'm kinda stuck on my project. So I come here ask for help.
I want to develop my website in drupal with template concepts. My webpages have a lot similar style "blocks" but in different contents (like pictures or wordings).
I started with custom block for each section on my page with unique content type and then assemble them into a page with page manager. After 3 pages the content type and contents become too messy and I think I have lost control on the complexity. Also it's kinda stupid trying to create a custom block for every section.
So now I'm trying to develop / config a custom block, which has its own style and js, that can filter on content type and select specific content to render.
I tried to create a custom block type with content reference. but it does not show full post but a link to the content. I try to code a custom block but I'm not sure how to dynamically pass content into it. Could you please provide any idea or shine any hint on me?
Thanks a lot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过在没有任何代码的情况下设置块显示,在自定义块中显示完整的内容。
转到
管理菜单
>结构
>块布局
>块类型
>您的块类型
>操作
>管理显示
:使用参考内容字段,set
格式
to“渲染实体”和view> view模式
to“ fult内容“:You can show full content in the custom block by setting block display without any code.
Go to
Admin menu
>Structure
>Block layout
>Block types
>Your block type
>Operations
>Manage display
:With reference content field, set
Format
to "Rendered entity" andView mode
to "Full content":