This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function application_setup() { | |
// Thumbnail sizes. Change as needed. | |
// NOTE: These only take affect on new uploaded images. | |
add_image_size('icon', 50, 50, true); | |
add_image_size('small', 150, 150, true); // small, 150px width, 150px height, crop: true | |
add_image_size('medium', 250, 250, true); | |
add_image_size('large', 500, 500, true); | |
add_image_size('xlarge', 1000, 1000, true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -i '/<wp:comment>/,/<\/wp:comment>/d' wordpress_wxr.xml | |
sed -i '/<wp:comment_status>/,/<\/wp:comment_status>/d' wordpress_wxr.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base.html' %} | |
{% block content %} | |
<h2>Hello world!</h2> | |
<p>{{ extra }}</p> | |
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Inside the class example.""" | |
from wagtail.core.models import Page | |
class YourPage(Page): | |
"""Your Wagtail Page Type.""" | |
template = "templates/your_page.html" | |
# Your other Page fields | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Your Django Template --> | |
{% for tag in tags %} | |
<a href="{{ tag.slug }}">{{ tag }}</a> | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Custom Page model(s).""" | |
from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel, StreamFieldPanel | |
from wagtail.wagtailcore.fields import StreamField | |
from wagtail.wagtailcore.models import Page | |
from wagtail.wagtailsearch import index | |
from .streamfields import * # Replace * with the streamfields you want to use | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Register a custom Wagtail Snippet.""" | |
from django.db import models | |
from wagtail.admin.edit_handlers import FieldPanel | |
from wagtail.snippets.models import register_snippet | |
class Category(models.Model): | |
"""Category information.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""Blog app models.""" | |
from django.db import models | |
from django.utils import timezone | |
from wagtail.admin.edit_handlers import FieldPanel | |
from wagtail.core.fields import RichTextField, StreamField | |
from wagtail.core.models import Page | |
from wagtail.images.models import Image | |
from wagtail.search import index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$name = (isset($_POST['name']) ? $_POST['name'] : ''); | |
$email = (isset($_POST['email']) ? $_POST['email'] : ''); | |
$password = (isset($_POST['password']) ? $_POST['password'] : ''); | |
$notification = '' | |
if( ! empty ( $name ) && !empty ( $email ) && ! empty( $password) ) { | |
$notification = "<div class='alert alert-success' role='alert'> | |
<h4 class='alert-heading'>Well done!</h4> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# templates/blog/blog_post_page.html #} | |
{% extends 'base.html' %} | |
{% load wagtailcore_tags %} | |
{% block content %} | |
{{ self.richtext|richtext }} | |
{% endblock content %} |
OlderNewer