Jump to content
Sign in to follow this  
franciccio-ITALIANO

Can I change the path of the template files?

Recommended Posts

 

Hi, I created many different .html, .js and .css files on my pc. Within each, there are many links to images and files stored in the standard "assets" folder on my PC. So my template on my pc works thanks to links like: "assets / img / myimage.png", or: "assets / js / myfile.js. Now I have to upload them to the server online and inside processwire. I manually created many .php template files, copied and re-glued into the html text, but no image or css file is loaded, because I have to manually change all the paths: for example, NOT "assets / img / myimage.png" BUT "site / assets / templates / styles / assets / img / myimage.png". It is very stressful to do this every time, so I thought of creating an "assets" folder not inside the "templates / styles / assets / ...." folder but right at the beginning of the folder structure, near the root and next to it. to the processwire "site" folder. In this way I can develop the html / css / js files of my site into a simple folder on my pc, and load them into processwire via filezilla without manually changing all the paths each time. Does this hurt processwire operation? I wouldn't put anything in the templates / styles folder!
 

Share this post


Link to post
Share on other sites

Hey,

Not a direct answer to your question, but rather a suggestion for a better workflow, as I can see that you're getting yourself into a bit of a mess here – and I think it can all be avoided. This is apparent from the questions you've been posting lately, and as such I really think you should rethink your approach.

Basically it seems to me that you're developing a site as a static HTML website, and then on each "server push" transforming it manually to a ProcessWire site, converting HTML files to PHP template files etc. What you really should be doing instead is developing the site locally as a dynamic one – this is pretty much the only workflow that will work well without going through a lot of manual work, or setting up a very complex and fragile transformation process.

In other words: set up a local development environment using WAMP (or something similar), install ProcessWire on it, build the site, and then push it to the production server. This way you don't have to worry about any of this tricky transformation stuff, or the resulting stress. Yes, it may take a while to set up (an hour or two even, if you've never done this before) but it's absolutely worth it 🙂

--

A more direct answer: I don't think that what you're suggesting will "hurt" ProcessWire in any way. If you only upload a new folder to the root of the site, that's fine – just be careful not to accidentally remove this directory yourself if/when you update ProcessWire 🙂

  • Like 3

Share this post


Link to post
Share on other sites

ok thanks a lot, in fact I should install wamp or something like that only at the moment I have a tired brain to engage in other things ... anyway as soon as I can ... thanks for the suggestion! ;)

Share this post


Link to post
Share on other sites
4 hours ago, franciccio-ITALIANO said:

but... with Wamp I must update with filezilla, right? 

Yes, you'll still have to somehow upload the files of your site to the server. The main difference would be that you don't have to copy-paste markup from HTML files to PHP files and change paths or anything like that, as the site you're developing locally is essentially identical with the one you have online.

Share this post


Link to post
Share on other sites
7 hours ago, franciccio-ITALIANO said:

but... with Wamp I must update with filezilla, right? 

Nothing against Filezilla, but I'd suggest you use WinSCP instead. But yes, you'll need some sort of FTP client.

A good IDE can also watch out for you and automatically upload files to your server whenever a change is detected (new file being created or saved).

Share this post


Link to post
Share on other sites
16 hours ago, dragan said:

A good IDE can also watch out for you and automatically upload files to your server whenever a change is detected (new file being created or saved).

Okay, thank you, everyone.
Now let's try laragon.
What Dragan says sounds very interesting to me. 
Is Filezilla an IDE?
WinSCP is a better IDE that can do what you said, that is "automatically upload files to your server whenever a change is detected"?

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.

Guest
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.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...