Jump to content

ryan

Administrators
  • Posts

    17,245
  • Joined

  • Days Won

    1,705

Everything posted by ryan

  1. I took a look at your PHP info, and nothing jumps out to me as a problem. It looks like the server isn't allowing us to create directories, so Adam is right about the permissions issue. What's strange is that the installer isn't giving you an error on the first screen, saying that the /assets/ dir isn't writable. So apparently the directory is writable, but it won't let you create new dirs within it. I'm not really sure what permission would cause that (Adam?). You could install locally and then just copy all the files to your host. Export the database, import to your host, then update /site/config.php with your host's database settings (at the bottom of the file). But if you can't create directories on the server, this is going to prevent you from being able to add assets to new pages, as it creates a new dir off of /site/assets/files/[page id]/ for each page. So I think it's an issue that needs to be solved either way. Do you have shell access on this hosting account? I'm thinking you could try to install again, but do this after unzipping and before installing: chmod -R og+rw ./site/assets chmod -R og+rw ./site/install That shouldn't be necessary, but it's what I would try next, as it sounds like we're losing the writable permission somewhere.
  2. Well if it was a cache issue, it affected mine too because I duplicated the issue here as well. I resorted to running all image insertions through the resize and letting PHP decide whether to perform the resize (Javascript is not my first language). I pushed another commit to account for this.
  3. I'm starting to see why many CMSs take the icon approach too. Personally, I am not a fan of icons... 80% of the time, I have no idea what an icon is for in an application, even if it is pretty. And once I figure it out, I can't ever seem to remember what a given icon is for either... But I think part of that is just growing up with MS DOS rather than a Mac. I don't know what I'd do without tool tips.
  4. I have just committed an update to fix this issue with the image editor, and you should see it on GitHub. Thanks for finding this and reporting it. It appears that I broke this a week or two ago when making some other upgrades to the image editor. I'm very glad to hear you'd like to be part of the project and welcome your contributions. Btw, since you've tried this in IE, you may have noticed there is an issue with the image editor in IE8 (modal overlay problem, that I've yet to figure out how to fix). I've not yet tried it in IE9.
  5. You are right. I just tried and was able to duplicate it in Firefox too. I must have broken it during a recent update to this module. I will work on a fix now and hope to post shortly. Thanks, Ryan
  6. Hi Jose, What browser are you using? Wanted to check, just in case. Then I'll go in and try to duplicate. Thanks, Ryan
  7. Yeah but it shouldn't prevent the installer from running... The installer will just say "this dir isn't writable, and it should be". Since it appears the installer threw a fatal error before even running, I'm thinking all the files got unzipped into one dir (root) rather than in the proper structure. But so far it's a mystery.
  8. I'm interested too. I didn't realize some of the language variations you mentioned. How do other CMSs do it in Slovak? Especially the issue you mentioned about different words depending on number of pages (1, 2-4, 5+)?
  9. This is consistent with what's being planned. A "channel" would be defined as a selector or combination of selectors that can lead to a group of pages outside of the page tree. For instance: template=news, sort=-modified That would be a selector that lists all news items regardless of where they live in the tree structure, and places them in reverse chronological order according to when they were last edited. So I think of that as a "news" channel". If you wanted to do it from one of your templates, you would do this: $items = $pages->find("template=news, sort=-modified"); echo $items->render(); // or iterate and display your own fields I'm thinking of this channel view as being kind of an advanced search engine, where you can build a selector to look at a particular view of pages (channel). Then you can perform operations on the pages together as groups. You could predefine your own channels for later use in the admin or the API. Some parts of the admin would also predefine their own channels as well. For instance, there would be a link for each template in "Setup > Templates > Template" to display all the pages that use that template. The nice thing about this channel view is that it will be relatively easy to implement since all the page retrieval, field matching and pagination is already done... it's just a matter of building a nice interface around it. The only reason I haven't done it yet is because in my own sites I usually build the channel views on the front end of the site (with templates). Many of them make it in the public site, as views that are useful on the admin are very often useful to the site's users too. Also, I wanted to add that the existing Pages tree is customizable in terms of sorting and what fields it displays. http://processwire.com/talk/index.php/topic,120.msg749.html#msg749
  10. In your /site/config.php there is a setting in there called: $config->loginPageID = 23; Change 23 to the ID of the page you want to be the login page. If you want to use a given login page only in some instances, I believe you can also change that $config item at runtime. For example, you might put this in some main template for your site: $config->loginPageID = $pages->get("/tools/login/")->id; I haven't tried this, so let me know if it doesn't work and I can find another way to do it or make it part of the template config as you suggested.
  11. Looks good! I didn't do a lot of testing with the function I posted previously, so if you find any bugs that aren't easy to resolve, just let me know and I'll fix them.
  12. I think it's possible that your archive didn't unzip properly. Can you double check that these files were created in your web root when you unzipped the ProcessWire ZIP file: /index.php /site/ (directory) /wire/ (directory) ...and some readme text files... If you see both /site/ and /wire/ there, that will help us to rule out a couple of things. Let me know what you see either way. If you'd like, create a file on your server called test.php with nothing but this in it: <?php phpinfo(); Then load that in your browser. Post the URL here if you are comfortable doing so, or email me the result. Remember to delete the test.php file once it's no longer needed.
  13. I think we can automate the field creation part relatively easily. My plan was to add an Export/Import option to Admin > Setup > Fields, and it would basically export a JSON profile of all the fields you selected. Then you could paste that profile into another site into the "import" textarea, and it would create all the fields. The same thing could probably be done at the template level too. The idea you mentioned of a module is also a good one, though I'd probably be inclined to do the export/import described above instead. But here's how you'd go about doing the module if you wanted to. The module would exists to add the fields and templates needed for news. When you click "install" on that module, it would create the fields and templates automatically just with API calls. For example, here's how your module code might do it in it's ___install() method: <?php public function ___install() { $summary = new Field(); $summary->type = $this->modules->get("FieldtypeTextarea"); $summary->rows = 3; $summary->name = "summary"; $summary->label = "Summarize this news item in 1 paragraph"; $summary->save(); $datetime = new Field(); $datetime->type = $this->modules->get("FieldtypeDatetime"); $datetime->name = "datetime"; $datetime->label = "Enter a date"; $datetime->dateOutputFormat = "m/d/y"; $datetime->dateInputFormat = "m/d/y"; $datetime->defaultToday = 1; $datetime->save(); $fieldgroup = new Fieldgroup(); $fieldgroup->name = "news"; $fieldgroup->add($this->fields->get("title")); $fieldgroup->add($summary); $fieldgroup->add($datetime); $fieldgroup->save(); // copy your default news.php template to /site/templates/, assuming your server will let you... copy($this->config->paths->YourModuleName . "news.php", $this->config->paths->templates . "news.php"); $template = new Template(); $template->name = "news"; $template->fieldgroup = $fieldgroup; $template->save(); } Because we don't have the documentation complete to the level of detail of individual fieldtypes, you'd currently have to look at what was configurable with each field. The simplest way to do this is probably to view the source when editing that field in the Fields editor, and looking at what configuration options are available under the "Fieldtype Settings" and "Inputfield Settings". Or just ask me. You might have your module add a hook or two, like PageArray::renderNewsItems() or something like that, if it was helpful to do so. <?php public function init() { $this->addHook("PageArray::renderNewsItems", $this, "renderNewsItems"); } public function rnederNewsItems(HookEvent $event) { $pageArray = $event->object; $out = "\n<ul class='nav'>"; foreach($pageArray as $page) { $out .= "\n\t<li><a href='{$page->url}'>{$page->title}</a> {$page->datetime} {$page->summary}</li>"; } $out .= "\n</ul>"; $event->return = $out; }
  14. I think you are both right. Having the two buttons would be great for people that routinely need to do both. But it's also true that it's one more thing to think about. On the page editor, it might be nice to have a collapsed field at the bottom that says "After Save...", and then radio buttons that let you choose: 1. Continue editing 2. View page 3. Return to List 4. Create new sibling page So you wouldn't see those options unless you clicked on the "After Save..." label to open it up. A checkbox would let it optionally keep your setting. This is kind of a power-user thing, so this functionality would be in an optional add-on module rather than something built into the core. Personally I would only use #1 and #4, but it sounds like #2 and #3 would be popular with other people too. For other types of editors (not page editor) it would be similar, but without option #2 of course.
  15. I also need to make a new HelloWorld module to put in there too. The one that comes with it now is kind of specific to the Skyscrapers profile, which isn't used by many people.
  16. I agree. I think this is something we'll definitely have to do. Would be great to have a 1-step backup that includes database and site files. Though it could be a slow process for very large sites.
  17. Looks like great solutions. Here's one more: <?php function treeMenu(Page $page = null, Page $rootPage = null) { if(is_null($page)) $page = wire('page'); if(is_null($rootPage)) $rootPage = wire('pages')->get('/'); $out = "\n<ul>"; $parents = $page->parents; foreach($rootPage->children as $child) { $class = ''; $s = ''; if($child->numChildren && $parents->has($child)) { $class = 'on_parent'; $s = str_replace("\n", "\n\t\t", treeMenu($page, $child)); } else if($child === $page) { $class = "on_page"; if($page->numChildren) $s = str_replace("\n", "\n\t\t", treeMenu($page, $page)); } if($class) $class = " class='$class'"; $out .= "\n\t<li>\n\t\t<a$class href='{$child->url}'>{$child->title}</a>$s\n\t</li>"; } $out .= "\n</ul>"; return $out; } Usage: <?php // no params: print out tree menu from current page to root parent echo treeMenu(); // or specify what you want it to display echo treeMenu($page, $page->rootParent);
  18. Sounds good. I will put together a code sample. I'm leaving to pick up my daughter from school now, so may not be back online for awhile. But I will post as soon as I can.
  19. Strangely, there is a /site/modules/ in the master copy of my default site profile. But you are right that the dir doesn't exist in the git clone or the installation zip. I'm wondering if Git is ignoring it because it's empty... if need be I'll put a "hello world" module in there as a placeholder.
  20. I think you are doing a great job of understanding this stuff. I haven't actually written the documentation for fieldtypes and inputfields, so I'm impressed that you seem to have figured this out on your own.
  21. Are you looking for something that generates a nested list from current page down to homepage? That's what it looks like, but I just wanted to double check.
  22. Great it looks like it works for me once I added those! Cool fieldtype. My computer doesn't recognize something about the language/localization, as all the buttons are a series of question marks. But I think that's just because my computer must not have that language installed. I'm wondering if it would still work if you output those two scripts from your formatValue function, since you are already outputting an inline script there? Though it may be that Google Maps requires it to be loaded in the <head> section, I'm not sure. Also, I recommend placing your GMap module in /site/modules/ rather than /wire/modules/. This is because /site/modules/ is for user-installed Fieldtypes, whereas /wire/modules/ is for Fieldtypes that are permanent. When you upgrade ProcessWire, you replace the entire /wire/ dir, so you don't want to put anything custom in there. Whereas everything in /site/ is custom to your site, so any modules you put into /site/modules/ won't get overwritten when you upgrade ProcessWire.
  23. What is the context of where that error occurred? Are you trying to load ProcessWire from Drupal? If so, it sounds to me like Drupal probably has it's own "User" class that is conflicting with ProcessWire's. You may be better off using ProcessWire as a web service in this case. That RSS feed module I posted yesterday would be a great way to pull the data into Drupal.
  24. I installed it and tested it – very cool! It looks like you already know how this all works. And it looks like your Fieldtype is nearly functional on the front end too. This helps me to see what you are doing, and I should be able to answer any questions you have more easily now. Actually I've been wanting to make a Google Maps fieldtype, so am happy you are making one already. Just let me know if there is anything I can do to help. Thanks, Ryan
  25. Sounds like a good idea to me. It's possible it may be easy to implement, but I need to do a little more research.
×
×
  • Create New...