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

page.link object not taking into account SITE_PREFIX when rendered in menus #1898

Open
PBibiloni opened this issue Oct 20, 2018 · 1 comment
Labels

Comments

@PBibiloni
Copy link

PBibiloni commented Oct 20, 2018

Hi,

When the get_absolute_url() method is executed on (rich text) pages, it automatically adds the SITE_PREFIX if any. However, the behaviour for links is different and does not take it into account. I think that mezzanine.pages.models should read (only excerpt of interest):

        if self.content_model == "link":
            # My addition is next two lines:
            if settings.SITE_PREFIX:
                slug = settings.SITE_PREFIX + '/' + slug
            # Ensure the URL is absolute.
            slug = urljoin('/' , slug)
            return slug

I've never contributed to a project (so I'm not sure if a pull request or something else is needed), but if there's something I can do to ease your work just drop me a line.

Pedro.

@stephenmcd
Copy link
Owner

Hi, thanks for this it makes sense - a pull request would be great if you can do that.

@jerivas jerivas added the bug label Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants