SlideShare a Scribd company logo
an introduction
about myself



  •Name: Patrick Lauber
  •Place: Zürich, Switzerland
  •Age: 29
  •Profession: CTO of tigermedia.ch
  •Nick: digi604
history



  •         .ch

   •django-cms 1.0 (django 0.96) menu,
    performance

   •django-page-cms (django 1.0, mptt,
    placeholders)

    •django-cms 2.0 (plugins)
    •django-cms 2.1 (menus, placeholder 2.0,
      frontedit)
the parts



   • pages
   • plugins
   • menu
   • frontedit
   • permissions
   • publisher
   • i18n-urls
pages

 •title
 •drag&drop
 •mptt
 •published?
 •in menu?
 •meta info
 •template
plugins

 •your content
 •mix it
 •placeholders
 •reorder
 •drag & drop
 •copy / paste
plugins



              {% load cms_tags %}

           {% placeholder header %}

          {% placeholder leftcolumn %}

           {% placeholder content %}

            {% placeholder footer %}
plugins



           already built in:

            text, picture,
              link, file,
          flash, googlemap,
               inherit,
           snippet, teaser
            twitter, video
plugins




                 get more at:

          www.django-cms.org/extensions
menu

 •Construct any menu the
  design requires with two
   template tags

 •breadcrumbs
 •menus package
menu




          {% load menu_tags %}

       {% show_menu 0 100 0 100 %}


                                 • From Level
                                 • To Level
                                 • Inactive Levels
                                 • Active Levels
menu




                 {% load menu_tags %}

            {% show_menu 0 100 0 100 %}


                                        • From Level
• Current Page                          • To Level
• Root Nodes &                          • Inactive Levels
 Siblings                               • Active Levels
menu




                 {% load menu_tags %}

            {% show_menu 0 100 0 100 %}


                                        • From Level
• Current Page                          • To Level
• Root Nodes &                          • Inactive Levels
 Siblings                               • Active Levels
menu




                 {% load menu_tags %}

            {% show_menu 0 100 0 100 %}


                                        • From Level
• Current Page                          • To Level
• Root Nodes &                          • Inactive Levels
 Siblings                               • Active Levels
menu




                 {% load menu_tags %}

            {% show_menu 0 100 0 100 %}


                                        • From Level
• Current Page                          • To Level
• Root Nodes &                          • Inactive Levels
 Siblings                               • Active Levels
menu




                 {% load menu_tags %}

            {% show_menu 0 100 1 100 %}


                                        • From Level
• Current Page                          • To Level
• Root Nodes &                          • Inactive Levels
 Siblings                               • Active Levels
menu




                 {% load menu_tags %}

            {% show_menu 0 100 1 100 %}


                                        • From Level
• Current Page                          • To Level
• Root Nodes &                          • Inactive Levels
 Siblings                               • Active Levels
menu




                 {% load menu_tags %}

            {% show_menu 1 100 1 100 %}


                                        • From Level
• Current Page                          • To Level
• Root Nodes &                          • Inactive Levels
 Siblings                               • Active Levels
menu




                 {% load menu_tags %}

            {% show_menu 1 100 1 100 %}


                                        • From Level
• Current Page                          • To Level
• Root Nodes &                          • Inactive Levels
 Siblings                               • Active Levels
menu




                 {% load menu_tags %}

    {% show_menu 1 100 1 100 "my_menu.html" %}


                                        • From Level
• Current Page                          • To Level
• Root Nodes &                          • Inactive Levels
 Siblings                               • Active Levels
menu




            {% load menu_tags %}

   {% show_sub_menu 100 "my_menu.html" %}
menu




             {% load menu_tags %}

   {% show_breadcrumb 0 "my_breadcrumb" %}
frontedit

 • Edit Plugins directly in
   frontend

 • Add “?edit” to url to
   enable

 • Customers love it
permissions

 •create users with inherited
  permissions

 •allow / disallow: moving,
  editing, adding,
   advanced settings, sites,
   moderation
