Django CMS 2.2.x Documentationwith a “world” slug will have a “/world” url, even it is a child of the “hello” page. If disabled the page would have the url: “/hello/world/” CMS_SOFTROOT Default: False This adds a new “softroot” field to ugettext_lazy as _ class HelloPlugin(CMSPluginBase): model = CMSPlugin name = _("Hello Plugin") render_template = "hello_plugin.html" def render(self, context, instance, placeholder): return context plugin_pool adding the template. Add the following into the root template directory in a file called hello_plugin.html:Hello {% if request.user.is_authenticated %}{{ request.user.first_name }} {{ request.user.last
0 码力 | 76 页 | 627.98 KB | 6 月前3
django cms 2.2.x Documentationwith a “world” slug will have a “/world” url, even it is a child of the “hello” page. If disabled the page would have the url: “/hello/world/” 5.6.5. CMS_SOFTROOT Default: False This adds a new “softroot” ugettext_lazy as _ class HelloPlugin(CMSPluginBase): model = CMSPlugin name = _("Hello Plugin") render_template = "hello_plugin.html" def render(self, context, instance, placeholder): return adding the template. Add the following into the root template directory in a file called hello_plugin.html:Hello {% if request.user.is_authenticated %}{{ request.user.first_name }} {{ request.user.last_name}}{%
0 码力 | 105 页 | 679.29 KB | 1 年前3
Django CMS 2.3.x Documentationwith a “world” slug will have a “/world” url, even it is a child of the “hello” page. If disabled the page would have the url: “/hello/world/” CMS_SOFTROOT Default: False This adds a new “softroot” field to ugettext_lazy as _ class HelloPlugin(CMSPluginBase): model = CMSPlugin name = _("Hello Plugin") render_template = "hello_plugin.html" def render(self, context, instance, placeholder): return context plugin_pool add the template. Add the following into the root template directory in a file called hello_plugin.html:Hello {% if request.user.is_authenticated %}{{ request.user.first_name }} {{ request.user.last
0 码力 | 92 页 | 666.41 KB | 6 月前3
Django CMS 2.4.x Documentationimport ugettext_lazy as _ class HelloPlugin(CMSPluginBase): model = CMSPlugin render_template = "hello_plugin.html" plugin_pool.register_plugin(HelloPlugin) Now we’re almost done. All that’s left is to add the template. Add the following into the root template directory in a file called hello_plugin.html:Hello {% if request.user.is_authenticated %}{{ request.user.first_name }} {{ request.user.last add the following: from cms.models.pluginmodel import CMSPlugin from django.db import models class Hello(CMSPlugin): guest_name = models.CharField(max_length=50, default='Guest') If you followed the Django
0 码力 | 104 页 | 709.98 KB | 6 月前3
Django CMS 2.4.x Documentationugettext_lazy as _ class HelloPlugin(CMSPluginBase): model = CMSPlugin render_template = "hello_plugin.html" plugin_pool.register_plugin(HelloPlugin) Now we’re almost done. All that’s left is add the template. Add the following into the root template directory in a file called hello_plugin.html:Hello {% if request.user.is_authenticated %}{{ request.user.first_name }} {{ request.user.last_name}}{% the following: from cms.models.pluginmodel import CMSPlugin from django.db import models class Hello(CMSPlugin): guest_name = models.CharField(max_length=50, default='Guest') If you followed the
0 码力 | 156 页 | 727.78 KB | 6 月前3
Django CMS 3.0.x Documentationimport ugettext_lazy as _ class HelloPlugin(CMSPluginBase): model = CMSPlugin render_template = "hello_plugin.html" 5.2. How-to guides 31 django cms Documentation, Release 3.0.19.dev1 plugin_pool.reg add the template. Add the following into the root template directory in a file called hello_plugin.html:Hello {% if request.user.is_authenticated %}{{ request.user.first_name }} {{ request.user.last import models 32 Chapter 5. Table of contents django cms Documentation, Release 3.0.19.dev1 class Hello(CMSPlugin): guest_name = models.CharField(max_length=50, default='Guest') If you followed the Django
0 码力 | 180 页 | 1.56 MB | 6 月前3
django cms 3.1.x DocumentationCMSPlugin 5.2. How-to guides 39 django cms Documentation, Release 3.1.8.dev1 render_template = "hello_plugin.html" cache = False plugin_pool.register_plugin(HelloPlugin) Now we’re almost done. All that’s add the template. Add the following into the root template directory in a file called hello_plugin.html:Hello {% if request.user.is_authenticated %}{{ request.user.first_name }} {{ request.user.last_name}}{% the following: from cms.models.pluginmodel import CMSPlugin from django.db import models class Hello(CMSPlugin): guest_name = models.CharField(max_length=50, default='Guest') If you followed the Django
0 码力 | 200 页 | 1.63 MB | 1 年前3
Django CMS 2.1.x Documentationwith a “world” slug will have a “/world” url, even it is a child of the “hello” page. If disabled the page would have the url: “/hello/world/” CMS_SOFTROOT Default: False This adds a new “softroot” field to page'), "/bye/", 2) n3 = NavigationNode(_('sample account page'), "/hello/", 3) n4 = NavigationNode(_('sample my profile page'), "/hello/world/", 4, 3) nodes.append(n) nodes.append(n2) nodes.append(n3) nodes page'), "/bye/", 2) n3 = NavigationNode(_('sample account page'), "/hello/", 3) n4 = NavigationNode(_('sample my profile page'), "/hello/world/", 4, 3) nodes.append(n) 3.3. App Integration 43 django cms0 码力 | 63 页 | 485.38 KB | 6 月前3
Django CMS 3.11.10 Documentationleft is to add the template. Add the following into the root template directory in a file called hello_plugin.html: This plugin will now greet the users on your website either by their name if they’re class HelloPlugin(CMSPluginBase): model = CMSPlugin render_template = "hello_plugin.html" cache = FalseHello {% if request.user.is_authenticated %}{{ request.user.first_name }} {{ request new cms_plugins.py looks like this: We changed the model attribute to point to our newly created Hello model and pass the model instance to the context. As a last step, we have to update our template to
0 码力 | 493 页 | 1.44 MB | 6 月前0.03
Django CMS 2.1.x Documentationwith a “world” slug will have a “/world” url, even it is a child of the “hello” page. If disabled the page would have the url: “/hello/world/” 4.5.5. CMS_SOFTROOT Default: False This adds a new “softroot” "/bye/", 2) n3 = NavigationNode(_('sample account page'), "/hello/", 3) n4 = NavigationNode(_('sample my profile page'), "/hello/world/", 4, 3) nodes.append(n) nodes.append(n2) "/bye/", 2) n3 = NavigationNode(_('sample account page'), "/hello/", 3) n4 = NavigationNode(_('sample my profile page'), "/hello/world/", 4, 3) nodes.append(n) nodes.append(n2)0 码力 | 81 页 | 554.09 KB | 6 月前3
共 54 条
- 1
- 2
- 3
- 4
- 5
- 6













