Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Eyad Arafat
    @bluegrounds
    Hey,
    I'm asking about a djangocms_blog issue but I couldn't find a room for it, and my search on the Issues section on Github got me nothing, so here I am. I hope that that's okay.
    Anyway, I wanna know if there's an option or a permission that can set so that users can only edit the articles they themselves created. If there isn't any, how difficult would that be to implement my self using a custom DjangoCMS permission?
    Iacopo Spalletti
    @yakky
    @bluegrounds that's the perfect room for it
    that feature it's currently not implemented and django CMS permissions wouldn't help with it
    In general Django permission system works at a model level, not at a instance one
    By overriding the admin class, though, you can filter the queryset and implement an additional check on the relevant views before calling the super
    Eyad Arafat
    @bluegrounds
    And that would still enable a super user that has control over everything, right?
    Iacopo Spalletti
    @yakky
    blocking the content edit on the frontend side might be more complex, as currently there is no "easy" hook in the cms frontend editor for this

    @bluegrounds

    And that would still enable a super user that has control over everything, right?
    it's up to you at that point. You can enforce the same limits to the superuser, as you wouldn't use the Django permission, but you would check explicitly the "author" field on the blog

    Eyad Arafat
    @bluegrounds
    I see
    Well, thanks a lot man. I'll see if I up to that task :)
    Iacopo Spalletti
    @yakky
    this is actually something interesting for the project, thus if you're up to, you can share the code here and I will try to help you
    Eyad Arafat
    @bluegrounds
    Oh, now it's exciting. I'll keep you posted.
    Abu Yusuf
    @Revel109
    I want to add meta keywords in every page from admin.....
    Iacopo Spalletti
    @yakky
    Hi @Revel109 have you tried djangocms-page-meta ?
    Chris Kang
    @chris542
    Whenever I install with the djangocms-installer, html5lib is not up to date. It seems like there is a PR on github, but I dont think it's merged into the released version. Is this going to happen anytime soon? It's pretty annoying to change that to 1.0.1 every single time I create a project :(
    Iacopo Spalletti
    @yakky
    @chris542 Thanks for reporting. I think version 1.0.2 will be released in the next few hours to address this
    Pcoder
    @pcoder

    Hi, we are using the following setup

    djangocms-blog==0.9.0
    django-parler==1.6.3
    Django==1.9.4

    and have multiple language support. Recently, we have noted that the different language tabs for publication of blog articles are no more visible. This is causing all our articles to be be published in the primary language only and there is no option to change the language. I am suspecting the following bug nephila/djangocms-blog#307
    Any ideas? Thanks in advance

    Ian Carpenter
    @Sazpaimon
    Is there a guide on migrating regular CMS pages to blog pages?
    Iacopo Spalletti
    @yakky
    @Sazpaimon hi, unfortunately not
    Depending on what you want to achieve it's not too complicated, though
    By using cms.utils.copy_plugins.copy_plugins_to https://github.com/divio/django-cms/blob/develop/cms/utils/copy_plugins.py you can copy plugins from any Django cms page to a post
    And you can iterate on published pages using. Page.objects.publisher(). public () to iterate over the Django cms pages and create blog posts out if them
    Ian Carpenter
    @Sazpaimon
    Cool, I'll look into it. Our current pages are big mess of placeholders that aren't really compatible with blog's way of doing things
    image.png
    for example, this all our plugins for our news pages right now ^
    I assume these would all need to be rolled up into Post_Content
    Ian Carpenter
    @Sazpaimon
    If there's a way to retain these placeholders, though, I'd like to know. We use them for styling purposes in our templates
    Iacopo Spalletti
    @yakky
    Blog posts currently provide only one placeholder, mostly because posts are usually meant to have a more uniform layout than pages
    And for many parts of the layout you can use information in the structured parts of the post (title image etc)
    You ca still have different layouts but you have to create plugins which will wrap the other plugins in s custom template recreate the different page parts
    But it really depends on the layout your want to achieve
    Ian Carpenter
    @Sazpaimon
    Most of those placeholders were to hold various images associated with a post
    for example. having a different image for the page header, and different thumbnail variants for different views, such as having a vertically oriented thumbnail
    but it looks like Page only provides one such image in its editor
    Ian Carpenter
    @Sazpaimon
    hmm, is there actually any way to extend Page to support an arbitrary amount images in its metadata? I'm looking around and there doesn't seem to be any way to use a custom Page model, or customize PageAdmin either. Is there some other way to do this?
    the way I did it on normal cms pages was just via placeholders that I put in a hidden element in the template file, which the frontend picks up to populate the front page
    Ian Carpenter
    @Sazpaimon
    it'd be nice that in the blog page edit view, under the images section, you could add images of various different "flavors". I wonder if this is something that'd be useful for others as well
    Iacopo Spalletti
    @yakky
    For Django cms pages you can create page extension
    For blog post there is no API ready but I guess it wouldn't be too complex to add external models with a foreign key to a filer image and one to a blog post
    We've done something like that internally for the picture plugin but we have had no time/ use case for the blog posts
    Iacopo Spalletti
    @yakky
    This is a thing that might fit in the blog itself. Not sure I have the bandwidth to handle it in the short term
    Ian Carpenter
    @Sazpaimon
    Yeah that's what I'm trying to do. I'd like to get it to show in the PostAdmin, though
    what would be cool is if there was a way to subclass Post to add additional fields, as well as subclassing PostAdmin.
    what I typically see libraries do is have a setting to change what the concreate models are for that library, so there could be a BLOG_POST_MODEL setting
    Ian Carpenter
    @Sazpaimon
    well i guess this works:
    class BlogPostImages(models.Model):
        post = models.ForeignKey(djangocms_blog.models.Post, related_name='images')
        image = FilerImageField(blank=True, null=True, on_delete=models.SET_NULL)
        image_type = models.CharField(max_length=255)
    
    class ImageInline(admin.TabularInline):
        model = BlogPostImages
    
    
    class CustomPostAdmin(PostAdmin):
        inlines = [
            ImageInline,
        ]
    
    
    admin.site.unregister(Post)
    admin.site.register(Post, CustomPostAdmin)
    Iacopo Spalletti
    @yakky
    I am on the mobile right now, but it wouldn't be too hard to get that. I will try to post some details in the weekend
    Iacopo Spalletti
    @yakky
    Sorry I missed the code example you posted. Yes something.like that will work. Post model is just a plain Django model, and the normal Django patterns can be applied
    Ian Carpenter
    @Sazpaimon
    Is it possible to make changes to a published blog post and publish those changes separately? Like, if a post needs an update, but the updates needs to go through an editor, first
    Iacopo Spalletti
    @yakky
    @Sazpaimon not currently. It's a feature I've been pondering on for a long time, but I haven't managed to find a sensible solution
    I'm interested in hearing suggestions and ideas for implementation