publisher

 •Moderate content changes
 •get notified
 • content onlydeleted if
   published /
                gets

   approved
i18n-urls

 • Language prefix
   /de/your_url/

 • middleware based
 • no changesurls, apps your
   templates,
              needed to
integrating it

  • How your own project.
    into
         to integrate the cms



  • It’s just an app.
  1. Menus

  2. Attach Menus

  3. Navigation Modifiers

  4. App-hooks

  5. Custom Plugins

  6. Placeholders
menus

 • Addmenu own entries to
   the
       your



 • yourapp/menu.py
 • entries will be attached to
   the root.
menus – menu.py


    from menus.base import Menu, NavigationNode
	   from menus.menu_pool import menu_pool
	   from django.utils.translation import ugettext_lazy as _
	
	   class MyMenu(Menu):
	
	       def get_nodes(self, request):
	           nodes = []
	           n = NavigationNode(_("login"), reverse("auth_login"), 1)
	           n2 = NavigationNode(_("admin"), reverse("admin:root"), 2)
	           n3 = NavigationNode(_("My list"), "/mylist/", 3)
	           n4 = NavigationNode(_("My sublist"), "/mylist/sublist/", 4, 3)
	           nodes.append(n)
	           nodes.append(n2)
	           nodes.append(n3)
	           nodes.append(n4)
	           return nodes
	
	   menu_pool.register_menu(MyMenu)
attach menus

 • Inherits from instead of
   CMSAttachMenu
   Menu

 • Selectadvanced settings to
   page
          your menu in the

   attach.

 • Needs a name
attach menus – menu.py


    from   menus.base import Menu, NavigationNode
	   from   menus.menu_pool import menu_pool
	   from   django.utils.translation import ugettext_lazy as _
	   from   cms.menu_bases import CMSAttachMenu

	   class MyMenu(CMSAttachMenu):
	
	       name = _("My Menu")

	          def get_nodes(self, request):
	              nodes = []
	              n = NavigationNode(_("login"), reverse("auth_login"), 1)
	              n2 = NavigationNode(_("admin"), reverse("admin:root"), 2)
	              n3 = NavigationNode(_("My list"), "/mylist/", 3)
	              n4 = NavigationNode(_("My sublist"), "/mylist/sublist/", 4, 3)
	              nodes.append(n)
	              nodes.append(n2)
	              nodes.append(n3)
	              nodes.append(n4)
	              return nodes
	
	   menu_pool.register_menu(MyMenu)
menu modifiers

 • modify the whole menu
   tree

 • add or change properties
   of NavigationNodes

 • rearrange trees
 • applied in 3 situations:
   • pre cut
   • post cut
   • breadcrumb
menu modifiers


    from menus.base import Modifier
	   from menus.menu_pool import menu_pool

	   class MyModifier(Modifier):
	   	 """
	   	 Counts the nodes
	   	 """
	   	 def modify(self, request, nodes, namespace, root_id, post_cut, breadcrumb):
	   	 	 if post_cut or breadcrumb:
	   	 	 	 return nodes
	   	 	 count = 0
	       	 for node in nodes:
	   	 	 	 node.counter = count
	   	 	 	 count += 1
	   	 	 return nodes

	   menu_pool.register_modifier(MyModifier)
