Expression Engine 2 下一个/上一个条目与完整条目列表的链接

发布于 2024-12-21 15:48:24 字数 880 浏览 5 评论 0原文

我想在 EE2 中使用下一个/上一个条目链接技术:

{exp:channel:next_entry}
    <p>Next entry: <a href="{path='site/comments'}">{title}</a></p>
{/exp:channel:next_entry}

{exp:channel:prev_entry}
    <p>Previous entry: <a href="{path='site/comments'}">{title}</a></p>
{/exp:channel:prev_entry}

当它起作用时,我在一个条目 ie 上。 Awesome.com/index.php/my-cool-entry,我可以点击页面浏览该频道中的条目。

当我查看一篇文章时,是否还可以显示此页面上的条目的完整列表?我希望能够显示条目列表作为导航到特定文章的方式。

将其视为 {pagination_links} 构建链接的方式: 首页 < 1 2 3 >最后一页除了数字之外我想显示该条目的部分内容,而不仅仅是数字。

令我困扰的是 {paginate} 生成丑陋的 URL ie。 Awesome.com/index.php/articles/P1,我宁愿有 awesome.com/index.php/articles/my-cool-entryexp:channel:next_entry/prev_entry 保留 URL_title!

有没有一个插件可以处理这种事情?

I want to use the Next/Previous Entry Linking technique in EE2:

{exp:channel:next_entry}
    <p>Next entry: <a href="{path='site/comments'}">{title}</a></p>
{/exp:channel:next_entry}

{exp:channel:prev_entry}
    <p>Previous entry: <a href="{path='site/comments'}">{title}</a></p>
{/exp:channel:prev_entry}

When this works, I'm on a single entry ie. awesome.com/index.php/my-cool-entry, I can click page through the entries in that channel.

Is it possible to ALSO display a full list of the entries on this page while I'm looking at one article? I want to be able to show the list of entries as a way to navigate to a particular article.

Think of it like the way {pagination_links} builds links:
First Page < 1 2 3 > Last Page except instead of numbers I want to display parts of that entry, rather than just a number.

What bothers me is that {paginate} generates ugly URLs ie. awesome.com/index.php/articles/P1, I'd rather have awesome.com/index.php/articles/my-cool-entry. exp:channel:next_entry/prev_entry preserves the URL_title!

Is there a plug-in that can handle this kind of thing?

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

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

发布评论

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

评论(1

若言繁花未落 2024-12-28 15:48:24

嵌入模板是正确的方法。

使用 {exp:channel:entries} 循环创建一个新模板。在其中您可以转储您想要的条目并显示您想要从中获得的任何信息。

需要确保的一件事是在 {exp:channel:entries} 中使用 dynamic="no" 参数。它会像这样:

在您的文章页面中,嵌入另一个模板:

{embed="article/full_list"}

并在 article/full_list 模板中使用如下循环:

{exp:channel:entries dynamic="no" channel="[YOUR CHANNEL]" LIMIT="10"}
    <a href="{title_permalink}">{title}</a>
{/exp:channel:entries}

Embedding a template is the way to go.

Create a new template with an {exp:channel:entries} loop. Within that you can dump out the entries you want and display any info you want from them.

One thing to make sure of is to use the dynamic="no" parameter within the {exp:channel:entries}. It'll go something like this:

In your article page, embed another template:

{embed="article/full_list"}

And within the article/full_list template use a loop like:

{exp:channel:entries dynamic="no" channel="[YOUR CHANNEL]" LIMIT="10"}
    <a href="{title_permalink}">{title}</a>
{/exp:channel:entries}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文