Jump to content

Jonathan Lahijani

Members
  • Posts

    633
  • Joined

  • Last visited

  • Days Won

    24

Posts posted by Jonathan Lahijani

  1. I'm looking to improve my editor (VSCode) in a way whereby it will tell me the value of a ProcessWire setting() value that's been defined in another file as I write an override setting.

    Let's say I have a file called /site/templates/settings-default.php with the following:

    setting("my-div", "my-default-class");

    And I have another file called /site/templates/settings-override.php with the following:

    setting("my-div", "my-override-class");

    As I'm writing that specific line in "settings-override.php", is it possible through some sort of auto-suggest / intellisense for it to tell me the value of the setting in "settings-default.php" so that it provides context in realtime as I write the override setting?  This would prevent me from having to switch between the two files in my editor and improve my workflow.

    Any suggestions would be appreciated.

  2. I have PageFrontEdit enabled.  I have a template that includes a bunch of partials.  Those partials contain the PageFrontEdit tags in the following format:

    <edit field="body" page="<?php echo $page->id; ?>">...</edit>

    This is all working well, however I have a particular template whereby I don't want Frontend Page Editing to be activated at all, as if you were logged out.

    https://processwire.com/docs/front-end/front-end-editing/

    What's the best way to disable it for a particular template? Is there a proper hook for this perhaps?  Or some hackish JS approach?

  3. On 6/25/2019 at 4:53 PM, wbmnfktr said:

    ye.thumb.png.4cc3f6ecb10e1d1314384a3955c576c4.png

    There is no need to run Windows or WSL(2).

    Back on Linux with my beloved X1 and the Ubuntu i3 setup. Amazing what you can accomplish when your setup is set up right. Totally weird.

    I follow Linux desktop trends quite a bit. This post has got me thinking if it's time for Linux on the desktop for me despite MS innovations. I gave it a bit of thought and I think I can make it happen, even if I have to run Adobe CS through a VM.

    I'm much more comfortable with the idea now that I've been using WSL funny enough (also since I install Linux for customers every now and then... Ubuntu, RHEL, CENTOS, Suse). 

    I'm thinking Arch w/ i3, VSCode, ranger and a bunch of text user interface apps, bash scripts, etc. Minimalism as much as possible, kind of like ProcessWire.

  4. Is there a reason why you guys use Laragon instead of WSL?  I used WampServer for years, but like Laragon, its using the Windows version of Apache, MySQL and PHP.  While that works, I feel the Windows versions of those will always be second class.  Add in things like node and Windows' character limits for file paths (which I think has now been resolved) and it gets more dicey.  Also, it's probably slower.

    I don't use a Mac or Linux, so when WSL came out, Microsoft basically fixed a huge problem for people like us (Windows users doing non-Windows development... that is, LAMP stuff).

    Why not just use WSL?  You get rsync and all the Linux utilities that I don't know how I lived without.

    There's a little bit of initial setup, but I've boiled that down into 10 minutes with a set of commands that'll make ProcessWire run perfectly.

    • Like 1
  5. Quote

    Creating this site with ProcessWire represented a moment of strong professional growth.  When I started I had little knowledge of some types of language, but Processwire and its APIs give me the ability to easily build pages, manipulate data and integrate any external library easily. Thus, I was able to deepen my knowledge more and more.

    Ah, the early days of discovering ProcessWire and enjoying the constant feedback loops of development bliss.

    This is a great site.  I love seeing PW + ecommerce.

    • Like 3
  6. 11 hours ago, franciccio-ITALIANO said:

    Ok thanks I didn't know this difference between absolute url and relative url. Now I think I have solved it. Later I see if it works on the online server.
    But is there a program that allows you to create and publish online with a click via ftp, the site built on the PC?

    This article goes through many different techniques:
    https://css-tricks.com/deployment/

    My approach is using rsync inside a bash script:
    https://css-tricks.com/deployment/#article-header-id-9

    @wbmnfktr This is for you: https://css-tricks.com/deployment/#article-header-id-5

    • Like 3
  7. Very nice.

    For context, this is like custom fields for images by using repeaters.

    This request for custom fields for images natively is one that is open, and slated for core one day:
    https://github.com/processwire/processwire-requests/issues/21

    https://processwire.com/about/roadmap/

    Quote

    Add support for custom properties in file/image fields. Currently just description and tags are supported, but it's clear there is strong interest in supporting more here, so we look forward to adding this.

     

    • Like 4
  8. Tip: How to "rename" an image field when the name you want to rename it to already exists

    I ran into a situation when I had two single-file image fields.  Let's call them A and B.

    I didn't like the field name of 'A' and I wanted to give it a new name of 'B', but that field name was already being used in OTHER templates and had content populated.

    Therefore we need a clever way to rename A into B.

    With non-image fields this isn't a problem, but with an image field, there's files involved, so it gets a little more complicated.

    Admin Actions can handle this using the "Copy Content to Other Field" action.

    Set Source to 'A' and Destination to 'B'.

    The way it seems to be programmed is that it won't actually make a copy of the file (which is good because I don't want to duplicate the image), but instead it seems to copy the name of the file to the destination image field.

    Once the action has been run, if you view the a page using the template you applied to the action to, you will see that the image exists in both fields.  DO NOT TOUCH THEM because whether you delete from A or B, it will delete in both fields.

    So now to complete this renaming, edit your template file and remove field "A".  It will remove the field, but it will NOT remove the image, which is good.

    The end result is you now have image field 'B' with the contents from 'A', without having had to duplicate the image (meaning any references to that image will still be intact and not 404) and without ProcessWire having deleted the image when you removed "A" from your template.

    ?

    • Like 3
  9. In regards to dev vs live htaccess, you can also use htaccess's "if" conditional for blocks of code you want to selectively enable/disable depending on the site being loaded.  By doing so, you don't need two separate htaccess files to maintain.

    When using ProCache combined with it's htaccess recommendations at the top, I wrap it inside a conditional like this:

    #################################################################################################
    # ProcessWire ProCache recommended .htaccess tweaks for expires and gzip performance settings. 
    # PWPC-3.0 Keep this line here for ProCache identification purposes. 
    #################################################################################################
    <If "%{HTTP_HOST} == 'my-live-website.com'">
      ...the code here...
    </If>

     

    • Like 6
    • Thanks 2
  10. 29 minutes ago, Mikie said:

    Yeah, but the hype behind it was that everything was swappable, including ssd drives and cpus. There are expansions slots but one of the main issues with the trashcan Mac Pro was that you couldn't upgrade cpus, I'll be interested to see if that's possible. 

    You can upgrade every component in this new Mac Pro... it's basically a normal tower.  Also, you could upgrade the CPU in the trashcan... it was just difficult (my friend runs a Mac business and has upgraded them hundreds of times).

     

    • Like 1
  11. Regarding the price, it remains to be seen how much "Apple Tax" there will be in it, but with higher end hardware, Apple's price offering sometimes matches comparable non Apple systems, and you get Apple's cool design and better resale value.

  12. 12 hours ago, Mikie said:

    Would you ever get one of these Mac Pro's @Jonathan Lahijani?

    No, web development doesn't need that kind if power, not even close. This system is targetted to high end video and audio production. Plus I'm a Windows guy.

  13. 7 minutes ago, Mikie said:

    What happened to all the talk for years of the upcoming “modular” Mac Pro? Does this live up to the hype? I didn’t see “modular” on the product page but I only skimmed through.

    "Modular" is just a fancy word Apple used to say it's a normal tower design whereby the components can be upgraded and are not soldered in.

    • Like 1
×
×
  • Create New...