Ticket #3714 (closed Bug: fixed)

Opened 12 years ago

Last modified 7 years ago

Skip to content link is incorrect when using VHM

Reported by: nateaune Owned by:
Priority: minor Milestone: 2.1
Component: Templates/CSS Version:
Keywords: Cc:


When I use Virtual Host Monster (VHM) to create a subsite within Plone (i.e. winnie.jazkarta.com), the link that gets created for the "Skip to content" appears to be incorrect.

If I use Lynx to go to  http://winnie.jazkarta.com and select the "Skip to content" link, I get this error:

AttributeError: VirtualHostBase

This is from the HTML source:

<a class="hiddenStructure"

href=" http://winnie.jazkarta.com/VirtualHostBase/http/winnie.jazkarta.com:80/search#documentContent">Skip to content</a>

This is from lines 50-52 in skins/plone_templates/main_template.pt:

<a class="hiddenStructure"

tal:attributes="href string:${current_page_url}#documentContent" i18n:translate="label_skiptocontent">Skip to content</a>

This is from skins/plone_templates/global_defines.pt:

current_page_url request/VIRTUAL_URL|string:${request/SERVER_URL}${request/PATH_TRANSLATED};

Change History

comment:1 Changed 12 years ago by limi

If you are running a later version of Zope, you could try substituting the definition with 'request/ACTUAL_URL' instead of the long definition with three fallbacks. ACTUAL_URL was introduced to fix this use case - please report back if it solved your problem.

comment:2 Changed 12 years ago by limi

Zope 2.7.4 is the first version with ACTUAL_URL support, btw.

comment:3 Changed 12 years ago by nateaune

I tried replacing the code in main_template.pt with::

<a class="hiddenStructure"

tal:attributes="href string:${request/ACTUAL_URL}#documentContent" i18n:translate="label_skiptocontent">Skip to content</a>

But it gave a KeyError. Then I saw your followup that Zope 2.7.4 is required for support of ACTUAL_URL. Unfortunately, I am still running 2.7.3 so I haven't been able to verify that this indeed solves the problem.

comment:4 Changed 11 years ago by neaj

Patch to remove 'current_page_url' -- use ACTUAL_URL instead.

diff --exclude='*.pyc' --exclude='*~' --exclude='*.sw?' -ru old/CMFPlone/HISTORY.txt Products/CMFPlone/HISTORY.txt --- old/CMFPlone/HISTORY.txt 2005-04-08 13:51:55.000000000 +0200 +++ Products/CMFPlone/HISTORY.txt 2005-04-08 14:40:18.000000000 +0200 @@ -169,6 +169,10 @@

mixin. [tiran]

+ - Issue #3714: Removed the 'current_page_url' variable: obsoleted by + 'ACTUAL_URL'. + [neaj] +

Alpha1 - Released March 12, 2005

  • No longer uncatalog the Members folder on installation so that the new

diff --exclude='*.pyc' --exclude='*~' --exclude='*.sw?' -ru old/CMFPlone/skins/plone_templates/global_defines.pt Products/CMFPlone/skins/plone_templates/global_defines.pt --- old/CMFPlone/skins/plone_templates/global_defines.pt 2005-04-08 13:51:06.000000000 +0200 +++ Products/CMFPlone/skins/plone_templates/global_defines.pt 2005-04-08 14:40:18.000000000 +0200 @@ -44,7 +44,6 @@

global default_language site_properties/default_language|nothing; global language python:here.Language() or default_language; global is_editable python: checkPermission('Modify portal content', context);

  • global current_page_url request/VIRTUAL_URL|string:${request/SERVER_URL}${request/PATH_TRANSLATED};

global lockable python:hasattr(here.aq_inner.aq_explicit, 'wl_isLocked'); global isLocked python:lockable and here.wl_isLocked(); global isRTL python:here.isRightToLeft(domain='plone');

diff --exclude='*.pyc' --exclude='*~' --exclude='*.sw?' -ru old/CMFPlone/skins/plone_templates/main_template.pt Products/CMFPlone/skins/plone_templates/main_template.pt --- old/CMFPlone/skins/plone_templates/main_template.pt 2005-04-08 13:51:06.000000000 +0200 +++ Products/CMFPlone/skins/plone_templates/main_template.pt 2005-04-08 14:40:18.000000000 +0200 @@ -49,7 +49,7 @@

<div id="portal-header">

<a class="hiddenStructure"

  • tal:attributes="href string:${current_page_url}#documentContent"

+ tal:attributes="href string:${request/ACTUAL_URL}#documentContent"

i18n:translate="label_skiptocontent">Skip to content</a>

<div metal:use-macro="here/global_siteactions/macros/site_actions">

comment:5 Changed 11 years ago by shh

Change to bug+patch

comment:6 Changed 11 years ago by Anonymous User

comment:7 Changed 11 years ago by DannyB

  • Status changed from new to closed
  • Resolution set to fixed


comment:8 Changed 7 years ago by hannosch

  • Component changed from Visual and templates to Templates/CSS
Note: See TracTickets for help on using tickets.