如何在Drupal上进行模板

发布于 2025-02-10 06:38:06 字数 376 浏览 2 评论 0原文

我是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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苏璃陌 2025-02-17 06:38:06

您可以通过在没有任何代码的情况下设置块显示,在自定义块中显示完整的内容。

转到管理菜单> 结构> 块布局> 块类型> 您的块类型> 操作> 管理显示

”在此处输入图像描述

使用参考内容字段,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:

enter image description here

With reference content field, set Format to "Rendered entity" and View mode to "Full content":

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文