Jump to content

adrian

PW-Moderators
  • Posts

    10,912
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. If I understand correctly, I don't really see how that make sense. Currently the Skyscrapers site has a parent page called Architects with a lot of child pages with just a title field which lists the names of all the architects. I am not sure how it would be easier to try to rename all of these to the names of the companies you need. It would be more logical and easier to just create the company pages from scratch. You could use Page Field Select Creator like we talked about in another post, or you could use the batcher module, or the CSV importer, or write a simple script like the following: $pagesToCreate = array('McDonalds','Nike','Apple','Google'); foreach ($pagesToCreate as $ptc){ $np = new Page(); $np->parent = $pages->get("/companies/"); $np->template = $this->templates->company; $np->title = $ptc; $np->of(false); $np->save(); }
  2. http://modules.processwire.com/modules/process-batcher/ https://processwire.com/talk/topic/5835-lister/ EDIT: was on mobile before. Batcher won't actually let you rename existing pages, but you can batch create pages easily. It will be possible with the upcoming Lister module though, or you could write some code to do it yourself - it's not that hard, but you do need to consider how you would batch rename - can you give an example of the format you might want, because you have to consider not just the title of the page, but also the name with determines the url of the page, unless you are talking about hidden pages (perhaps those that belong to a page field). I can't imagine you want page-1, page-2 etc. Do you have a schema in mind?
  3. I am guessing you mean the page field select creator: http://modules.processwire.com/modules/process-page-field-select-creator/ Based on a post in the forum thread for it, I guess you found it already though. But that module that SiNNuT linked to is also very cool
  4. Hi bwakad, Do you mean the name of the child template suffix? That is configurable in the module settings, but there is also no reason why you can't change the name of the template itself after creation - like any other template, go to the Advanced Tab > Rename Template. The parent page for the list of options (the child pages) is created on the fly - it matches the field name. If you are referring to the page selector called Parent Page - I don't think it makes sense to be able to create this on the fly - it can be the Home page, or a hidden options or tools, or selects page - somewhere where to store a whole range of pages that aren't part of the site tree. I would recommend filling out the fields in the module and you can see exactly what happens. You'll end up with a field (such as Province) that you can then add to your required template and the content for the select will automatically be linked to it. Try it out and then me know if you still have questions or suggestion for improvements.
  5. You have a good point about the head and foot inc files. It looks like Ryan used the text from the default PW profile which does use that approach. His Foundation profile however actually uses a different approach using _main.php Take a look at: https://github.com/ryancramerdesign/FoundationSiteProfile/blob/master/templates/_main.php Notice that this file contains the entire structure needed for an html page. The content from the PW pages is echoed in various places in this template. For example: <div id="bodycopy" class="large-8 columns" role="content"> <?php echo renderBreadcrumbs($page->parents); echo $body; ?> </div><!--/#bodycopy--> PW lets you work exactly how you want, which can be confusing for some users at first, but you'll come to appreciate it.
  6. Here's a bootstrap 3 profile from phillip: http://modules.processwire.com/modules/process-wire-bootstrap3/
  7. There are two profiles linked to and they are both in the first post of this thread. gebeer's is the one most similar to the Foundation 4 profile created by Ryan (basically exactly the same except that it is running on v5).
  8. This is a replacement profile for PW, rather than a module in the strict sense. Because you this, you must replace those folders before installing, just like it says in the Readme. Good luck.
  9. Bootstrap: http://modules.processwire.com/modules/bootstrap-admin-theme/ https://github.com/jsanglier/Bootwire-Starter-Profile Zurb Foundation: http://processwire.com/talk/topic/5293-zurb-foundation-5-profiles/
  10. Sometimes you gotta do what you gotta do
  11. Well I am not sure I understand - the stuff inside the foreach ($related_id as $key => $val) { will only get displayed if the $related_id array has entries in it so perhaps you need to figure out why there are page ids in that array in the first place if there are no related pages. EDIT: I had some code here that I thought made sense, but then realized it didn't
  12. Also, even though the client is "always right", the reality is that they're actually not always right Unfortunately given them the ability to style fonts in an RTE field is usually a recipe for ending up with a site that looks like it's from the 90's. Sometimes you just have to be confident and tell them No!
  13. Agreed horst - we need to make GD the best it can be. I do like the idea of a drop-in IM replacement though. There are so many settings that developers could tweak with IM. One thing that should be tried straight off is using: adaptiveResizeImage instead of ResizeImage, which is what I used in the module to start with. Anyway, as I said, no time right now, but perhaps if enough people are keen and think the benefits are worth the effort, perhaps we could collaborate on this?
  14. I am not sure on the whole GD vs Imagemagick quality issue. I know years ago IM was ahead, but not sure if that is still the case. From reading around it sounds like they each have their strengths and weaknesses. That said I have always used IM until I started using PW. For the sake of experimenting, I quickly threw this module together as a way to test IM within PW. It replaces the resize method, so it will work from the admin and also template calls like: $image->size(400,0) It doesn't do anything more than the resizing at the moment - it currently ignores all quality settings, cropping etc. I doesn't try to do any sharpening either, but it's a starting point that we can play with. I need to get back to real work, but thought one of you guys might be keen to play around with and tweak settings and see what you can come up with. Obviously you need imagemagick on your server and also the iMagick extension. ImagickResizer.module
  15. Why not just change "modified" to "created"?
  16. If I understand correctly, would counting related_id work? if(count($related_id)>0){
  17. Put these lines in your htaccess: RewriteCond %{HTTP_HOST} !^sharespost.com$ [NC] RewriteRule ^(.*)$ http://sharespost.com/$1 [L,R=301]
  18. Here is a link to a post that links to several others on creating a custom front-end login: http://processwire.com/talk/topic/5121-frontend-users-validation-processing/?p=49360 Here's a great thread on creating a custom front-end form: http://processwire.com/talk/topic/2089-create-simple-forms-using-api/ PW may lack some inbuilt functionality, but it more than makes up for it in flexibility.
  19. Hi Melissa and welcome to the forums! Not exactly what you are asking for, but this might suffice for your needs: http://processwire.com/talk/topic/5835-lister/
  20. You could always place the script outside the PW templates folder and bootstrap it to processwire so you still have access to PW pages and fields for grabbing the validation messages. http://processwire.com/api/include/
  21. Usually the problem with using a PW page for processing a form is the HTML that is included in that page. You need a way to not have this extra stuff sent when requesting the page. How you do this depends on how you structure your PW pages - are you using head.inc and foot.inc includes, or are you using a main.inc? or are you making using of the before and after includes in config.php? You can make use of $config->ajax to see if the page was called via ajax, but then again, if it's just a form processing page, then you probably don't ever need to display it normally, so probably not relevant here. So, call that process page directly and make sure nothing gets rendered. Also, you mention that there is a redirect - is this coming from the process page to somewhere else? I don't think you want that when processing a form via ajax. You want the result of the processing to come back to the page on success. You can echo something back if you want. Here's a pretty decent tutorial: http://code.tutsplus.com/tutorials/submit-a-form-without-page-refresh-using-jquery--net-59
  22. What you have done echoing the url like that in the JS is fine, although you are missing the semi-colon at the end. Look at the page source code to confirm that the final jquery snippet looks as you expect.
  23. Your simplest option might be to use an iframe in the modal - that way when the form submits, it is the content in the iframe that will reload, instead of the whole page. Note that not all modal JS scripts support iframe, but lots do. If you want to go ajax, just google: jquery ajax form submission Good luck.
  24. When you say you have a tmp directory at the root, do you mean the root of your site, or the root of your server? It needs to be the latter. Otherwise, have you tried following those instructions? Create this folder: /site/assets/uploads/ and set its permissions appropriately. Then in your config.php file, enter this: $config->uploadTmpDir = dirname(__FILE__) . '/assets/uploads/'; That should work - let us know how you go. PS alternatively, you could point that config directive to the /tmp directory if it is at the root of your site.
  25. I think the issue is just your single quotes - it is looking for "$answer_text" as a string, rather than "Yes". EDIT: Have a good read through some of these links to get a better understanding of the differences between single and double quotes: https://www.google.com/search?q=php+single+vs+double+quotes
×
×
  • Create New...