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

Base title + base description #77

Open
xelaxela13 opened this issue Apr 16, 2018 · 3 comments
Open

Base title + base description #77

xelaxela13 opened this issue Apr 16, 2018 · 3 comments

Comments

@xelaxela13
Copy link

xelaxela13 commented Apr 16, 2018

class MetadataMixin(object):

    def get_meta_title(self, context=None):
        self.title = getattr(settings, 'META_BASE_TITLE', '') + ' ' + self.title
        return self.title

or

class Meta(object):
 
    def __init__(self, **kwargs):
       self.title = settings.META_BASE_TITLE + ' ' + str(self.title) \
            if getattr(settings, 'META_BASE_TITLE', False) else str(self.title)
        self.description = settings.META_BASE_DESCRIPTION + ' ' + str(self.description) \
            if getattr(settings, 'META_BASE_DESCRIPTION', False) else str(self.description)

BASE_TITLE may be site name or something else, for example

@yakky
Copy link
Member

yakky commented Apr 16, 2018

As this not fit all the use cases, it can be complex to add to the core.
You can easily implement this in your own classes / mixin
Anyway I will happily review patches that implement this, if there is enough consensus

@xelaxela13
Copy link
Author

Tell me please, in what a branch can I do a Pull request? In "develop" I can`t, fatal: unable to access

@yakky
Copy link
Member

yakky commented Apr 17, 2018

You have forked the repo, pushed the change in your fork and when you try to open a PR from your repo to this you get that error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants