在首页显示动态块而不是静态块?

发布于 2024-10-21 23:32:31 字数 2976 浏览 1 评论 0原文

我有一个网站,首页包含 4 个文本块,基本上是一个小的介绍框。目前这些盒子包含静态数据。我现在想要的是将这些框转换为内容,并且可以从管理员更改它们的框。基本上使网站更加用户友好。这些框包含标题、小缩略图和小描述。我创建了一个内容类型,其中有标题字段、正文字段和 1 个图像附加选项。我可以在不使用视图的情况下以我想要的方式向他们展示吗?

                        <?php if($messages) print $messages; ?>
                        <div class="content_left">
                        <div class="block1">
                            <h4 class="title-storefront">Gorgeous Storefront</h4>
                                Each Shopify store comes with a variety of beautiful themes to choose from.Each Shopify store comes with a variety of beautiful themes to choose from.Each Shopify store comes with a variety of beautiful themes to choose from.Each Shopify store comes with a variety of beautiful themes to choose from.Each Shopify store comes with a variety of beautiful themes to choose from.</div>
                            <div class="block1">
                            <h4 class="title-customizable">100% Customizable</h4>
                                Use your own HTML &amp; CSS and have complete control over the look and feel of your online store.Use your own HTML &amp; CSS and have complete control over the look and feel of your online store.Use your own HTML &amp; CSS and have complete control over the look and feel of your online store.Use your own HTML &amp; CSS and have complete control over the look and feel of your online store.
                        </div>
                        </div>
                        <div class="content_right">
                            <div class="block1">
                            <h4 class="title-shoppingcart">Shopping Cart</h4>
                                Your online store will have its own shopping cart and streamlined checkout.Your online store will have its own shopping cart and streamlined checkout.Your online store will have its own shopping cart and streamlined checkout.Your online store will have its own shopping cart and streamlined checkout.Your online store will have its own shopping cart and streamlined checkout.
                        </div>
                            <div class="block1">
                            <h4 class="title-secure">Super Secure</h4>
                                 We have a dedicated team of security experts that make sure your e-commerce site is as secure as possible.We have a dedicated team of security experts that make sure your e-commerce site is as secure as possible.We have a dedicated team of security experts that make sure your e-commerce site is as secure as possible.We have a dedicated team of security experts that make sure your e-commerce site is as secure as possible.
                        </div>
                        </div>
                      </div> <!-- /#content-area -->

如何分别打印内容的标题、图像和描述。

I have a site in which the front page contains the 4 blocks of text, basically a small introductory boxes. Curently these boxes contain the static data. What I want now is to convert these boxes to content and can change their boxes from admin. Basically making site more user friendly. The boxes contain title , a small thumbnail and small description. I have created a content type in which I have title field , body field and 1 image attached option. Can I show them the way I want without using views.

                        <?php if($messages) print $messages; ?>
                        <div class="content_left">
                        <div class="block1">
                            <h4 class="title-storefront">Gorgeous Storefront</h4>
                                Each Shopify store comes with a variety of beautiful themes to choose from.Each Shopify store comes with a variety of beautiful themes to choose from.Each Shopify store comes with a variety of beautiful themes to choose from.Each Shopify store comes with a variety of beautiful themes to choose from.Each Shopify store comes with a variety of beautiful themes to choose from.</div>
                            <div class="block1">
                            <h4 class="title-customizable">100% Customizable</h4>
                                Use your own HTML & CSS and have complete control over the look and feel of your online store.Use your own HTML & CSS and have complete control over the look and feel of your online store.Use your own HTML & CSS and have complete control over the look and feel of your online store.Use your own HTML & CSS and have complete control over the look and feel of your online store.
                        </div>
                        </div>
                        <div class="content_right">
                            <div class="block1">
                            <h4 class="title-shoppingcart">Shopping Cart</h4>
                                Your online store will have its own shopping cart and streamlined checkout.Your online store will have its own shopping cart and streamlined checkout.Your online store will have its own shopping cart and streamlined checkout.Your online store will have its own shopping cart and streamlined checkout.Your online store will have its own shopping cart and streamlined checkout.
                        </div>
                            <div class="block1">
                            <h4 class="title-secure">Super Secure</h4>
                                 We have a dedicated team of security experts that make sure your e-commerce site is as secure as possible.We have a dedicated team of security experts that make sure your e-commerce site is as secure as possible.We have a dedicated team of security experts that make sure your e-commerce site is as secure as possible.We have a dedicated team of security experts that make sure your e-commerce site is as secure as possible.
                        </div>
                        </div>
                      </div> <!-- /#content-area -->

How can I print title, image and description of a content separately.

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

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

发布评论

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

评论(1

呆头 2024-10-28 23:32:31

从根本上来说,为内容创建块。您可能需要在主题中添加区域,然后可以将块分配给该区域。不过,如果您希望在块中添加节点列表,则视图是最佳选择。如果您能解释为什么要避免使用视图,也许其他人能够提出替代方案。

Fundamentally, create Blocks for the content. You may need to add regions in your theme, to which you can then assign your blocks. If you're looking to add lists of nodes in the blocks, though, Views is the way to go. If you can explain why you're avoiding Views, perhaps others will be able to advise an alternative.

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