Search the Community
Showing results for tags 'URLs'.
-
Add Image URLs A module for ProcessWire CMS/CMF. Allows images/files to be added to Image/File fields by pasting URLs or using the API. Installation Install the Add Image URLs module. Configuration You can add MIME type > file extension mappings in the module config. These mappings are used when validating URLs to files that do not have file extensions. Usage A "Paste URLs" button will be added to all Image and File fields. Use the button to show a textarea where URLs may be pasted, one per line. Images/files are added when the page is saved. A Pagefiles::addFromUrl method is also added to the API to achieve the same result. The argument of this method is expected to be either: a URL: "https://domain.com/image.jpg" an array of URLs: ["https://domain.com/image1.jpg", "https://domain.com/image2.jpg"] Example: // Get unformatted value of File/Image field to be sure that it's an instance of Pagefiles $page->getUnformatted('file_field')->addFromUrl("https://domain.com/path-to-file.ext"); // No need to call $page->save() as it's already done in the method Should you have an issue using the method, please have a look at the "errors" log to check if something was wrong with your URL(s). WebP conversion The core InputfieldImage does not support images in WebP format. But if you have the WebP To Jpg module installed (v0.2.0 or newer) then any WebP images you add via Add Image URLs will be automatically converted to JPG format. https://github.com/Toutouwai/AddImageUrls https://modules.processwire.com/modules/add-image-urls/
- 38 replies
-
- 22
-
Hello everyone, I recently started using ProcessWire and already manage to accomplish several things on my own, but I keep asking myself a lot of questions, among which the following: After installing a multiple sites version (first method), everything works for now as desired, but I realize that all the files seem accessible by all the domains. Let's say that site1.com can access the asset files, template or other ressources of site2.com folders and vice versa by specifying only and for example: site1.com/path_to_a_site2_folder/one_file or site2.com/path_to_a_site1_folder/one_file Would you know if there is a simple way to prohibit this kind of behavior in order to clearly distinguish each site and thus ensure the confidentiality and separation of content? I prefer to avoid the entities to be considered as a single set by crawlers and prevent access the elements belonging to each domain from another domain. Thanks for your help. Sébastien.
-
Have read loads of similar threads but can't find the deifnitive answer. I'm bootstrapping ProcessWire into a Magento installation. Everything is working fine in terms of expected PW API functionality, however I cannot get the paths for images in the site work correctly. ProcessWire is installed in a subfolder called 'pw'. If I load the PW site directly e.g. visit mainsite.com/pw everything loads fine and all image paths are correct. If I load the parent site in the root folder with the PW bootstrapped page content rendered within it, the image paths don't contain the subfolder and so are broken. So I get https://mainsiteexample.com/site/templates/img/test.jpg instead of https://mainsiteexample.com/pw/site/templates/img/test.jpg I've tried updating the rewrite base in the .htaccess file but it doesn't seem to make any difference. Have also tried various settings in the config file to no avail. Wondering if rewrite base perhaps isn't working as intended because I'm behind a NGINX/Apache hybrid environment?
- 11 replies
-
- bootstrapping
- paths
-
(and 1 more)
Tagged with:
-
Hello! I want to keep sort some pages in my page tree within a single parent, but then have the URLs for those pages ignore their topmost parent. So for example, if the page is at: [home]/buildings/architect-name/building-name I want the URL to be /architect-name/building-name I've search around the forum, and the solution that comes up everywhere is a version of the code from this post: /** * This hook modifies the default behavior of the Page::path function (and thereby Page::url) * * The primary purpose is to redefine blog posts to be accessed at a URL off the root level * rather than under /posts/ (where they actually live). * */ wire()->addHookBefore('Page::path', function($event) { $page = $event->object; if($page->template == 'post') { // ensure that pages with template 'post' live off the root rather than '/posts/' $event->replace = true; $event->return = "/$page->name/"; } }); And I can use a version of that to successfully get buildings/architect-name to appear as /architect-name But /buildings/architect-name/building-name still appears as /buildings/architect-name/building-name Is there a way to get URLs to ignore/remove that topmost parent even when the page has a grandchild? Any help much appreciated!
-
I'm in the process of building an internal tool using ProcessWire for my team to write and manage Agile user stories. (It actually started out as a quick prototype, but you know how things go with ProcessWire, I kept going for a few hours and suddenly had a pretty full-featured system. ) The way we do user stories, we have a story ID, such as "OP100", and then a title, such as "As an admin, I want to upload a PDF to attach to a user's account." I have these as separate fields, with the latter being the actual page title. These titles can get somewhat long, however, and can change throughout the lifecycle of a user story, breaking links from Pivotal Tracker. Ideally, I'd like to just use the story ID as the name / URL, so instead of "/as-an-admin-i-want-to-upload-a-pdf-to-attach-to-a-users-account/", the page would just be "/op100/". Further complicating this is that the story ID is optional (since a story can start out as just a concept that turns into an actual story later). So my ideal workflow would actually be one where the title creates the URL initially, but once there is a story ID, the URL changes to that (or even better, aliases to that). One more related thing I'm hoping to do is to concatenate the story ID and title in the admin. Any ideas on how to do this?
-
Maybe I'm missing something here, but I'm haveing a hard time to get absolute urls if PW is installed in a subdirectory thought the API... I need an absolute URL for the backend (as a redirect url of Oauth provider). To build the url i would normaly use url()->root.url()->admin – but this results in the install-path beeing present twice; domain.com/path/ + path/admin/ In order to not use $_SERVER['HTTP_HOST'] I fetch the admin page from pages – but this is also not to easy since I need to remove the root folder from path as well. My current solution is somewhat complicated: $backendUrl = pages()->get('path="'.str_replace(urls()->root, '', urls()->admin).'", include=all')->httpUrl; The above code seems to be the savest way to get the absolute url to the backend using pure PW API, am I right? It would be great if one could fetch absolute urls with something like this $backendUrl = urls()->admin->httpUrl // or $backendUrl = httpUrls()->admin SOLVED: Thank you @adrian – of course this HAD to be simpler: urls()->httpAdmin;
-
How to automatically rename the image files to a random string during the upload process? For example, I have an image named "big_poster.jpg" and I want it to be saved as something random, for example "2680542675157_cc7m541v_l.jpg"
-
I have web hosting with the following .htaccess en root, to point it to a subdirectory "audino.us", wherein I have PW installed: RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?something.com$ RewriteCond %{REQUEST_URI} !^/something.com/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /audino.us/$1 RewriteCond %{HTTP_HOST} ^(www.)?something.com$ RewriteRule ^(/)?$ something.com/index.php [L] RewriteCond %{HTTP_HOST} ^(www.)?something.com$ RewriteRule ^(/)?$ something.com [L] However when I go to audino.us/pw to access the admin, it becomes audino.us/audino.us/pw, and doesn't allow me to log in. How do I render the above to be recursive (?), i.e., to apply to all subordinate URLs? Is this to be done within the .htaccess in /audino.us, or in the root .htaccess above? Please help, I can't log in. Thanks much.
-
urls Access to the website with Processwire in a subfolder
Elías Gómez posted a topic in General Support
I am creating a site with Processwire in the subfolder /pw. If I want to access the website at http://mydomain.com/ insted of at http://mydomain.com/pw/ withoud moving the instalation to the root folder, ¿what should I do? ¿Is it possible? I want to have my FTP folders organized Thanks! -
I'm intrigued about how Processwire resolves URLS. I've been having a snoop around the database and found that each page has a "name" which looks to be it's section of a URL. The thing that's puzzling me is say a page is at this address example.com/mens/tshirts/product-name/ how does processwire process that URL? i understand it's easy enough to process just example.com/product-name/ that's just a simple database lookup, but how does it go about validating the position of that page in the database hierarchy with the hierarchy of the URL? I know that the web server is rewriting urls to /index.php?it=$uri&$args I noticed that Wordpress and other systems must use a similar technique. But how does Processwire manage to do this at such speed? Any help on how this works would be great
-
I am working on migrating a site from MODX to PWire. On the previous site, the page URLs ended in .html or sometimes .xml, and I'm hoping there's some way to write the URLs of the PWire site to end with delimiters. In most cases it's just to avoid the inconvenience of a redirect, but in at least one case there's a dependency on those URLs from outside applications (an iOS app checks the product list via a URL that ends in .xml, for example). Thanks!
-
How to auto-generate random URLs in PW? For example when we upload images on Tumblr, an URL to the post is created with a random number "95032257420": http://twotimeselliott.tumblr.com/post/95032257420 And an URL for the image is created: http://31.media.tumblr.com/2142197f5273865770be44723c2a5df0/tumblr_nagyr9INCE1r6ky2bo1_500.jpg How can we do that in PW?
-
for some reason im getting http://www.owengildersleeve.com/websites/123reg/LinuxPackage21/ow/en/gi/owengildersleeve.com/public_html/new/about/ instead of: http://www.owengildersleeve.com/new/about/ from navigation urls. not sure what could be not working. Using apache. Help would be appreciated, thanks!
-
Hello everyone, I'm working on a project where people can create their own pages on the site. Whenever anyone registers, a page with same name as username is created. Currently I'm having set up as follows: Home - Profiles - - somename - - someothername But what I need is people should be able to get a URL of their own such as example.com/somename Is there any way I can have example.com/profiles/somename to display example.com/somename? I suppose this has something to do with Hooks & routing but I'm no expert so I guess you guys can help. And happy new year to all of you. Thanks.
-
I have a hosting working on iis and it seems that plesk doesn't support friendly urls How to disable friendly urls on processwire
-
Title says it all really? Any idea why config->urls->root would display nothing? I'm guessing it may have to do with my config file but I've never seen this issue before... Thanks