Skip to content

Commit

Permalink
CKAN root path fix #98
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick1Rhode committed Jun 25, 2020
1 parent da7f35d commit 167671b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
12 changes: 0 additions & 12 deletions .gitignore

This file was deleted.

5 changes: 3 additions & 2 deletions ckanext/pages/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def build_pages_nav_main(*args):
about_menu = toolkit.asbool(config.get('ckanext.pages.about_menu', True))
group_menu = toolkit.asbool(config.get('ckanext.pages.group_menu', True))
org_menu = toolkit.asbool(config.get('ckanext.pages.organization_menu', True))
root_path = config.get('ckan.root_path', '/')

# Different CKAN versions use different route names - gotta catch em all!
about_menu_routes = ['about', 'home.about']
Expand Down Expand Up @@ -58,7 +59,7 @@ def build_pages_nav_main(*args):
type_ = 'blog' if page['page_type'] == 'blog' else 'pages'
name = urllib.quote(page['name'].encode('utf-8')).decode('utf-8')
title = cgi.escape(page['title'])
link = h.literal(u'<a href="/{}/{}">{}</a>'.format(type_, name, title))
link = h.literal(u'<a href="{}/{}/{}">{}</a>'.format(root_path, type_, name, title))
if page['name'] == page_name:
li = h.literal('<li class="active">') + link + h.literal('</li>')
else:
Expand Down Expand Up @@ -261,4 +262,4 @@ def form_template(self, context, data_dict):
return 'textbox_form.html'

def setup_template_variables(self, context, data_dict):
return
return

0 comments on commit 167671b

Please sign in to comment.