Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix, add ckan.root_path to ckanext/pages/plugin.py #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Patrick1Rhode
Copy link

This fixes the handling of the ckan.root_path = {name} reported here #98.

@amercader
Copy link
Member

@Patrick1Rhode @ccancellieri Can you try if this alternative approach works for you:

diff --git a/ckanext/pages/plugin/__init__.py b/ckanext/pages/plugin/__init__.py
index e688a38..9aad086 100644
--- a/ckanext/pages/plugin/__init__.py
+++ b/ckanext/pages/plugin/__init__.py
@@ -78,7 +78,8 @@ def build_pages_nav_main(*args):
         else:
             name = quote(page['name'])
         title = html_escape(page['title'])
-        link = tk.h.literal(u'<a href="/{}/{}">{}</a>'.format(type_, name, title))
+        url = tk.url_for('pages.{}_show'.format(type_), page=name)
+        link = tk.h.literal(u'<a href="{}">{}</a>'.format(url, title))
         if page['name'] == page_name:
             li = tk.literal('<li class="active">') + link + tk.literal('</li>')
         else:

Also please keep the .gitignore file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants