Page URLs not working
Ad
I'm new with October and I'm trying to develope some themes and plugins.
It's all working fine except of page links.
For example, Blog page has this markup:
title = "Novità & Offerte"
url = "/news"
layout = "blog"
is_hidden = 0
meta_title = "News & Offerte"
meta_description = "Scopri tutte le novità."
[blogPosts]
pageNumber = "{{ :page }}"
postsPerPage = 10
noPostsMessage = "No posts found"
sortOrder = "published_at desc"
categoryPage = "news/categorie"
postPage = "news/post"
==
{% component 'blogPosts' %}
I tried to call this page from a static menu on the header partial, with no results: it keeps redirecting to the home page.
Tried:
<li><a title="Le novità del nostro negozio" target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="{{ 'news'|page }}">Novità</a></li>
and
<li><a title="Le novità del nostro negozio" target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="{{ '/news'|page }}">Novità</a></li>
Nothing works. I can't figure out why it redirects correctly to blog posts or categories and not to "normal" pages of October.
The blog is running with Rainlab Blog plugin.
Can someone help me with this?
Thanks in advance!
Ad
Answer
Ad
You can use the URL helper function. For example:
<a target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="{{ url('/news') }}">News</a>
This should produce something like:
<a target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="http://app.localhost/news">News</a>
Ad
source: stackoverflow.com
Related Questions
Ad
- → OctoberCMS Backend Loging Hash Error
- → "failed to open stream" error when executing "migrate:make"
- → OctoberCMS - How to make collapsible list default to active only on non-mobile
- → Create plugin that makes objects from model in back-end
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → How to install console for plugin development in October CMS
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → How to update data attribute on Ajax complete
- → October CMS - Conditionally Load a Different Page
Ad