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
from wagtail.core.models import Page | |
class YourPage(Page): | |
"""Your Wagtail Page Type.""" | |
template = "templates/home_page.html" | |
@classmethod | |
def can_create_at(cls, parent): |
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
from wagtail.core.models import Page | |
class YourPage(Page): | |
"""Your Wagtail Page Type.""" | |
template = "templates/your_page.html" | |
# 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
"""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.""" |
OlderNewer