You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When forming Janeway URLs in path mode, the press level of a site is often identified by the absence of a journal code, rather than the presence of a key or argument or path segment.
As a result, there is currently no way to dynamically build a named URL at the press level when working within the context of a journal page. This makes it difficult to create journal-level interfaces that refer to press interfaces and guide users between them.
{% comment %} The above URL is hardcoded because there is no other
way to form a press URL on a journal page at the moment. {% endcomment %}
You can do request.press.site_url or journal.press.site_url in most cases, but these are just context variables pointing to the press landing page. They do not take arguments and so cannot be used to reverse named urls.
The template tag site_url also does not work because, on path mode, it prepends the journal code.
This means the formed URL will always refer back to the journal. If you do {% site_url "press_all_users" %} that will just put out example.org/JOURNAL/press/user/all.
Proposed solution
An additional template tag press_url that allows you to reverse any press url, regardless of current page / request context. It could be used like this:
If a broader search is needed,
try <a href="{% press_url 'press_all_users' %}">All Users
at the press level</a>.
Alternative considered
An additional argument on the site_url template tag for a boolean called press. If True, the tag will use press as the site_type rather than the site_type of the request.
The text was updated successfully, but these errors were encountered:
Problem description
When forming Janeway URLs in path mode, the press level of a site is often identified by the absence of a journal code, rather than the presence of a key or argument or path segment.
As a result, there is currently no way to dynamically build a named URL at the press level when working within the context of a journal page. This makes it difficult to create journal-level interfaces that refer to press interfaces and guide users between them.
Example:
janeway/src/templates/admin/core/manager/users/list.html
Lines 28 to 33 in 6982329
You can do
request.press.site_url
orjournal.press.site_url
in most cases, but these are just context variables pointing to the press landing page. They do not take arguments and so cannot be used to reverse named urls.The template tag
site_url
also does not work because, on path mode, it prepends the journal code.janeway/src/core/templatetags/fqdn.py
Lines 33 to 44 in 6982329
This means the formed URL will always refer back to the journal. If you do
{% site_url "press_all_users" %}
that will just put outexample.org/JOURNAL/press/user/all
.Proposed solution
An additional template tag
press_url
that allows you to reverse any press url, regardless of current page / request context. It could be used like this:Alternative considered
An additional argument on the
site_url
template tag for a boolean calledpress
. IfTrue
, the tag will use press as thesite_type
rather than thesite_type
of the request.The text was updated successfully, but these errors were encountered: