WordPress.org

Ready to get started?Download WordPress

Forums

WordPress as a CMS (5 posts)

  1. bobbykjack
    Member
    Posted 3 years ago #

    I'm trying to use WordPress as a CMS, for a site on which 'blog posts' will only be a minor feature, and one stretching the notion of a 'blog', at that. In other words, they'll be news stories: like blog posts in terms of the fact that they have content and a date, but unlike blog posts since there won't be any commenting.

    The rest of the site will consist of static pages, plus some home-baked PHP functionality. There is a requirement for an editor to be able to update some of the content on the static pages, using the WordPress WYSIWYG editor.

    My initial challenge is to get together a page that contains two editable sections of content. Those sections should be independent, and both editable via the WYSIWYG editor. In this initial simplification, there will be no custom requirements; in fact, there will be no requirements for date/time storage, title, or anything at all other than free-form HTML content.

    The closest I've got to this is:

    • A 'Page' with a custom template
    • That custom template includes the following for each area of the page that can be edited:

      query_posts(array('name' => 'name-of-content-chunk', 'post_type' => 'content-chunk'));
      get_template_part('content-text');

    • The 'content-chunk' template simply displays the post content

    I get the feeling that, for this simplified version, I could probably use pages instead of posts, although including a page requires an additional wordpress plugin. In addition, if I want anything custom beyond this simplification, I'm pretty sure I need to use custom posts.

    Does anyone have a tutorial which describes how to use WordPress as a CMS in this exact manner - i.e. multiple pieces of WYSIWYG-editable content on each page? This is pretty much the base requirement of any CMS, and I'm surprised that there's very little info. out there about it (although, given WordPress' origins as a blogging platform, I can understand it).

  2. nathan12343
    Member
    Posted 3 years ago #

    I don't really get why you need independent areas of content on one published page - is it because the second area might be shared across a number of pages?

    There are a number of ways of doing this with custom fields, some great plugins etc, but I guess it will come down to how you are using the content.

  3. bobbykjack
    Member
    Posted 3 years ago #

    Partly because content might be shared, yes, partly because one chunk of content might have custom fields associated with it, but mainly just because I need the editing interface as simple as possible, and I want to restrict edits just to those chunks of content, rather than any content containing - or in between - them.

  4. nathan12343
    Member
    Posted 3 years ago #

    What I tend to do is use a 'Page' for the main content (and to give it a place in the menu structure) and then use a post for the additional content. You can call it into the page by using a custom field. This is especially handy where you are not using the blog so much.

    An alternative, but less flexible, would be to look at a plugin like Magic Fields.

  5. Darrell Schauss
    Member
    Posted 3 years ago #

    What I've done is have a template that loads the page content but below also has another "sidebar" section. But with full horizontal width allowed into the page instead of your typical widget in a column. Then using Spectacu.la Page Widget to assign a full WYSIWYG page as content into a widget. Spectacu.la will give a checkbox to exclude this special page from wp_list_pages, etc.
    Then I used Widget Logic or Widget Context plugin to tell it to only load that Spectacu.la widget on a certain page.

    http://wordpress.org/extend/plugins/spectacula-page-widget/
    http://wordpress.org/extend/plugins/widget-logic/

    How to register more sidebar sections and call them into areas of your theme.
    http://codex.wordpress.org/Function_Reference/register_sidebar
    http://codex.wordpress.org/Function_Reference/dynamic_sidebar

    Here is an example:
    http://www.obryanbarrel.com/
    The blue barrel section is actually a "sidebar" loading a real page so any images and text can be applied. Or choose to show nothing by removing the widget, without having to delete all your contents. The page contents are always in the red area.
    The green bar across the bottom is actually also a sidebar loading a real page with tables and graphics. It can be whatever information the WYSIWYG allows.

Topic Closed

This topic has been closed to new replies.

About this Topic