What is the best way to create a modular Wordpress theme? - wordpress

I'm going to create a theme and I would like to create a functionality that I have seen in other themes that I have used: for example every page can be created with different modules in different order (videos, images, texts, etc...) so its up to the person creating the page to decide which elements are going to be used.
What is the best way to achieve this? I have created custom templates but I have never tried to separate the content with modules, my first guess is that it can be done using WPBakery or a similar plugin because that is what I have seen in the themes I have bought but I'm wondering if that's the best option. Do you have any recommendations or maybe a tutorial where I can see how I can accomplish this?
Thank you.

Use Advanced Custom Fields plugin and create a field with multiple possible elements. So you decide how elements will look like and the client can build his own site with that modules. The chance the client will break the layout because of superfancy layout builder is nearly zero.

Related

What's the best Wordpress page builder for creating custom HTML blocks and controls?

I'm searching a most simple solution to create my own page builder system. I want to code my own blocks and then add to them some controls, only that what I choose.
So on firs fire goes ACF with ACF Extended. Works great until I didn't create more flexible fields. For example, I'm creating ROW (first flexible content) with a specified numbers of columns. Then, in each column I'm adding a BLOCK (second flexible content). Some of the blocks can contains other flexibles or repeaters. In ACF the problem is a lot of flexible and repeater fields. If is to much of them, then WP admin crash, data is saving, but sometimes only a partial.
So I'm searching other, lighter solution for that. I've tried I think every page builder like Elementor, WP Backery, Beaver. Problem is they are based on build-in elements and a lot of controllers. It's fine if someone want's to create site quickly, without coding. But I need a some kind of developer environment when I have control on each function of my HTML blocks.
So, is anyone knows what tool I could use for that?
Thaks!
You did not name it in your list, so what about the Gutenberg Editor?
It's already in the core of wordpress, so the wordpress developers thought, this is the best block editor.
You can easily create your custom blocks and controls with ACF:
https://www.advancedcustomfields.com/resources/blocks/
This may also help:
https://www.advancedcustomfields.com/blog/acf-5-8-introducing-acf-blocks-for-gutenberg/
With Gutenberg, you can be sure, this is not an editor which will be gone in a few years. It will stay in wordpress core and it is only in the beginning of becoming the best WYSIWYG Editor in the core of a cms.

Dynamic options in Options Framework Theme

I'm using this plugin options to put my subject, I make a slide of photos, but do not want to set a limit of photos, would be added as needed, any idea how to do it?
Your safest bet here would be to create a custom post type that feeds the slide of photos as opposed to theme options. The customizor framework as it stands is temperamental and is used more as a user interface for previewing layout and styling changes.
http://www.layerswp.com/ is a theme that allows what you are looking for, but it is not the usual practice as it stands now.
With that being said there are plugins available that might be able to do what you are asking. The best one that I have found is Kirki (http://wptavern.com/kirki-a-free-plugin-to-style-the-wordpress-customizer-and-add-advanced-controls).

How to make multiple editable parts on homepage/other pages in Silverstripe CMS?

I am new to Silverstripe so am still learning the best way to achieve certain results.
I have the following website: http://i.imgur.com/HHHIlwA.jpg - that I have converted into a silverstripe theme etc. I have setup the front page as a HomePage.ss.
Now I want to be able to edit most parts of the page from the CMS. I have followed this tutorial on this website: http://www.silverstripe.org/learn/lessons/working-with-data-relationships-has-many - and have created a region under the "Articles" heading in the pic which comes up as a tab on the CMS in the admin panel. http://i.imgur.com/Gi7kZmq.png
My question is, is the best way to make parts editable to make them regions like what the video has shown etc? E.g if I wanted to edit the section in the pic that has the picture of the big ring and the text next to it, am I best to make this another region? What about for things like headings etc?
Thanks in advance :)
There are several possibilities to solve this problem:
either use several $has_many for each group if you have a fixed structure
if you need flexibile structure you can use one of the several 'block' modules like https://github.com/bummzack/page-blocks or https://github.com/NobrainerWeb/Silverstripe-Content-Blocks.
There are some more modules like this around, each have pros and cons, depending if you need reusable blocks, translatable blocks, want to save the relations with Versioned etc... #lerni made an overview about those modules.

Drupal - Show content on specific page

Am I able to add the following field to a content type, so that each piece of content I create can be conditioned to a page?
Or is there a module to extend Publishing Options, where by it adds all the pages I have created (just like 'Promote to Front Page')?
If not, why is no one doing this? As a new user to Drupal this seems like it would be a handy operation. (I have already tried this module but it doesn't achieve the results I'm after).
If none of these solutions are available, what would be the best alternative way of doing this?
I've posted this question on Stack Exchange for Drupal but I need a quick answer and there seems to be a bigger community here :D
You should use Context. With Context, you'll be able to manage contextual conditions and reactions for your drupal like Regions.
Have you used Views? it is one of the most common used drupal modules. It doesn't extend publishing options directly but it does replace it in a way. You can say by example put a list of al content-types: your_own_Content_type that have the publishing options of promoted to front-page. then sort them by title, date, what ever you like.
you could also create only one view and create multiple blocks out of it. you have to understand the logic of drupal: if you want different blocks on different pages, you have to create the different pages AND different blocks
create the view for one type of content-type and make one block out of it. put this block on the desired page. All your other blocks are made with the same view, just adjust a condition in your view and create a new block out of it. You should also put all your blocks in the same region, and set the to the right pages
here you can find a lot of documentation if you run into any problems... drupal.org/project/views
Views is the best at creating a slideshow of images or any type of data on your site.
Used in combination with nodequeue it might offer near or the full functionality you are trying to achieve (check this out ... and this too) - but I don't understand your question entirely.
By my opinion Views is too complicated task for much simple request.
There is a few ideas for solution:
Easy way - You can create a specific template file or add some if statments to the node.tpl.php(specific tpl better)
For minor changes - Create a new context with "path" filter and "theme html" reaction, than hide the field by the css
Best but complicated(large usages) - create a new "view mode" and implement the display by new "hook_menu".
~ Almog

Multiple Wordpress Child Themes

I have a quick question:
Is it possible to have multiple child themes activated at once? I need to have many different page templates activate at once. If it's not possible how can I go about it?
Not that I know of. However, you can setup custom page layouts and if you need to define them differently (say background is different on each) use a custom field.
I don't think it's possible.
What you can maybe do is coding different stylesheets that you use depending on your needs. You can manage them in the php code and even switch them in javascript easily.
To activate multiple themes/child themes, you simply cannot. But you can show different layout to your visitor just by only using one theme. What do you mean by to activate many different template at once? Are you referring to how the page will going to be displayed?

Resources