自定义 Drupal 面板中的设置

发布于 2024-10-08 11:00:23 字数 414 浏览 7 评论 0原文

我正在构建自己的面板,但真的希望能够使用某种自定义设置来自定义它们。一种情况是三列布局 - 我的目标是使用某种输入参数为 40/40/20% 布局和 20/20/60% 布局提供一个面板。最好我想使用通用的列布局,这样我就可以将它与“40/40/20”输入参数以及“10/10/50/20/10”一起使用。

这一切可能吗?

编辑:为了澄清,我希望(在 panelname.tpl.php 文件中)能够编写类似的内容

<div id="myLeftPane" class="first-column" width="{myCustomWidthSettingVariable}"> ... </div>

,并能够在我使用面板的不同位置将变量设置为不同的内容。

谢谢! /胜利者

I am building my own panels, but would really like to be able to customize them using some kind of customization settings. One case would be a three column layout - my goal then would be to have one panel for both the 40/40/20% layout and the 20/20/60% layout using some kind of input arguments. Optimally i would like to use a generic column layout so i could use it with both "40/40/20" input arguments as well as "10/10/50/20/10".

Would any of this be possible?

Edit: To clarify, I would like to (in the panelname.tpl.php file) be able to write something like

<div id="myLeftPane" class="first-column" width="{myCustomWidthSettingVariable}"> ... </div>

and to be able to set the variable to different things in the different places where I use the panel.

Thanks!
/Victor

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

怀里藏娇 2024-10-15 11:00:23

您可以在定义区域以及设置区域样式所需的 CSS 的地方创建您想要的所有布局。

对于带有参数的面板页面,您可以使用它来决定应使用哪种布局、应打印哪些内容以及应在何处打印。

一个例子是为每种节点类型创建不同的布局,但您实际上可以用任何东西来做到这一点。

其中一些可以直接完成,而另一些可能需要您编写自己的插件。要详细介绍所有可能性以及如何做到这一点,内容过于广泛,无法在此编写。

了解更多信息的好来源是面板文档或查看与面板集成的其他模块并了解它们是如何完成工作的。

更新:
您想要做的不是面板是如何构建的。我并不是说这是不可能的,但我想这会非常困难。您应该能够充分利用 CSS 和 HTML,如果这还不够,使用不同的 CSS/HTML 创建其他布局会更容易。

请记住,面板将创建很多类,因此您可以在主题中使用自定义 CSS 来处理此问题。

You can make all the layouts you want where you define the regions and the css needed to style the them.

For a panel page that take an argument, you can use that you decide which layout should be used, what content should be printed and where it should be printed.

An example of this, would be to create different layouts for each node type, but you could do it with anything really.

Some of this can be done out of the box, while some of it might require you to code your own plugins. To go into detail with all the possibilities and how to do it would be too extensive to write here.

Good sources to learn more is the Panels documentation or look at other modules integration with panels and see how they done things.

Update:
What you are trying to do is not how panels was built. I'm not saying it's impossible, but I imagine that it will be quite hard. You should be able to get very far with CSS and HTML, where that isn't enough it will be easier to create additional layouts with different CSS/HTML.

Remember that panels will create a lot of classes, so you might be able to handle this with custom CSS in your theme.

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