Jump to content

joer80

Members
  • Posts

    363
  • Joined

  • Last visited

Posts posted by joer80

  1. On 7/25/2023 at 4:31 AM, Ivan Gretsky said:

    Hi @joer80!

    AFAIK this feature is still missing due to the way ProcessWire works with files. It has been requested and discussed lot of times thought. Read this whole thread for example.

    There is a module that claims to help with AWS S3. Haven't tried it myself.

    Ok thanks.  I checked in around 6 years or so ago and we were talking about it so I was hoping someone made some progress.  I can always attach an EFS share and make a sym link to that to get it off my server.

  2. A lot of the hate wordpress gets is from people doing it wrong or being handed a website that was done wrong.  The "right" way to do them now is to use a custom fields plugin like metabox and then updates are very similar to a processwire website.  There is a custom post type the client accesses and adds posts to, and they dont mess with the design side at all.  You can even lock them out of it using roles.  You just have to use a little restraint and hit the dynamic data button on your page builder instead of typing it in.  

    And bricks builder is much better than the more popular elementor.  Clean code, made in vue3.  Even has php blocks.  Done the right way takes away many of the arguments people use against it.  I can pop one out at $130 an hour using something like frames that has predesigned rows.  https://getframes.io/

    • Like 1
    • Confused 1
  3. I have really enjoyed using Laravel with Livewire on my last project.  Its so nice to have things like database migrations and factories.  So much easier to keep the database in sync across live and dev installs.

    And it gives you an easy way to make everything more reactive, like with search fields not refreshing the whole page, and even updating as you type, and drop downs filtering without refreshing, and all in php without doing javascript for it, it really spoils you. 

    And if you need to move the file hosting in the admin section from the server to something like s3 or digital ocean, it was super easy.  I never got that working with processwire since the admin expects everything to be on the server.  That are not drivers for file storage.

    I hate to say it, but with page builders like bricks builder for wordpress that live update as you type and design, that let you knock out 15 page brochure websites in 10 to 20 hours total, and with Laravel for more complicated or custom things like cloud friendly company intranets, I find myself not reaching for processwire like I did in the past. 

    ACSS and Frames combo is really nice also.  A unified front end builder using a variable based CSS framework with prebuilt content sections that follow proper css naming conventions and accessibility, you can just pull the existing rows in? And they all read your existing color scheme and support screen set images and they are already responsive?  Game changer. 

    • Like 3
  4. This capability would directly impact how many of my projects I do in Processwire and how many I do in Oxygen/Wordpress/ACF.  I am currently only using Processwire for things that will make heavy use of the API for very custom projects, and using Oxygen for all projects that are design/marketing/brochure heavy.  Its just so much faster to see changes as I make them.

    This is what I would like to see, working backward from the user side to the tech side.

    When I edit a page, as I am changing fields, if I change a text box or a drop down or a range slider to change a heading font size, my page preview is updated as fast as possible, so I can see what that new heading size looks like on the page.  As soon as the field is changed, it adds the change to a change history list that I can use to roll back edits I don't like without needing to remember what changed.

    Next, when I am ready for the user to see my changes I have made to my draft version of the page, I can hit a publish changes button to make my draft version replace the live version of the page.

    I am assuming editing the page in this live preview mode would need to make a new copy of the page that would replace the live page if you save it.

    Right now, I must save after every font size change to see if it works, and it doesnt remember how far down the admin page I was, so I must scroll all the way back down to that field and change the size again and hit save again and switch tabs again.  Its not a great experience.

    These changes would be great!

    • Like 3
  5. On 3/2/2021 at 12:45 PM, BitPoet said:

    There might be a better approach, but this snippet in site/ready.php works for me:

    
    <?php namespace ProcessWire;
    
    $wire->addHookBefore('ProcessPageLister::execute', function(HookEvent $event) {
    	
    	if($event->page->process != "ProcessUser")
    		return;
    
    	# Put all fields that should be searchable by default here:
    	$userSearchFields = ['email'];
    	# We create a comma separated field selector string from the array above for use by ProcessPageLister
    	$searchFieldsString = implode('', array_map(function($f) { return ", $f="; }, $userSearchFields));
    
    	$lister = $event->object;
    	# ProcessUser appends the ", roles=" selector before our hook happens, so we inject our fields
    	# before that part:
    	$lister->defaultSelector = preg_replace(
    		'/(?=, roles=)/',
    		$searchFieldsString,
    		$lister->defaultSelector
    	);
    	
    });

     

    This got me where I needed to go!  This is what I did:

    $wire->addHookBefore('ProcessPageLister::execute', function(HookEvent $event) {
        
        if($event->page->process != "ProcessUser")
    		return;
    
    	$lister = $event->object;
        
        $lister->defaultSelector = 'name%=, firstname%=, lastname%=, email%=';
        
    });

     

    • Like 1
  6. In the past, one of the primary functions of a page builder would be just to implement things like flexbox, so you could have child divs stack vertically or horizontally, or align child items vertically or horizontally, or whatnot, but now the new thing is to provide a third grid option, as an easy to use front end for handling things with CSS Grid.

    Check out the way oxygen just introduced CSS grid controls.  I think we should do something similar in our approach. 

    https://oxygenbuilder.com/2021/02/23/oxygen-3-7-now-available/?mc_cid=9b6f18191d&mc_eid=c2de8efb6e

  7. 54 minutes ago, Chris Ernovsky said:

    Please... just... don't. ?
    ? https://wordpress.org/plugins/gutenberg/#reviews

    We've been there 3 years ago with WP. The same discussion, the same requests.
    The rest is history... or rather anoying present.

    I've started using PW because of its bare bone flexibility as a backend and text/content editor (not builder!).
    I don't know too much about all that PW API magic (which I truly admire) and barely scratch the surface,
    but that's more than enough to build a lighweight customized website with a desired design (here just customized Bootstrap + few js libraries).
    I don't need and I don't want any builders for that.
    Clients are extremely happy with very simplified admin dashboards and some of them ran away from Gutenberg and other WP builders last year.

    I'm perfectly aware that there are different clients, developers, trends and expectations.
    I just feel (and see) that we're overcomplicating and overbuilding websites (and tools) these years...
    Just sighing, Guys...

    All the best to Ryan and the whole PW Community in 2021!

    I dont think anyone here is wanting gutenberg.  Take a look at this video.  Its basically just the PW backend in a side window instead of full page so you can see what you are editing while you are editing.  That way you dont scroll down to a box, save, get shot back up to the top, switch tabs, hit refresh.  All that is wasted time.  You just edit the box and see the changes.

    Now, once the editing experience is updated, I think it would be nice to be able to have 2 sets of children for each page.  One for the page path/child pages/url, and one for the design rows/sections on that page. 

    So the tree would have a page path mode, and a page design mode that shows children of the page, based on the mode you are in.  In the design mode, children of that page would be rows on the page, path mode would be child pages.

    ie. When I edit a Category page in path mode, maybe it has a text field for Page Title and Page Description, which have nothing to do with design, and its children are the products in that category. 

    If I edit that same category page in page design mode, the first child page is called Intro Section, and has fields for design related settings for that row.

    I think this would be the best approach becuase the api would have a clear support for adding fields for both view modes, but not force anyone to use anspecificic front end framework or theme.  It would be nice to have a slider field time for font sizes. 

    • Like 2
  8. I know some things I have struggled with in the past is exporting fields from one website to another to jump start a project, and option fields can't be imported in.  I have to go to each of, say 20 fields, and manually copy and paste all options in for all of them. 

    When I am working in a page backend in one tab, and have another tab open with the front end to see my changes, I can save the backend tab, and instead of staying where it is at, it shoots me to the top of the page.  This isn't great.  Would prefer it to stay there so I can tweak, save, tweak, save.  Most other backend system I don't even need to hit save as changes I am making are live, but this is a step in the right direction!  Also would be nice to have a way to not have to switch back and forth between tabs.

    Getting live editing would be even better!  I even purchased the plugin for this and wasn't a huge fan of it.

    • Like 2
  9. I have been working on a way to layout the files in my template folder that allows people to have more than one theme per website, and better organize the template files and pages, and this is what I came up with.  What do you guys think?  Has anyone done anything similar?

    File Layout:

    /templates/

      _init.php. (includes and variables you want all pages to access.  I put setting('theme', 'kick-off-news'); to define the active theme.)
      default.php (Template files can be told to use this for default behavior, or you can clone its contents for more control.  I haven't needed to yet.)

    What is in the default.php file:

    <? namespace ProcessWire;
    
    //sitewide variables and/or functions. ie. Define setting('theme') as active theme.
    include('_init.php');
    
    //The default temmplate can use the default HTML for the active theme
    $templateFilePath = $config->paths->templates . 'themes/' . setting('theme') . '/default.php';
    
    //Render template file for the active theme
    echo $files->render($templateFilePath);
    ?>


    /temlates/themes/

    (Holds all theme folders.)



    /temlates/themes/kick-off-news/

    Here is what I am putting in the theme folder:

    /content/  (This has content subfolders for organization. ie. I did /by-page/ and /by-template/.  (folders can be autoloaded from page path and template name.)
    /includes/ (Used for code that will be included across templates, like navigation.)
    /css/
    /js/
    /img/
    default.php (You can clone for more control if needed, but I have not need to.)

    Below is an example of what could be in the /temlates/themes/kick-off-news/default.php file.

    <? namespace ProcessWire; ?>
    <!DOCTYPE html>
    <html lang="en">
    	<head>
    		<? include('./includes/head.php'); ?>
    	</head>
    	<body>
    		<? 
    		include('./includes/topAd.php');
    		include('./includes/header.php');
    		include('./includes/navigation.php');
    		
      		//Use selected homepage if no page path.
    		if($page->path == '/'){
    			$pagePath = setting('home'); //active homepage path. ie /pages/home/
    		} else {
    			$pagePath = $page->path;
    		}
    
    		//Load content file for this page if it exists
    		if(file_exists('./content/by-page' . $pagePath . $page->name . '.php')){
    			include('./content/by-page' . $pagePath . $page->name . '.php');
    		} else {
    			//Load content file for this template if it exists
            	if(file_exists('./content/by-template/' . $page->template . '/' . $page->template . '.php')){
                	include('./content/by-template/' . $page->template . '/' . $page->template . '.php');
            	}
    		}
    	
    		include('./includes/footer.php');
    		include('./includes/mobilenav.php'); 
    		
    		include('./includes/bottom.php'); 
    		?>
    			
    	</body>
    </html>

    The reason why I like to be able to select an active homepage is to be able to make another homepage, and flip back and forth on which one is active as needed.  No need to copy any paste data, or upload files to another page after it is approved.

    I mainly only use one or the other, as far as page or template html goes, but I guess you could use both at the same time with a few changes.  The advantage to using using one at a time is you dont need to check for a template content file if there is a page content file. 

    If you want to be able to load both, you probably need to have them set output variables, and after they are both loaded, push the results out.  Maybe an array with a priority key and html value and loop through the array after they both load. Was overkill for me though.

    How I did site Tree to organize and separate the pages from the news articles.

    Screen Shot 2020-07-25 at 4.42.42 PM.png

    I also think there is an advantage to this over sticking all template files in the same folder, as you can put related supporting files in the same group.  A news category page sidebar can be in the same folder as the news category template.  Or related news layouts are next to their parent file.

    Screen Shot 2020-07-25 at 6.55.52 PM.png

  10. So interestingly enough, my axios post by default has all of the cookies needed for the post to be done by the admin user, but it is not seen as an ajax request, so it will not continue if I force it to be ajax with

    if(!$config->ajax) return;

    This is how I am doing it.

    methods: {
    				processForm: function() { //event
    					
    					const self = this; //so .then can access outside this.
    					
    					axios.post('/post/', {
                          pageID: this.pageID,
    					  text_heading: this.text_heading
                        })
    					.then(function (response) {
    												
    						if(response.data == 'success'){
    							UIkit.notification({
                				message: '<span uk-icon="icon: check"></span> Changes saved.',
                				status: 'success', /* primary, warning, danger */
                				pos: 'bottom-right',
                				timeout: 2500
            					});
    						} else {
    							UIkit.notification({
                				message: '<span uk-icon="icon: warning"></span> ' + response.data,
                				status: 'danger',
                				pos: 'bottom-right',
                				timeout: 2500
            					});
    						}
    						
    												
      					})
                        .catch(function (error) {
                          console.log(error);
                        });

     

×
×
  • Create New...