django-cms

Django-cms haystack search - placeholder content

不想你离开。 提交于 2019-12-11 16:39:18
问题 i have problem with results in django-cms and haystack search. I'm using django-cms-search plugin, haystack as backend. Haystack returns correct results. But i want to show "teaser" in search results. I can access absolute URL and title of page via template this way: {% for result in page.object_list %} <div class="searchResults"> <h2>{{ result.object.get_title }}</h2> {{ result.object.placeholders.all }} <p><a href="{{ result.object.get_absolute_url }}">{% blocktrans %} Read more {%

django cms plugin instance related_set returns empty list

一曲冷凌霜 提交于 2019-12-11 14:32:27
问题 I have the following models class NewSlide(models.Model): slider = models.ForeignKey('NewSliderPlugin') title = models.CharField(max_length=255) content = models.TextField(max_length=80, null=True) link = models.CharField(max_length=255) image = models.ImageField(upload_to='slides', null=True) visible = models.BooleanField(default=False) def __unicode__(self): # Python 3: def __str__(self): return self.title class NewSliderPlugin(CMSPlugin): title = models.CharField(max_length=255) template =

How to deal with DjangoCMS i18n URLs (/en/my_page, /fr/my_page…) and AngularJS?

六眼飞鱼酱① 提交于 2019-12-11 12:12:07
问题 I'm trying to learn AngularJS and DjangoCMS so I created a new project using them together. Status By default, DjangoCMS uses the first URL segment to determine the language of the site (/en/, /fr/). Every URL that doesn't contain a language segment will get redirected to /en/ by default. That means, all my AngularJS ajax calls need to be addressed to either /en/api/ or /fr/api/. Questions I'd like to use this first segment to determine the language in Angular for internationalization. And

Performance of django-CMS with remote mysql DB

两盒软妹~` 提交于 2019-12-11 08:23:51
问题 I have tried to run a django-CMS (+filer +easy_thumbnails) with a remote mysql DB on GoogleAppengine, with cloudstorage. After fixing file-system related performance problems and fork-fixing a django-google-cloud-storage module (http://github.com/locandy/django-google-cloud-storage), the performance is still beyond terrible (4s per request pre cache). Most things are configured as default from the tutorial. Timing is for generic page rendering requests (no cache, not logged in, excluding

reuse same django cms plugin instance

北战南征 提交于 2019-12-11 07:58:48
问题 Lets say I have created a facebook like box plugin in django cms, it allows the user to put in page urls and other configuration to display the facebook like box. Now the user wants to display the same like box across multiple pages, is it possible to reuse the same plugin instance without creating the plugins on every page? class FacebookLikeBox(CMSPlugin): page_url = models.URLField() app_id = models.CharField(max_length=25) width = models.CharField(max_length=25) height = models.CharField

Detect last plugin in a placeholder

岁酱吖の 提交于 2019-12-11 07:41:14
问题 Is there a way to detect the last (or first) plugin that has been placed inside a placeholder? I want to add a class="last" to my plugin template in case of the last plugin. 回答1: Give this a try: {% if plugin.last %} This is the last plugin for current placeholder {% endif %} (plugin.first should also work) 来源: https://stackoverflow.com/questions/5543947/detect-last-plugin-in-a-placeholder

“render_placeholder” not showing up in djangoCMS template

笑着哭i 提交于 2019-12-11 07:34:51
问题 I have followed the instructions on the following site in order to render a placeholder field from a model, but I didn't manage. http://docs.django-cms.org/en/release-3.4.x/how_to/placeholders.html This is my model. from django.db import models import uuid from django.utils import timezone from cms.models.fields import PlaceholderField class HomePage(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False, unique=True) my_placeholder = PlaceholderField(

Render Django-CMS plugins differently on different splaceholders/templates

六眼飞鱼酱① 提交于 2019-12-11 04:39:34
问题 Short version: I'd like to have the same kind of cmsplugin use different templates in different placeholders. Is this possible? Or, should I go and make my custom plugin? Long version: Using Django and Django-CMS and using the cmsplugin-video-youtube plugin, I have two youtube videos on the home page and they are styled using Foundation 4's grid system to be stacked one and then another below it and at a certain 'breaking point' of the browser's width, they will be side-by-side. This is all

Updating indexes on placeholderfields in real time with django/haystack/solr

徘徊边缘 提交于 2019-12-11 03:57:32
问题 Hello I am integrating searches on my django-cms project. I have made a wiki app, where the content of each page is stored in a PlaceholderField . I can initially index the content of the PlaceholderField with the sudo ./manage.py rebuild_index or update_index , and the search works perfectly. The issue is when I modify the PlaceholderField , the search indexes are not updating, even though I have in my settings.py: HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' Here

How to translate the application name in Django CMS Admin?

本秂侑毒 提交于 2019-12-11 02:44:29
问题 How can I translate the application name in the Django CMS admin? See the screenshot: 回答1: The answer below was correct for Django 1.4 or 1.5, I believe. For more modern answer, see https://stackoverflow.com/a/32431808/1067717 Have a look at this previously asked question on the similar topic for internationalization in Django. Internally, it uses Model._meta.app_label to display the application name. Inspect admin view and its template for further information. 回答2: OK. I have found how to