Dan
Dan

Reputation: 978

Custom Template & Rapido Breaks URL Paths

Outline

I have a custom type (Dexterity) called "Gallery Profile", for this type I went into the ZMI (portal_skins/custom), created a new "Page Template" and wrote a custom template for my gallery. The gallery contains a bunch of lower down images and one main image of the owner of the gallery, like a News Item view but a gallery tacked on the bottom.

The customer wants this main image to be published to Facebook when someone hits 'Share' and some more specific info in the title when published.

Work carried out

Configured a Rapido script to write the 'og:image' meta data etc HTML that is required to get this to work (the default Plone stuff only publishes the sites logo unless you're viewing one Image type).

If I go to test the HTML coming out of Rapido via direct web address it works swimmingly. (site.com/@@rapido/og_share/block/og_share) - I'm on the slightly older version of Rapido hence the non-plural version of block.

The problem

If you go to my gallery page where we have applied the template, then check the HTML, all of the OG meta data is pointing to the template instead of the current page its on.

This effects queries too (if for example you're using a script to find out what images are within a folder) - it searches /my_template instead of site.com/a_folder/my_template_is_on

In the Rapido Python file I've tried things like:

context.content.absolute_url()
context.content.absolute_url_path()
context.request['URL']
context.request['VIRTUAL_URL']
context.request['ACTUAL_URL']

... and probably more as I've been at this a while.

If you're not on the custom template, it works.

To Reproduce

I've always had this problem with Rapido I just tend to work around it but in this particular situation I am stumped.

So in summary

Thank you for your time.

Upvotes: 0

Views: 84

Answers (0)

Related Questions