app-hooks

 • attach whole apps to a
   page.

 • myapp/cms_app.py
 • urls.py gets attached to a
   page url

 • needs server restart after
   changes :(
app-hooks – cms_app.py


    from   cms.app_base import CMSApp
	   from   cms.apphook_pool import apphook_pool
	   from   django.utils.translation import ugettext_lazy as _
	   from   myapp.menu import MyMenu

	   class MyApphook(CMSApp):
	       name = _("My App")
	       urls = ["myapp.urls"]
	
	   apphook_pool.register(MyApphook)
app-hooks – urls.py


    from django.conf.urls.defaults import *

	   urlpatterns = patterns("myapp.views",
	       url(r"^$', "main_view", name="app_main"),
	       url(r"^sublevel/$", "sample_view", name="app_sublevel"),
	   )	




• Page URL: /mypage/
• /mypage/ will be handled by main_view
• /mypage/sublevel/ will be handled by sample_view
• plugins from page are available in app templates
app-hooks
 • If page has german url as well:
   /meine_seite/

 • app is available at:
   /en/mypage/
   /de/meine_seite/

 • reverse("main_view") or {% url main_view
   %}will choose current language

 • to choose manually:
   • reverse("de:main_view")
   • reverse("en:main_view")
   • {% url de:main_view %}
app-hooks – cms_app.py


    from myapp.menu import CategoryMenu
	
	   class MyApphook(CMSApp):
	       name = _("My App")
	       urls = ["myapp.urls"]
	       menus = [CategoryMenu]
	
	   apphook_pool.register(MyApphook)




• If your app has a menu, attach it as well
• reverse in menu gets the language namespace as well
app-hooks – models.py


    from django.db import models
	   from django.core.urlresolvers import reverse
	   import mptt

	   class Category(models.Model):
	   	 parent = models.ForeignKey("self", blank=True, null=True)
	   	 name = models.CharField(max_length=20)

	   	   def __unicode__(self):
	   	   	 return self.name

	   	   def get_absolute_url(self):
	   	   	 return reverse("category_view", args=[self.pk])

	   try:
	   	 mptt.register(Category)
	   except mptt.AlreadyRegistered:
	   	 pass
app-hooks – menu.py


    from   menus.base import NavigationNode
	   from   menus.menu_pool import menu_pool
	   from   django.utils.translation import ugettext_lazy as _
	   from   cms.menu_bases import CMSAttachMenu
	   from   myapp.models import Category
	
	   class CategoryMenu(CMSAttachMenu):
	
	   	   name = _("My Category Menu")
	
	   	   def get_nodes(self, request):
	   	   	 nodes = []
	   	   	 for category in Category.objects.all().order_by("tree_id", "lft"):
	   	   	 	 nodes.append(
	   	   	 	 	 NavigationNode(
	   	   	 	 	 	 category.name,
	   	   	 	 	 	 category.pk,
	   	   	 	 	 	 category.parent_id
	   	   	 	 	 )
	   	   	 	 )
	   	   	 return nodes
	
	   menu_pool.register_menu(CategoryMenu)
custom plugins

 •your data as a plugin
 •teasers for your app data
 •yourapp/cms_plugins.py
 • model inherits from
   CMSPlugin
custom plugins – models.py

  	
  class Gallery(models.Model):
  	 name = models.CharField(max_length=30)
  	
  class Picture(models.Model):
  	 gallery = models.ForeignKey(Gallery)
  	 image = models.ImageField(upload_to="uploads/images/")
  	 description = models.CharField(max_length=60)
custom plugins – models.py


  from cms.models import CMSPlugin
  	
  class GalleryPlugin(CMSPlugin):
  	 gallery = models.ForeignKey(Gallery)
custom plugins – cms_plugins.py


  from cms.plugin_base import CMSPluginBase
  from cms.plugin_pool import plugin_pool
  from models import GalleryPlugin
  from django.utils.translation import ugettext as _
  	
  class CMSGalleryPlugin(CMSPluginBase):
  	 model = GalleryPlugin
  	 name = _("Gallery")
  	 render_template = "cms/plugins/gallery.html"
  	
  	 def render(self, context, instance, placeholder):
  	 	 context.update({
  	 	 	 "gallery":instance.gallery,
  	 	 	 "object":instance,
  	 	 	 "placeholder":placeholder
  	 	 })
  	 	 return context

  plugin_pool.register_plugin(CMSGalleryPlugin)
custom plugins

 • CMSPluginBase extends
   from ModelAdmin

 • text enabled plugins
 • plugins are a tree (mptt)
 • plugin media
 • plugin rules in your
   settings.py

 • Plugin Context Processors
   (add Context to render)

 • Plugin Processors (Modify
   output of plugins)
placeholders

 • use the plugin system in
   your own apps.

 • works with frontedit :)
placeholders - models.py

  	 	
  from django.db import models
  from cms.models.fields import PlaceholderField
  	
  class MyBlog(models.Model):
  	 title = models.CharField(max_length=100)
  	 slug = models.SlugField(max_length=100)
  	 content = PlaceholderField("blog_content")
placeholders - admin.py


  from django.contrib import admin
  from cms.admin.placeholderadmin import PlaceholderAdmin
  from models import MyBlog

  class MyBlogAdmin(PlaceholderAdmin):
  	 prepopulated_fields = {"slug": ("title",)} #just for the slug field

  admin.site.register(MyBlog, MyBlogAdmin)
placeholders - template.html


  {% load placeholder_tags %}
  	
  {% render_placeholder myblog_instance.content %}
the future

 • 2.1 release
   • sprints → RC1?
 • 2.2
   • page extenders
   • more modularization
       • tree
       • permissions
       • publisher
       • frontedit
Thank you

   •Questions?




   •contact: digi@treepy.com
   •www.django-cms.org
   •http://github.com/digi604/django-cms-2.0/
   •#django-cms @ irc.freenode.net
   some pictures from: zazzle.com, thechive.com, google image search :)

More Related Content

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 

Recently uploaded (20)

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Django cms.key

  • 2. about myself •Name: Patrick Lauber •Place: Zürich, Switzerland •Age: 29 •Profession: CTO of tigermedia.ch •Nick: digi604
  • 3. history • .ch •django-cms 1.0 (django 0.96) menu, performance •django-page-cms (django 1.0, mptt, placeholders) •django-cms 2.0 (plugins) •django-cms 2.1 (menus, placeholder 2.0, frontedit)
  • 4. the parts • pages • plugins • menu • frontedit • permissions • publisher • i18n-urls
  • 5. pages •title •drag&drop •mptt •published? •in menu? •meta info •template
  • 6. plugins •your content •mix it •placeholders •reorder •drag & drop •copy / paste
  • 7. plugins {% load cms_tags %} {% placeholder header %} {% placeholder leftcolumn %} {% placeholder content %} {% placeholder footer %}
  • 8. plugins already built in: text, picture, link, file, flash, googlemap, inherit, snippet, teaser twitter, video
  • 9. plugins get more at: www.django-cms.org/extensions
  • 10. menu •Construct any menu the design requires with two template tags •breadcrumbs •menus package
  • 11. menu {% load menu_tags %} {% show_menu 0 100 0 100 %} • From Level • To Level • Inactive Levels • Active Levels
  • 12. menu {% load menu_tags %} {% show_menu 0 100 0 100 %} • From Level • Current Page • To Level • Root Nodes & • Inactive Levels Siblings • Active Levels
  • 13. menu {% load menu_tags %} {% show_menu 0 100 0 100 %} • From Level • Current Page • To Level • Root Nodes & • Inactive Levels Siblings • Active Levels
  • 14. menu {% load menu_tags %} {% show_menu 0 100 0 100 %} • From Level • Current Page • To Level • Root Nodes & • Inactive Levels Siblings • Active Levels
  • 15. menu {% load menu_tags %} {% show_menu 0 100 0 100 %} • From Level • Current Page • To Level • Root Nodes & • Inactive Levels Siblings • Active Levels
  • 16. menu {% load menu_tags %} {% show_menu 0 100 1 100 %} • From Level • Current Page • To Level • Root Nodes & • Inactive Levels Siblings • Active Levels
  • 17. menu {% load menu_tags %} {% show_menu 0 100 1 100 %} • From Level • Current Page • To Level • Root Nodes & • Inactive Levels Siblings • Active Levels
  • 18. menu {% load menu_tags %} {% show_menu 1 100 1 100 %} • From Level • Current Page • To Level • Root Nodes & • Inactive Levels Siblings • Active Levels
  • 19. menu {% load menu_tags %} {% show_menu 1 100 1 100 %} • From Level • Current Page • To Level • Root Nodes & • Inactive Levels Siblings • Active Levels
  • 20. menu {% load menu_tags %} {% show_menu 1 100 1 100 "my_menu.html" %} • From Level • Current Page • To Level • Root Nodes & • Inactive Levels Siblings • Active Levels
  • 21. menu {% load menu_tags %} {% show_sub_menu 100 "my_menu.html" %}
  • 22. menu {% load menu_tags %} {% show_breadcrumb 0 "my_breadcrumb" %}
  • 23. frontedit • Edit Plugins directly in frontend • Add “?edit” to url to enable • Customers love it
  • 24. permissions •create users with inherited permissions •allow / disallow: moving, editing, adding, advanced settings, sites, moderation
  • 25. publisher •Moderate content changes •get notified • content onlydeleted if published / gets approved
  • 26. i18n-urls • Language prefix /de/your_url/ • middleware based • no changesurls, apps your templates, needed to
  • 27. integrating it • How your own project. into to integrate the cms • It’s just an app. 1. Menus 2. Attach Menus 3. Navigation Modifiers 4. App-hooks 5. Custom Plugins 6. Placeholders
  • 28. menus • Addmenu own entries to the your • yourapp/menu.py • entries will be attached to the root.
  • 29. menus – menu.py from menus.base import Menu, NavigationNode from menus.menu_pool import menu_pool from django.utils.translation import ugettext_lazy as _ class MyMenu(Menu): def get_nodes(self, request): nodes = [] n = NavigationNode(_("login"), reverse("auth_login"), 1) n2 = NavigationNode(_("admin"), reverse("admin:root"), 2) n3 = NavigationNode(_("My list"), "/mylist/", 3) n4 = NavigationNode(_("My sublist"), "/mylist/sublist/", 4, 3) nodes.append(n) nodes.append(n2) nodes.append(n3) nodes.append(n4) return nodes menu_pool.register_menu(MyMenu)
  • 30. attach menus • Inherits from instead of CMSAttachMenu Menu • Selectadvanced settings to page your menu in the attach. • Needs a name
  • 31. attach menus – menu.py from menus.base import Menu, NavigationNode from menus.menu_pool import menu_pool from django.utils.translation import ugettext_lazy as _ from cms.menu_bases import CMSAttachMenu class MyMenu(CMSAttachMenu): name = _("My Menu") def get_nodes(self, request): nodes = [] n = NavigationNode(_("login"), reverse("auth_login"), 1) n2 = NavigationNode(_("admin"), reverse("admin:root"), 2) n3 = NavigationNode(_("My list"), "/mylist/", 3) n4 = NavigationNode(_("My sublist"), "/mylist/sublist/", 4, 3) nodes.append(n) nodes.append(n2) nodes.append(n3) nodes.append(n4) return nodes menu_pool.register_menu(MyMenu)
  • 32. menu modifiers • modify the whole menu tree • add or change properties of NavigationNodes • rearrange trees • applied in 3 situations: • pre cut • post cut • breadcrumb
  • 33. menu modifiers from menus.base import Modifier from menus.menu_pool import menu_pool class MyModifier(Modifier): """ Counts the nodes """ def modify(self, request, nodes, namespace, root_id, post_cut, breadcrumb): if post_cut or breadcrumb: return nodes count = 0 for node in nodes: node.counter = count count += 1 return nodes menu_pool.register_modifier(MyModifier)
  • 34. app-hooks • attach whole apps to a page. • myapp/cms_app.py • urls.py gets attached to a page url • needs server restart after changes :(
  • 35. app-hooks – cms_app.py from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from django.utils.translation import ugettext_lazy as _ from myapp.menu import MyMenu class MyApphook(CMSApp): name = _("My App") urls = ["myapp.urls"] apphook_pool.register(MyApphook)
  • 36. app-hooks – urls.py from django.conf.urls.defaults import * urlpatterns = patterns("myapp.views", url(r"^$', "main_view", name="app_main"), url(r"^sublevel/$", "sample_view", name="app_sublevel"), ) • Page URL: /mypage/ • /mypage/ will be handled by main_view • /mypage/sublevel/ will be handled by sample_view • plugins from page are available in app templates
  • 37. app-hooks • If page has german url as well: /meine_seite/ • app is available at: /en/mypage/ /de/meine_seite/ • reverse("main_view") or {% url main_view %}will choose current language • to choose manually: • reverse("de:main_view") • reverse("en:main_view") • {% url de:main_view %}
  • 38. app-hooks – cms_app.py from myapp.menu import CategoryMenu class MyApphook(CMSApp): name = _("My App") urls = ["myapp.urls"] menus = [CategoryMenu] apphook_pool.register(MyApphook) • If your app has a menu, attach it as well • reverse in menu gets the language namespace as well
  • 39. app-hooks – models.py from django.db import models from django.core.urlresolvers import reverse import mptt class Category(models.Model): parent = models.ForeignKey("self", blank=True, null=True) name = models.CharField(max_length=20) def __unicode__(self): return self.name def get_absolute_url(self): return reverse("category_view", args=[self.pk]) try: mptt.register(Category) except mptt.AlreadyRegistered: pass
  • 40. app-hooks – menu.py from menus.base import NavigationNode from menus.menu_pool import menu_pool from django.utils.translation import ugettext_lazy as _ from cms.menu_bases import CMSAttachMenu from myapp.models import Category class CategoryMenu(CMSAttachMenu): name = _("My Category Menu") def get_nodes(self, request): nodes = [] for category in Category.objects.all().order_by("tree_id", "lft"): nodes.append( NavigationNode( category.name, category.pk, category.parent_id ) ) return nodes menu_pool.register_menu(CategoryMenu)
  • 41. custom plugins •your data as a plugin •teasers for your app data •yourapp/cms_plugins.py • model inherits from CMSPlugin
  • 42. custom plugins – models.py class Gallery(models.Model): name = models.CharField(max_length=30) class Picture(models.Model): gallery = models.ForeignKey(Gallery) image = models.ImageField(upload_to="uploads/images/") description = models.CharField(max_length=60)
  • 43. custom plugins – models.py from cms.models import CMSPlugin class GalleryPlugin(CMSPlugin): gallery = models.ForeignKey(Gallery)
  • 44. custom plugins – cms_plugins.py from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from models import GalleryPlugin from django.utils.translation import ugettext as _ class CMSGalleryPlugin(CMSPluginBase): model = GalleryPlugin name = _("Gallery") render_template = "cms/plugins/gallery.html" def render(self, context, instance, placeholder): context.update({ "gallery":instance.gallery, "object":instance, "placeholder":placeholder }) return context plugin_pool.register_plugin(CMSGalleryPlugin)
  • 45. custom plugins • CMSPluginBase extends from ModelAdmin • text enabled plugins • plugins are a tree (mptt) • plugin media • plugin rules in your settings.py • Plugin Context Processors (add Context to render) • Plugin Processors (Modify output of plugins)
  • 46. placeholders • use the plugin system in your own apps. • works with frontedit :)
  • 47. placeholders - models.py from django.db import models from cms.models.fields import PlaceholderField class MyBlog(models.Model): title = models.CharField(max_length=100) slug = models.SlugField(max_length=100) content = PlaceholderField("blog_content")
  • 48. placeholders - admin.py from django.contrib import admin from cms.admin.placeholderadmin import PlaceholderAdmin from models import MyBlog class MyBlogAdmin(PlaceholderAdmin): prepopulated_fields = {"slug": ("title",)} #just for the slug field admin.site.register(MyBlog, MyBlogAdmin)
  • 49. placeholders - template.html {% load placeholder_tags %} {% render_placeholder myblog_instance.content %}
  • 50. the future • 2.1 release • sprints → RC1? • 2.2 • page extenders • more modularization • tree • permissions • publisher • frontedit
  • 51. Thank you •Questions? •contact: digi@treepy.com •www.django-cms.org •http://github.com/digi604/django-cms-2.0/ •#django-cms @ irc.freenode.net some pictures from: zazzle.com, thechive.com, google image search :)

Editor's Notes