Jump to content

Creating dynamic blocks on a per page basis

Recommended Posts

If you are concerned about the total number of fields in the profile, any template that uses a text align field can use the same text align field.  ie. Text, blurb, sections, etc.   I think it is a necessary add to have a page builder.  

If you are concerned about it slowing the page load down, it doesn't seem to.  I don't have caching enabled and it is snappy.  Turning template caching on removes the issue even if there is one.

I could get by with just one text align field, but I like having one for small screens and one for larger screens.  That way I can make text center on mobile when the column stacks, but left align on desktops when they are side by side, without writing code.  I think it is worth it.

I still have a website that runs on a database less than 1 mb.  At least until I import all of their blog posts.  You could run the whole thing in ram.

Share this post

Link to post
Share on other sites

Well you have thought of it all. Great work, keep it up 🙂

Share this post

Link to post
Share on other sites
10 minutes ago, MilenKo said:

Well you have thought of it all. Great work, keep it up 🙂

I dont think I have it down yet.  I really think a page builder needs to live update while you change fields to be competitive with things like DIVI and Beaverbuilder and Elementor.  This is what I am working on with vue.  I am just looping through all fields attached to the page and making vue form fields that have 2 way databinding.  So when you type new text in, it changes as you type.  Or if you hit center text, it centers it instantly.  I am using the REST API plugin to push the page data back to the database when you hit save.

I plan on releasing the site profile to the community when I am done. 

It should be better than the above wordpress solutions as they are very hack solutions.  You can not, for example, add any element inside a tab module or an accordian.  You can only type manual code into their rich text.  With mine, I can add a grid with columns or really anything inside anything.

  • Like 3

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By louisstephens
      So I was tinkering around with the "select fields" field type and added it to a repeater. My thoughts were I could have a user select a field (textarea, text, etc etc) that I defined and give it a name (another field in the repeater) and create their own form on the page. To be honest, I am now a little lost with rendering the form and mailing the results as potentially the form will be unique and custom every time.  The only way I know to handle the output is by going about it this way:
      $forms = $page->form_select_fields; foreach($forms as $form) { if($form->name === "form_input") { //output input with custom name } elseif($form->name === "form_textarea") { //output input with custom name } } Is there a better way to go about rendering the elements from the repeater? As far as the custom sending goes, I am really at a loss since it would be pretty dynamic. Has anyone used this type of approach, and if so, how did you handle this without going insane?
    • By mikeuk
      (apologies if this looks too similar to previous topic I created, seems more logical as a new topic)
      I'm curious if anyone here is implementing something along the lines of Drupal's block / Joomla's custom (editable) module functionality?
      In other words, areas that are editable in the backend, that can be placed on multiple pages without needing to re-enter the content on each page it is used.
      I tried to do this using a page as a block, and then field type Page (to get a page within a page), but this led to issues with rendering, and more important this creates an object $page->fieldtypePage which is exceptionally large, so I would prefer to avoid that route.
      My guess is those that do it, do it outside of PW with PHP. But the 'blocks' being editable and creatable by a site editor is important so I need to explore this or find a different solution (or tell the client no-can-do).
    • By DarsVaeda
      I have the following simplified layout on my page:
      row1_card1 - row1_card2 - row1_card3
      row2_card1 - row2_card2 - row2_card3
      You can add as many rows and cards per row as you like. Each card has a title, text and a button whose text is the same on every card but should be editable too, just not individually.
      I wonder what is the best approach to do this without making it awfully complicated to setup in the admin from an editors perspective.
      I thought about a solution using a PageTable for the rows and a Repeater for the cards but that started to be complicated to setup even.
      It would be awesome if you could use the FrontpageEditing to edit these cards and even add more or add rows.
      How would you implement it?
    • By mrjasongorman
      I'm just wondering if there a way of creating block like functionality similar to say Episerver / drupal blocks??
      I guess i could treat the template as a view that loads in sever partials (kinda like blocks) ??
      Any ideas on this would be great.
    • By mrkhan
      i am trying to build one Page in CMS for menu Building.
      i have created a field name "menu_page" Page type & one text filed name "depth"
      now i have crated a new repeater name "menus" with above both fields.
      menus (repeater)                              menu_page (page type, single page)                              depth (text) now i add it one page name "header" and added values as bellow
      menus1              menu_page "about us" depth (0) menus2              menu_page "About Company" depth (1) menus3              menu_page "Products" depth (3) menus4              menu_page "Contact Us" depth (0) in my template file i have code as bellow
      <ul> <?php $menus=$pages->get("/header/"); foreach($menus as $menu) { ?> <li><a href="<?php echo $menu->url;?>"><?php echo $menu->title;?></a></li> <?php } ?> </ul> This shows TOP menu Menu but how to get SUB menu according to Dept of each menu.
  • Create New...