• Hi,
    After dabbling with WP many ears ago I am now looking at using it again and am starting by experimenting with building themes & templates.
    I am not sure about the best way of going about creating various areas on the homepage for users to add custom content. For example say I wanted 3 ‘feature panel’ boxes with an image, title, text and link at the top of my page, other sections in the top left, top right, bottom left and bottom right of the page for users to add custom content. Do I need to create a new sidebar for each of these areas so that the user just drags content into them from the widget area ? And do I just have to accept that the user can drag any widget onto these sidebars or is there a way for me to control the content ? For example if I define and create an area called ‘Top Feature Panel’ can I restrict users to just adding an image, title, intro text and link ?
    Just need pointing in the right direction and would sooner learn how to do this natively rather than resorting to a plugin. I come from a Joomla background and am used to creating module areas (if that helps). Many thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • If you define a widget area, it can accept any widgets.
    The theme should let the user put what they want in the page, and just focus on the getting all the pieces (header, content, footer, sidebar) where they go.
    Especially with the block editor, but with other plugins that are page builders, there are many options for the user to get pages the way they want. The theme’s job is consistency across the site, not individual pages. The theme should not lock the user into using it (for the home page, for instance), and can be switched at any time, even programmatically on each page (theme switcher plugins).

    Moderator bcworkz

    (@bcworkz)

    I agree with Joy in general that themes are not meant to constrain users, something theme developers should always keep in mind. But when it comes to developing a specific site for a client who is not very tech savvy but needs the ability to edit certain page elements without any chance of them corrupting the overall layout, some site specific measures are required that are contrary to this ideal.

    WP is at a juncture with the implementation of the new block editor. It’s now possible to develop custom blocks that allow for altering content without corrupting other related elements. Short of completely removing or moving the entire block, the UI could be made “idiot user proof”.

    What was done before the block editor, and still may be done now, is defining custom fields for each element that may need editing on a page. The default custom field UI leaves much to be desired, it’s far from “user proof”. To account for this, custom meta boxes can be defined that collect information from the user in a specific manner that is difficult to get wrong.

    It can be very time consuming developing custom UIs. Many devs rely upon a custom field plugin of some sort to help them easily and quickly define a structured UI. Advanced Custom Fields is a popular choice among several similar plugins.

    Thread Starter rookiecop

    (@rookiecop)

    Many thanks for the above responses. I’ve had a quick look and it does appear that custom fields is what I am looking for and the Advanced Custom Fields plugin in particular warrants further investigation. I’ve also looked at the Elementor page builder which seems amazingly powerful, and the Pro version has Role Manager functioanlity which allows users to amend content but prevents them from adding new elements willy-nilly (which ultimately I will have to fix when they break or abuse the layout). I’m just concerned about the overheads of running such an extensive plugin and need to investigate properly whether the code it generates is clean. But certainly I have some food for thought now.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Question about Sidebars’ is closed to new replies.