Search the Community

Showing results for tags 'url'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Found 53 results

  1. So I'm new to this. But i'm trying to set up a site, and I want to have a different background image for every page. My plan was to put an image field on on every page in the template and then pass that image url to the background-image style for that page. Maybe there is an easier way to do it, but it seemed like a good place to start. Anyone have any advice on how to do what I'm saying or to do something similar. Thanks
  2. Hello, I'm wondering how to add the value of a field to a URL when submitting a form, while also processing the form with FormBuilder and storing the entry in the CMS. Is this even possible with the versions below? FB 0.2.5 | PW 2.7.2 Is there still a dedicated Form Builder forum here anymore?
  3. Hello, I am just working on a multi-language pw app. Default language is german, then comes english. the language segment for english in the url is 'en-home' , eg. '../en-home/products', I think this was taken as a default option. (this happened several months ago, so I do not remember exactly...). Now I want to change this segment simply to 'en'. However, in 'Pages...Settings', only the part AFTER 'en-home' is editable, so I do not see any possibility to change this segment. Neither do the Languages Settings offer such a possibility ;-(( Or do I miss something?
  4. Hello, I need some help with changing the URL for default language pages. I have two languages one is hidden at the moment for future use. Now I would like the default language URL to be only the site name and a page without /en how can I achieve that. I want my URL to be like and not Now only the home page has the right URL all other have /en. ... I looked through the forum but no luck so far. Thank you R Ok, I got it, I just had to delete the EN in my homepage setting and now it is working, I found it on a forum. Thank you anyway
  5. Hi, In one Page I would like to put a lot of url. There is url's field. Now, I add url's field to one template, but I don't know to add 2 or 3 or 10 url's field in that same template... the problem is simple, but processwire don't allow it...
  6. Hi all. Some days ago I migrated my website from local (xampp) to online. Everything works fine exept one thing. When i try to fill a field of the type "url" (with an external link) i get an 403 - forbidden message. Writting text in textfields , body etc. works. Now I don't know if the problem comes from processwire or the server itself... Did anybody have the same/similar troubles? Thanks for helping! cheers
  7. Hello! I have a very special Processwire Setup. Short: We use Processwire for our "Blog", which is embedded in an SAP Hybris Webshop. PW provedes the Contnet via HTML and Hybris render this HTML into the Webshop (Between Default Header, Navigation and Footer) The URLs which are created in PW are the URLs for the local HTML e.g.: If some Editor creates an article, he want to see the preview in the real webshop embedded. This URL would be: http://www.webshop.coom/en/blog/news/some-article Where and how can I create a Module which overwrites the URL with the correct one in the Admin-Area?
  8. Hello, I have a Process module with a user dashboard and I would like to have the user page edit screen at a custom URL 'myprofile'. I cannot use the default profile edit page because it does not support tabbed interfaces. The method for executing the user edit page from within my module looks like this public function ___executeMyprofile() { $processUser = $this->modules->get('ProcessUser'); return $processUser->executeEdit(); } The user edit screen displays when I go to /dashboard/myprofile. But the request is redirected several times and I end up at the URL /access/users/edit/?id=5522 which I wanted to avoid. This happens because of this line in ProcessPageEdit.module. I guess the solution lies in hooking into the ___loadPage() method from within my Process module. But, honestly, I have no clue on how to put the pieces together. So I need some pointers on how to best achieve the goal of having the current user's edit page under a custom URL in the admin area, ideally in the scenario of a custom Process module. Any help would be much appreciated. EDIT: I tried some variations of hooking like public function ___executeMyprofile() { $this->addHookBefore("ProcessPageEdit::loadPage", $this, "interceptRedirect"); $processUser = $this->modules->get('ProcessUser'); return $processUser->executeEdit(); } protected function interceptRedirect(HookEvent $event) { $event->replace = true; $event->return = $this->user; } but the hook is not being executed at all. Also when placing the call to the hook in my Process module's init() method. Also when using an After hook and not replacing the hooked method. No luck so far...
  9. I've been trying to find the reason why when I print a page on my ProcessWire website, that the page appears to have URLs that appear next to links in the entire page. For example, here is a link on the website I built: When you print the page in Chrome for example, every link on the page has a relative URL next to it with parenthesis. See attached image. I'm running ProcessWire 2.5.3. Is this something that was added recently to ProcessWire, and is there a way to turn the URLs that appear off? I also found it on another ProcessWire website - - so I know its not just me.
  10. Hi there, Is there anyway in processwire to output the URL of the site, instead of the root. Because the root returns this value: "/" and I need it to return the URL. Thanks in advance
  11. Hello (again), My project is a multilanguage one. On the homepage, I have a header menu where I display link of features, example : <?php $lg = $session->lg; echo $page->localHttpUrl("$lg").'dashboard'?> ?> My website displays french by default. The homepage is : (in french default language) The link in the code above is rendered as : When I click on this link, it does a 301 -> dashboard is a child page of the homepage. When I does the same in a non default language, such as 'en' / english for example, it doesn't do that 301 because the generated link in my code is I know there is an option in the core module LanguageSupportPageName to prefix the page of the default language by 'fr' (in my case), but apparently it's not recommended. "Choose Yes if you want the homepage of your default language to be served by the root URL / (recommended). Choose No if you want your root URL to perform a redirect to /name/ (where /name/ is the default language name of your homepage)." Maybe it's not recommended because it's causing a 301 when you arrive the first time on the homepage (from / to /fr). So how I could generate my link in the menu such as it displays ? I can do it by hacking some php of course, but perhaps there is a PW way to do it ? Thanks
  12. Hi there, I was wondering if page->url and page->httpUrl are stored anywhere in the backend? I haven't been able to locate it so I'm beginning to think these are generated or calculated on the fly? Thanks in advance
  13. Hello, Is there a way to regenerate the name from the title in the API, like: $myPage->regenerateName(); $myPage->save(); or similar? I'm looking to batch rename a lot of urls, but only once.
  14. Hi there, I am using a url schema like this: page.html page1.html etc. As the name unter settings. I don't want to start a discussion about how useful .html is Works but not for pages that have child pages, where the path would is page.html/child1.html page1.html/child4.html The page and page1 should be without html if I access the children and with if I click the parent.
  15. Hi guys, I'm a Processwire-Newbie and new to this forum. Happily I have to struggle with very few difficulties, thanks to the clear and pleasing concept and structure of PW. Currently there is only one thing that makes me brood: I have a main category 'posts' that contains the majority of all pages. So the regular url would be 'domain/posts/post-one' etc. As I prefer the url scheme 'domain/post-one' I followed the instructions discussed in this topic. This hook is in my 'init.php': wire()->addHookBefore('Page::path', function($event) { $page = $event->object; if($page->template == 'post') { $event->replace = true; $event->return = "/$page->name/"; } }); And this is in my 'home' template: if(strlen($input->urlSegment2)) { throw new Wire404Exception(); } else if(strlen($input->urlSegment1)) { $input->urlSegment1; $name = $sanitizer->pageName($input->urlSegment1); $post = $pages->get("/posts/")->child("name=$name"); if($post->id) echo $post->render(); else throw new Wire404Exception(); $renderMain = false; } else { // regular homepage output $posts = $pages->find("parent=/posts/, limit=$limit, sort=-date"); $body = renderPosts($posts); } Both templates 'home' and 'post' have 'url segments' option activated. On the first sight everything is working fine. $page-name outputs '/domain/post-one' and the page '/domain/post-one' ist getting displayed. What's frighening me is the fact, that 'domain/posts/post-one' is working as well. This means 'post-one' can be adressed with two different urls, and I’m not sure how to rate that. On one hand, nobody will ever notice the '/domain/posts/page-one' option, as it's listed nowhere. So I could just ignore it. On the other hand, I don't know for sure if this presumption is correct. Maybe there are unknown channels where the 'wrong' urls will be spreaded, then there will be 'doubled content' which is bad, as far as I know. So what I'm asking for: Is there an easy way to avoid the double url-scheme option and output a 404 error, when 'domain/posts/page-one' is called? Or should I just don't care, as it doesn't matter a all? Unfortunately, I don’t fully understand every line of the second code, so I would be very grateful if someone could light it up for me a bit. Thanks + regards Ralf
  16. Ill try to explain this as best I can. I am making a site map and using the following: foreach($page->sitemap as $site) { $out = "\n<url>"; $out .= "\n\t<loc>" . $site->httpUrl . "</loc>"; $out .= "\n\t<lastmod>" . date("Y-m-d", $page->modified) . "</lastmod>"; $out .= "\n</url>"; echo $out; } This works perfectly and the url displays as . I was wondering for the sake of this question, is there a way to only pull from /page-one in the url? I know $site->url would give me data/datasetone/page-one, but I really need just the page name
  17. Hi, I'm quite sure to have read everything, doc and forums, about urlSegment, but I'm still not understanding how to use it. After have set my categories with this excellent post, I'm unable to fix url as I want. Page title | Template | actual url | url I want Categ-publi | parent_categ | categ-publi/article | publication/article -- Article | categories | Publication | basic-template | publication/example1 | publication/article/example1 -- example1 | publication | For which template I should activated urlSegment and in which template file I should add some code, probably something like this (which didn't work obviously)? if($input->urlSegment1 == 'publication') { echo $pages->get('/publication/$categ/')->render(); return; } else if($input->urlSegment1) { // throw a 404 throw new Wire404Exception(); } Thanks so much. Melanie
  18. Preamble: Processwire is awesome and the freedom of development is quite insane. Issue: When using CKEditor and entering a URL, it says: "Enter a URL, email address, anchor, or enter word(s) to find a page." I have installed the multilingual module, so I need to target: /en/contact/ and /de/contact/ and /lt/contact/ Adding a link to the text, I can only add one of those 3 contact links. When copying the text (including links) into another body (another language), then I need to edit each link to set the correct language - every time. Idea for solution: Is it possible to allow entering either: 1. The page id (then the module could read this and create a URL), or: 2. A placeholder for the language, e.g. "*contact" (then the module could replace the asterisk with the language identifier) Thanks in advance for your ideas.
  19. Hi all, I'm experimenting building a content site based on AngularJS and Processwire. I‘ve turned on the html5Mode in angularjs, everything works so far re agularjs routing, but when I try to refresh a page, only loads a page without header (thus no js/style). This to me seems a classic problem with server setup ( ), which requires htaccess setup (I'm on Apache server). But not quite sure how to set up the htaccess? Attached is my htaccess, with below are some routing settings of angular: scotchApp.config(function($routeProvider,$locationProvider) { $routeProvider .when('/news', { templateUrl : 'news', controller : 'mainController' }) .when('/about', { templateUrl : 'about', controller : 'aboutController' }) .otherwise({ templateUrl : 'news', controller : 'mainController' }); $locationProvider.html5Mode(true); }); THANKS advance for all your help! htaccess.txt
  20. We have a members area (accessed via a login) which lists a load of horses. Much of the information here is members-only and has been stored as pages in the backend of the website (via a feed). We now wish to consume this information on the frontend (public) area of the site. In my template I can easily grab the horses and loop through them but on the frontend $horse->url returns the members area url so: members/horses/horsename Rather than /public/horses/horsename Is there a sensible way to solve this or am I going to have to resort to creating a custom URL format. grabbing a reference and passing it to the next page? Many thanks Pete
  21. I seem to be having trouble with url segments on a projects. I'm working on an arrest report system and will provide the structure. What I have is a page called arrests in the back end that loads up an arrests.php file. Under arrests, in the back-end (with URL segments enabled), I have two pages that only store data, they don't load actual .php files. structure in the back-end (see attached photo) /arrests (loads arrests.php) -February 2016 - a page that uses a template called arrestlog that only stores data, it has no .php file -March 2016 - a page that uses a template called arrestlog that only stores data, it has no .php file when my site loads /arrests/ my arrests.php performs a find('template=arrestlog') where I display only the most recent addition, in this case data for March 2016. So, if you go to /arrests/ in a browser, arrests.php does a $pages->find() and displays only March 2016 data. What I'm trying to do is create a "next" link that loads : /arrests/february-2016/ So, when arrests is passed a url segment1 I can pull that url segment, then run a find on it to display february data. I could use /arrests/?id= method to callback arrests.php passing a parameter, but, I'd rather use a friendly url segment if possible. The end result is I'm getting a 404. Assistance is much appreciated.
  22. The current use of relative urls (in my opinion) is great. However, I have a project that requires image paths to be absolute (using the source code module so the code can be dropped in different pages outside of processwire), ie: . Is this possible to do in processwire? I had searched around but couldn't find anything regarding the topic. Sorry, I forgot to post this. I am currently calling images like so: <?php echo $page->headerImg->url; ?> which produces: <img src="/testing/site/assets/files/1035/header.jpg" >
  23. One of my blogs seems to be accessible from multiple URLs and it's affecting my clients SEO. For example, using the following URL structures, I can access the same page. http://www.domain.not/blog/page2/ http://www.domain.not/blog/posts/page2/ The correct one is probably the second one as all posts are children of blog. My actual blog structure is as follows Blog - Posts -- Post A -- Post B -- Post C (etc) - Tags - Categories I have pagination enabled on a template called blog-posts which is applied to the Posts page. I'm not sure though why the double URL is occouring?
  24. I have an external database with a list of items, each one identified by an id. I would like to integrate this database into the CMS.<id> I have created a page, but not the dependent pages. If link to the ids, Processwire tells me that they don't exist. Can I use the id urls without creating the pages? The id urls should use the parent url as template and use <id> as a parameter. In short, a parameterized template.
  25. Hi, I created a table and have a column using the URL field type; how do I add a ahref tag via the API so that on the output, the URL is clickable? Below is the section of code and any suggestions would be great as I'm a newbie! foreach($page->tbl_CompanyURLs as $c_url) { if($c_url->url_company) echo "$c_url->url_company<br />"; if($c_url->url_updated) echo "$c_url->url_updated <br />"; } Cheers, Tiffany